contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
function   SQLSetArrayAsStream    
  Related Syntax     Other Library Functions  

Library: ODBC
Include: omodbc.xin
Declaration

  define external function SQLSetArrayAsStream
     (  read-only SQL_array_type Array,
        value counter ElementPos,
        value stream StreamValue )


Purpose

Sets the specified element in the data area of the SQL_array_type variable to the specified stream value. The contents of the stream may be any text or binary information.

Input arguments:

The following code demonstrates how to use SQLSetArrayAsStream to set the value of the SQL array type stream:

  local SQL_Array_type Array

  local SQL_Array_type ArrayCopy
  local stream ArrayStreamValue
  local counter ArrayStreamLen
  local counter i

  SQLSetArraySize( Array, 20, 5 )

  ;
  ; Check initial values.
  ;
  set i to 0
  repeat
          set ArrayStreamValue to SQLGetArrayAsStream( Array, i )
          set ArrayStreamLen to (length of ArrayStreamValue)
          output "Initial stream value[%d(i)] = %g(ArrayStreamValue) "
          output "(length = %d(ArrayStreamLen))%n"
          increment i
          exit when i=5
  again

  ;
  ; Set stream values.
  ;
  set i to 0
  repeat
          set ArrayStreamValue to "*" ||* (i+1) || "%0#- post null"
          SQLSetArrayAsStream( Array, i, ArrayStreamValue )
          increment i
          exit when i=5
  again

  ;
  ; Check current values.
  ;
  set i to 0
  repeat
          set ArrayStreamValue to SQLGetArrayAsStream( Array, i )
          set ArrayStreamLen to (length of ArrayStreamValue)
          output "Current stream value[%d(i)] = %g(ArrayStreamValue) "
          output "(length = %d(ArrayStreamLen))%n"
          increment i
          exit when i=5
  again

The following code demonstrates how to set the stream values of multiple elements in an SQL array type:

  local SQL_Array_type Array
  local stream ArrayStreamShelf variable
  local counter ArrayStreamLen
  local counter i

  SQLSetArraySize( Array, 20, 5 )
  ;
  ; Check initial values.
  ;
  SQLGetArrayAsStreamShelf( Array, ArrayStreamShelf, 5 )
  repeat over ArrayStreamShelf
          set ArrayStreamLen to (length of ArrayStreamShelf)
          output "Initial stream shelf value[%d(#ITEM)] = %g(ArrayStreamShelf) "
          output "(length = %d(ArrayStreamLen))%n"
  again

  ;
  ; Set stream values.
  ;
  set i to 0
  repeat
          set ArrayStreamShelf@(i+1) to "*" ||* (i+1) || "%0#- post null"
          increment i
          exit when i=5
  again
  SQLSetArrayAsStreamShelf( Array, ArrayStreamShelf, 5 )
  ;
  ; Check current values.
  ;
  SQLGetArrayAsStreamShelf( Array, ArrayStreamShelf, 5 )
  repeat over ArrayStreamShelf
          set ArrayStreamLen to (length of ArrayStreamShelf)
          output "Current stream shelf value[%d(#ITEM)] = %g(ArrayStreamShelf) "
          output "(length = %d(ArrayStreamLen))%n"
  again

    Related Syntax
   SQLGetArrayAsCounter
   SQLGetArrayAsCounterShelf
   SQLGetArrayAsStream
   SQLGetArrayAsStreamShelf
   SQLGetArrayAsString
   SQLSetArrayAsCounter
   SQLSetArrayAsCounterShelf
   SQLSetArrayAsStreamShelf
   SQLSetArrayAsString
 
  Other Library Functions
   SQL_FUNC_EXISTS
   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
   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 [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:01:19 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.