swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax     Other Library Functions  
function   SQLSetArrayAsString   OMDN

Library: omodbc - low-level ODBC support
Include: omodbc.xin

Declaration

  define external function SQLSetArrayAsString
     (  read-only SQL_array_type Array,
        value integer ElementPos,
        value stream StreamValue )


Purpose

Sets an element in the data area of the SQL_array_type variable to the specified stream value. The input stream must contain only text data, with no embedded nulls. The stream length is identified by the end of the stream or the first detected null byte.

Input arguments:

The following code demonstrates how to use SQLSetArrayAsString to set the element string value.

  local SQL_Array_type Array

  local SQL_Array_type ArrayCopy
  local stream ArrayStringValue
  local integer ArrayStringLen
  local integer i

  SQLSetArraySize( Array, 20, 5 )

In the following code, SQLGetArrayAsString to check initial values.

  set i to 0
  repeat
          set ArrayStringValue to SQLGetArrayAsString( Array, i )
          set ArrayStringLen to (length of ArrayStringValue)
          output "Initial string value[%d(i)] = %g(ArrayStringValue) "
          output "(length = %d(ArrayStringLen))%n"
          increment i
          exit when i=5
  again

Next, SQLSetArrayAsString sets the stream values.

  set i to 0
  repeat
          set ArrayStringValue to "*" ||* (i+1) || "%0#- post null"
          SQLSetArrayAsString( Array, i, ArrayStringValue )
          increment i
          exit when i=5
  again

Finally, SQLGetArrayAsString is used to check the current values of the stream.

  set i to 0
  repeat
          set ArrayStringValue to SQLGetArrayAsString( Array, i )
          set ArrayStringLen to (length of ArrayStringValue)
          output "Current string value[%d(i)] = %g(ArrayStringValue) "
          output "(length = %d(ArrayStringLen))%n"
          increment i
          exit when i=5
  again

    Related Syntax
   SQLGetArrayAsCounter
   SQLGetArrayAsCounterShelf
   SQLGetArrayAsStream
   SQLGetArrayAsStreamShelf
   SQLGetArrayAsString
   SQLSetArrayAsCounter
   SQLSetArrayAsCounterShelf
   SQLSetArrayAsStream
   SQLSetArrayAsStreamShelf
 
  Other Library Functions
   SQL_FUNC_EXISTS
   SQL_IsVersionCompatible
   SQL_LibraryVersion
   SQLAllocConnect
   SQLAllocEnv
   SQLAllocHandle
   SQLAllocStmt
   SQLBindCol
   SQLBindParameter
   SQLBrowseConnect
   SQLBulkOperations
   SQLCancel
   SQLCloseCursor
   SQLColAttribute
   SQLColAttributes
   SQLColumnPrivileges
   SQLColumns
   SQLConnect
   SQLCopyDesc
   SQLDataSources
   SQLDescribeCol
   SQLDescribeParam
   SQLDisconnect
   SQLDriverConnect
   SQLDrivers
   SQLEndTran
   SQLError
   SQLExecDirect
   SQLExecute
   SQLExtendedFetch
   SQLFetch
   SQLFetchScroll
   SQLForeignKeys
   SQLFreeConnect
   SQLFreeEnv
   SQLFreeHandle
   SQLFreeStmt
   SQLGetArrayAsCounter
   SQLGetArrayAsCounterShelf
   SQLGetArrayAsStream
   SQLGetArrayAsStreamShelf
   SQLGetArrayAsString
   SQLGetArrayElementCount
   SQLGetArrayElementLen
   SQLGetConnectAttr
   SQLGetConnectOption
   SQLGetCursorName
   SQLGetData
   SQLGetDescField
   SQLGetDescRec
   SQLGetDiagField
   SQLGetDiagRec
   SQLGetEnvAttr
   SQLGetFunctions
   SQLGetInfo
   SQLGetStmtAttr
   SQLGetStmtOption
   SQLGetTypeInfo
   SQLGetVectorAsCounter
   SQLGetVectorAsStream
   SQLGetVectorAsString
   SQLGetVectorSize
   SQLMoreResults
   SQLNativeSQL
   SQLNumParams
   SQLNumResultCols
   SQLParamData
   SQLParamOptions
   SQLPrepare
   SQLPrimaryKeys
   SQLProcedureColumns
   SQLProcedures
   SQLPutData
   SQLRowCount
   SQLSetArrayAsCounter
   SQLSetArrayAsCounterShelf
   SQLSetArrayAsStream
   SQLSetArrayAsStreamShelf
   SQLSetArrayAsString
   SQLSetArraySize
   SQLSetConnectAttr
   SQLSetConnectOption
   SQLSetCursorName
   SQLSetDescField
   SQLSetDescRec
   SQLSetEnvAttr
   SQLSetPos
   SQLSetScrollOptions
   SQLSetStmtAttr
   SQLSetStmtOption
   SQLSetVectorAsCounter
   SQLSetVectorAsStream
   SQLSetVectorAsString
   SQLSetVectorSize
   SQLSpecialColumns
   SQLStatistics
   SQLTablePrivileges
   SQLTables
   SQLTransact
 
----  

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:07:59 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.