Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Programming » Embedded SQL » How to send and retrieve long values using embedded SQL

 

Sending LONG data using dynamic SQL

Send LONG values to the database using dynamic SQL from an embedded SQL application.

Prérequis

There are no prerequisites for this task.

 Task
  1. Set the sqltype field to DT_LONGVARCHAR, DT_LONGNVARCHAR, or DT_LONGBINARY, as appropriate.

  2. If you are sending NULL, set * sqlind to a negative value.

  3. If you are not sending NULL, set the sqldata field to point to the LONGVARCHAR, LONGNVARCHAR, or LONGBINARY host variable structure.

    You can use the LONGVARCHARSIZE(n), LONGNVARCHARSIZE(n), or LONGBINARYSIZE(n) macros to determine the total number of bytes to allocate to hold n bytes of data in the array field.

  4. Set the array_len field of the host variable structure to the number of bytes allocated for the array field.

  5. Set the stored_len field of the host variable structure to the number of bytes of data in the array field. This must not be more than array_len.

  6. Send the data by opening the cursor or executing the statement.

Résultat

The embedded SQL application is ready to send LONG values to the database.

 See also