LibreOffice Logo LibreOffice Logo Extensions, Documentation and Templates repository

New Jaguar Calc add-in

This extension adds the SQLREQUEST function to Calc. SQLREQUEST allows you to query a database using a JDBC driver or an SDBC driver.

★ ★ ★ ★ ☆
Calc Extensions
Download latest

latest release: 2024-03-21 03:03:58

Description

New JaguarSQL

New JaguarSQL is a JaguarSQL 1.0.2 update.
Within the extension file (.oxt) there is the original source code of JaguarSQL 1.0.2  which is the base of this update.

This extension adds  the SQLREQUEST function to Calc.    
SQLREQUEST allows you to query a database using a JDBC driver or an SDBC driver.
It is similar to the SQL.REQUEST function provided with old MS-Excel.
It is an array function. The result is an array containing the data returned from the data source. Calc’s online help includes the "Array Functions" section that explains how to use them.

The SQLREQUEST sintax is:

SQLREQUEST (driver, url_or_properties, sqlCommand, nRowsRequired, showColumnName, number2double, date2string, yearOffset)

To report bugs or give advice, lo.extensions@tiscali.it

Examples:

JDBC driver:
=SQLREQUEST("com.mysql.jdbc.Driver";"jdbc:mysql://server_ip_address/?user=name&password=abc";"SELECT * FROM table")

SDBC driver:
=SQLREQUEST("sdbc:odbc:mydatabase";"user=pippo;password=mypssword";"SELECT * FROM table")

Parameters

driver

It’s a string. If this string matches a full qualified java class name (for example: com.pippo.minni), SQLREQUEST attempts to use a JDBC driver with that name. Otherwise, it assumes that the driver string is the URL of a specific SDBC driver and tries to use it (see http://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Driver_Specifics#Driver_Specifics).

Example:

sun.jdbc.odbc.JdbcOdbcDriver : the bridge ODBC-JDBC until java 1.7
com.mysql.jdbc.Driver : JDBC driver for MySQL
jdbc:mysql://192.168.10.1:3306/MYDATABASE : SDBC specific driver. Driver: JDBC
sdbc:odbc:MyODBCSourceName: SDBC specific driver. Driver: ODBC 3.5

url_or_properties

It is a string or a string array. If it is a string array, SQLREQUEST concatenates each element of the array into a string.

JDBC driver
For JDBC driver, this parameter is a string with the connection URL. See the help of JDBC driver.

Example for sun.jdbc.odbc.JdbcOdbcDriver (until java 1.7):  jdbc:odbc:prova

Example for com.mysql.jdbc.Driver: jdbc:mysql://192.168.10.1:3306/MYDATABASE?user=pippo&password=paperone

SDBC driver
For SDBC driver, this parameter is a string with connection properties separates by a semicolumn.
For the allowed properties, see com::sun::star::sdbc::ConnectionProperties.
TypeInfoSettings and SystemProperties properties are not supported (com::sun::star::sdbc:: JDBCConnectionProperties).

Example for the JDBC specific driver: password=mypassword;user=pippo;JavaDriverClass= com.mysql.jdbc.Driver

sqlCommand

It is a string with the SQL command.
If it is a string array, SQLREQUEST concatenates each element of the array into a string.

nRowsRequired (Optional)

The result of SQLREQUEST is an array containing data returned from the data source.
This parameter sets the size of the array and then the maximum number of records returned.
If nRowsRequired <= 0, there is no limit.
The default value is zero.

showColumnName (Optional)

If true, the first row of the array contains the name of the columns.
The default value is false.

number2double (Optional)

If true, SQLREQUEST converts sql BIGINT, DECIMAL and NUMERIC types to DOUBLE.
The default value is false.

date2string (Optional)

If true, SQLREQUEST converts sql DATE type to STRING.
The default value is false.

yearOffset (Optional)

The offset of the year for sql DATE type.
This parameter solves my problem: the date field of ISAM file (Microfocus) of my cobol application is two centuries ahead (31.12.2016 in my ISAM file is 31.12.2216).
This parameter is used only if date2string is false.


Data type conversion issues.

Considering that Calc Add-In functions support only three types of data as return value, the following considerations have been taken:

Sql BIT and BOOLEAN types are converted to Java INT type (Uno LONG type): 0(false) - 1(true).
Sql DATE types are converted to floating point numbers compatible with Calc date/time values, if date2string is false (default value), otherwise to STRING.
Sql DECIMAL, NUMERIC and BIGINT types are converted to STRING, if number2double parameter is false (default value), otherwise to DOUBLE.
Sql TINYINT, INTEGER and SMALLINT types are converted to Java INT type (Uno LONG type).
For other SQL types, SQLREQUEST returns a string.

 

Contributors: FabioLeschanz

Release Description Compatibility Operating Systems License Release notes Updated  
2.0.0 Tested on Windows 10 and Window 7. 5.3 Linux, Windows, macOS GPL 2020-03-05 23:06:31 Download

Related Extensions

New Jaguar Calc add-in

Screenshot for New Jaguar Calc add-in

This extension adds the SQLREQUEST function to Calc. SQLREQUEST allows you to query a database using a JDBC driver or an SDBC driver.

04-2024

368

★ ★ ★ ★ ☆

Normalise Whitespace

Logo for Normalise Whitespace

Normalise whitespace in a spreadsheet.

04-2024

203

Not rated yet

AES - getObject

Logo for AES - getObject

The Advanced Encryption Standard for Libre Office Basic - getObject

04-2024

304

Not rated yet

Styles Reporter

Logo for Styles Reporter

A Calc and Writer document styles report tool.

04-2024

412

★ ★ ★ ★ ★

zzERP

Tools for managing a nano-ERP with Calc.

 
 

Not rated yet

xls 1C setting

Logo for xls 1C setting

This setting makes alien MS Excel 5.0/95 xls files export using default export filter (usually ods).

04-2024

72

Not rated yet

Feedback

★ ★ ★ ★ ☆

Post your review

You cannot post reviews until you have logged in. Login Here.

Reviews

  • carlos conteras Aug 11, 2020, 8:12 PM (4 years ago)

    ★ ★ ★ ★ ☆

    estoy aprendiendo el vivir del trading

    • carlos conteras Aug 11, 2020, 8:13 PM (4 years ago)

      estoy aprendiendo el vivir del trading

      • carlos contreras Aug 11, 2020, 8:15 PM (4 years ago)

        estoy aprendiendo el vivir del trading

RSS feed for reviews on this page | RSS feed for all reviews