Click or drag to resize

SQLStatement Class

X#
Manage a SQL statement.
Inheritance Hierarchy
Object
  SQLStatement

Namespace:  VO
Assembly:  VOSQLClasses (in VOSQLClasses.dll) Version: 2.19
Syntax
 CLASS SQLStatement
Request Example View Source

The SQLStatement type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleSQLStatement
Construct a SQLStatement object.
Top
Properties
  NameDescription
Public propertyConnection
The data source — a SQLConnection object — that this statement is connected to.
Public propertyCursorType
Public propertyErrInfo
An SQL statement error information (SQLErrorInfo) object. Use the error flag of the returned object to determine if an error occurred.
Public propertyHyperLabel
A hyperlabel containing a description of the statement.
Public propertyKeySet
Public propertyNativeSQL
A string containing the native text of the statement. Level 2
Public propertyNumParameters
A numeric value containing the number of parameters in the statement. A return value of -1 indicates an error. Level 2
Public propertyNumSuccessfulRows
A numeric value containing the number of rows that were affected by the insert, update, or delete statement. A return value of -1 indicates an error.
Public propertyParams
Public propertyPrepFlag
A logical value that indicates if the statement has been prepared.
Public propertyRecCount
Public propertyRowSet
Public propertyScrollConcurrency
Public propertySimulateCursor
Public propertySQLString
A string containing the text of the statement.
Public propertyStatementHandle
A long integer representing the statement handle.
Public propertyStatus
A hyperlabel describing the error, or NULL_OBJECT if no error has occurred.
Top
Methods
  NameDescription
Public methodCommit
Save the changes made since the last Commit().
Public methodDestroy
Public methodCode exampleExecute
Execute the statement.
Public methodFreeStmt
Free the statement, according to the specified option.
Public methodGetStatementOption
Return current setting for a statement option or NIL, if an error occurred.
Public methodMakeErrorInfo
Public methodPrepare
Prepare a statement.
Public methodRollBack
Undo the changes made since the last Commit().
Public methodSetStatementOption
Set current setting for a statement option.
Top
Examples
The following example demonstrates the use of the SQLStatement class:
X#
 1FUNCTION CreateTable()
 2LOCAL oStmt AS SQLStatement
 3LOCAL oConn AS SQLConnection
 4oConn := SQLConnection{"sample","dba","sql"}
 5oStmt := SQLStatement{"Create table test ;
 6(Col1 INT,Col2 Char(10))", oConn}
 7IF !oStmt:Execute()
 8oStmt:ErrInfo:ShowErrorMsg()
 9ENDIF
10oStmt:FreeStmt(SQL_DROP)
11oConn:Disconnect()
See Also

Reference