User Tools

Site Tools


turbosql.htm
Navigation:  SQL Driver Strings(General) >====== TURBOSQL ====== Previous pageReturn to chapter overviewNext page

DRIVER('SQLDriver', '/TURBOSQL = TRUE | FALSE ' )

[ Nest“ = ] SEND(file, '/TURBOSQL [ = TRUE | FALSE ]' )

blk2blue.jpg

(NOTE: Not valid for the ORACLE Accelerator)

The SQL drivers (except Oracle) now support the driver string /TURBOSQL. If this is set to TRUE, the driver will not verify that all of the columns of the target table exist on the server at OPEN. This may increase performance with some applications, but has the disadvantage that the program may crash if an expected column is deleted from the table on the server.

When using the /TURBOSQL switch, error checking should still be implemented. For example, you will still get an error if you fail to connect to the server.

You can use this switch to simply define a buffer on the application side that will receive a prop:sql resultset without the need to define a view with valid column name and data type.

Example:

MyResult  FILE, DRIVER('MSSQL', '/TURBOSQL=TRUE')

Record     RECORD

Col1        STRING(20)

Col2        STRING(20)

Col3        LONG

          END

         END

CODE

OPEN(MyResult)

MyResult{prop:SQL} = |

'SELECT products.ProductID,products.ProductName,products.Qty from PRODUCTS'

The driver will match the resultset with the application buffer (MyResult) using the ordinal order for the matching field.

Using the above code, the driver will assume that the resultant columns are text fields. If you want to return binary data in the fields you will need to define your column like this:

Col1 STRING(20),NAME('col4 | BINARY')

NoteBox.jpg

The TURBOSQL switch disables data collection done by the driver the first time a table is opened. This is fine if the table is ONLY used for receiving the results of PROP:SQL calls. However, if ANY normal Clarion I/O is done (via either views or standard Clarion File I/O calls), this switch should not be used. If the switch is used in combination with standard Clarion I/O calls, then the driver will have insufficient information to return properly converted data (i.e., CAST specifications) resulting in scrambled (corrupted) data and possible GPFs.

turbosql.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1