SalSqlHandle
Namespace: PPJ.Runtime.Sql
Assembly: PPJ.Web.49 (4.9.0.0)
Summary description for SalSqlHandle.
- C#
- VB.NET
public struct SalSqlHandle : ValueType, ISerializable, IXmlSerializable
Public Structure SalSqlHandle
Implements ValueType, ISerializable, IXmlSerializable
Properties
BindVars
SalSqlBindVariables: Returns the collection of bind variables parsed from the last prepared statement.
Command
IDbCommand: Returns the inner prepared command object.
Connection
IDbConnection: Returns the inner connection object.
Database
String: Returns the SqlDatabase variable that had been used to connect.
DataReader
IDataReader: Returns the underlying IDataReader object. It's null if ResultSet is on, use DataSet instead.
DataSet
DataSet: Returns the underlying DataSet object. It's null if ResultSet is off, use DataReader instead.
Handle
IntPtr: Returns the handle for this SalSqlHandle object
IsNull
Boolean: Checks if this SalSqlHandle object contains a null db connection.
LastError
SalSqlError: Returns the last error occurred.
LastErrorCode
SalNumber: Returns the last error code.
LastErrorMessage
SalString: Returns the last error message.
LastErrorPosition
SalNumber: Returns the last error position.
LastStatement
String: Returns the last sql statement executed on this handle.
Password
String: Returns the SqlPassword variable that had been used to connect.
Properties
SqlProperties: Returns the properties associated with the connection.
ProviderDataReader
IDataReader: Returns the original DataReader object. It's null if ResultSet is on, use DataSet instead.
Transaction
IDbTransaction: Returns the current open transaction.
User
String: Returns the SqlUser variable that had been used to connect.
Methods
ClearContext()
Clears the sql context.
Returns: SalBoolean. bool
CloseAllSPResultSets()
Closes any result sets generated by the execution of a stored procedure.
Returns: SalBoolean. bOk
CloseResultSet()
Closes the result set.
Returns: SalBoolean.
Commit()
Commits all of the SQL transaction's cursors that are connected to the same database.
Returns: SalBoolean. bOk
Commit(errorHandler)
Commits all of the SQL transaction's cursors that are connected to the same database.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean. bOk
Connect()
Connects to a database. Uses Sql.Database, Sql.User and Sql.Password.
Returns: SalBoolean.
Connect(errorHandler)
Connects to a database. Uses Sql.Database, Sql.User and Sql.Password.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
Connect(database, user, password)
Connects to a database.
| Parameter | Type | Description |
|---|---|---|
| database | String | Database to connect to |
| user | String | User name |
| password | String | Password |
Returns: SalBoolean. bool
DirectoryByName(serverName)
Returns the database names on the specified server.
| Parameter | Type | Description |
|---|---|---|
| serverName | String | The name of the server. |
Returns: String[]. string[]
Disconnect()
Disconnects from a database.
Returns: SalBoolean. bool
Disconnect(errorHandler)
Disconnects from a database.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
Execute()
Executes a SQL statement that was prepared with SqlPrepare or retrieved with SqlRetrieve.
Returns: SalBoolean.
Execute(errorHandler)
Executes a SQL statement that was prepared with SqlPrepare or retrieved with SqlRetrieve.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
FetchNext(code)
| Parameter | Type | Description |
|---|---|---|
| code | SalNumber& |
Returns: SalBoolean.
FetchNext(code, errorHandler)
| Parameter | Type | Description |
|---|---|---|
| code | SalNumber& | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
FetchNext()
Fetches the next row in a result set.
Returns: SalNumber.
FetchNext(errorHandler)
Fetches the next row in a result set.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalNumber.
FetchPrevious(code)
| Parameter | Type | Description |
|---|---|---|
| code | SalNumber& |
Returns: SalBoolean.
FetchPrevious(code, errorHandler)
| Parameter | Type | Description |
|---|---|---|
| code | SalNumber& | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
FetchPrevious()
Fetches the previous row in a result set.
Returns: SalNumber.
FetchPrevious(errorHandler)
Fetches the previous row in a result set.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler | Error handler. |
Returns: SalNumber.
FetchRow(code)
| Parameter | Type | Description |
|---|---|---|
| code | SalNumber& |
Returns: SalBoolean.
FetchRow(row, code)
| Parameter | Type | Description |
|---|---|---|
| row | Int32 | |
| code | SalNumber& |
Returns: SalBoolean.
FetchRow(row, code, errorHandler)
| Parameter | Type | Description |
|---|---|---|
| row | Int32 | |
| code | SalNumber& | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
FetchRow(row)
Fetches a row according at the absolute row position.
| Parameter | Type | Description |
|---|---|---|
| row | Int32 | Position of the row to fetch. |
Returns: SalNumber. Sys.FETCH_Ok, Sys.FETCH_EOF.
FetchRow(row, errorHandler)
Fetches a row according at the absolute row position.
| Parameter | Type | Description |
|---|---|---|
| row | Int32 | Position of the row to fetch. |
| errorHandler | WhenSqlErrorHandler | Error handler. |
Returns: SalBoolean.
FromHandle(handle)
Returns the SalSqlHandle object from the handle
| Parameter | Type | Description |
|---|---|---|
| handle | IntPtr |
Returns: SalSqlHandle.
GetContext()
Returns the previously saved context for the sql handle.
Returns: Object.
GetError(nError, sError)
| Parameter | Type | Description |
|---|---|---|
| nError | SalNumber& | |
| sError | SalString& |
Returns: SalBoolean.
GetErrorPosition(nPos)
| Parameter | Type | Description |
|---|---|---|
| nPos | SalNumber& |
Returns: SalBoolean.
GetErrorPosition()
Returns the offset of the error position within the last SQL statement.
Returns: SalNumber.
GetIsolationLevel()
Returns the isolation level.
Returns: SalString.
GetLastStatement()
Returns the last SQL statement used on this connection.
Returns: String.
GetModifiedRows(nRows)
| Parameter | Type | Description |
|---|---|---|
| nRows | SalNumber& |
Returns: SalBoolean.
GetModifiedRows()
Returns the number of rows affected by the most recent INSERT, UPDATE, or DELETE statement.
Returns: SalNumber.
GetNextSPResultSet(intoList, end)
| Parameter | Type | Description |
|---|---|---|
| intoList | String | |
| end | SalBoolean& |
Returns: SalBoolean.
GetNextSPResultSet(intoList)
Returns the next result set returned by a stored procedure.
| Parameter | Type | Description |
|---|---|---|
| intoList | String |
Returns: SalBoolean.
GetObjectData(info, context)
Get object data
| Parameter | Type | Description |
|---|---|---|
| info | SerializationInfo | |
| context | StreamingContext |
GetParameter(parameter, nValue, sValue)
| Parameter | Type | Description |
|---|---|---|
| parameter | Int32 | |
| nValue | SalNumber& | |
| sValue | SalString& |
Returns: SalBoolean.
GetResultSetCount(count)
| Parameter | Type | Description |
|---|---|---|
| count | SalNumber& |
Returns: SalBoolean.
GetResultSetCount()
Returns the number of rows in the result set.
Returns: SalNumber.
GetResultSetCount(errorHandler)
Returns the number of rows in the result set.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalNumber.
GetResultSetCount(count, errorHandler)
| Parameter | Type | Description |
|---|---|---|
| count | SalNumber& | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
GetSessionHandle(hSession)
| Parameter | Type | Description |
|---|---|---|
| hSession | SalSqlSessionHandle& |
Returns: SalBoolean.
GetSessionHandle()
This call returns the session handle to which the specified statement handle belongs. The SqlHandle must have been created using SqlCreateStatement function and not by calling SqlConnect function.
Returns: SalSqlSessionHandle. SalSqlSessionHandle
GetStatementErrorInfo(errorNumber, errorDescription, sqlState)
| Parameter | Type | Description |
|---|---|---|
| errorNumber | SalNumber& | |
| errorDescription | SalString& | |
| sqlState | SalString& |
Returns: SalBoolean.
MoveNext()
Moves to the next row in the result set.
Returns: Boolean. True if the current row has been updated to the next row.
MovePrev()
Moves to the previous row in the result set.
Returns: Boolean. True if the current row has been updated to the previous row.
MoveTo(row)
Moves to the specified row in the result set.
| Parameter | Type | Description |
|---|---|---|
| row | Int32 | New current row. |
Returns: Boolean.
OraPLSQLCommand(command)
Executes an Oracle PL/SQL stored procedure. Supports dynamic arrays and receive array parameters.
| Parameter | Type | Description |
|---|---|---|
| command | SalString |
Returns: SalBoolean.
OraPLSQLCommand(command, errorHandler)
Executes an Oracle PL/SQL stored procedure. Supports dynamic arrays and receive array parameters.
| Parameter | Type | Description |
|---|---|---|
| command | SalString | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
OraPLSQLExecute()
Executes the anonymous PL/SQL block that was prepared using SqlOraPLSQLPrepare.
Returns: SalBoolean.
OraPLSQLExecute(errorHandler)
Executes the anonymous PL/SQL block that was prepared using SqlOraPLSQLPrepare.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
OraPLSQLPrepare(anonymousPLSQLBlock)
Compiles the anonymous PL/SQL block.
| Parameter | Type | Description |
|---|---|---|
| anonymousPLSQLBlock | SalString |
Returns: SalBoolean.
OraPLSQLPrepare(anonymousPLSQLBlock, errorHandler)
Compiles the anonymous PL/SQL block.
| Parameter | Type | Description |
|---|---|---|
| anonymousPLSQLBlock | SalString | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
ParseIntoVariables(intoList)
Parses the into variable list and updates the into bindings on the current command. The next call to FechtNext() will fetch into the new bind variables.
| Parameter | Type | Description |
|---|---|---|
| intoList | String | List of into variables: i.e. ":var1, :var2" |
Prepare(statement)
Compiles a SQL statement for execution.
| Parameter | Type | Description |
|---|---|---|
| statement | String |
Returns: SalBoolean.
Prepare(statement, errorHandler)
Compiles a SQL statement for execution.
| Parameter | Type | Description |
|---|---|---|
| statement | String | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
PrepareAndExecute(statement)
Compiles and executes a SQL statement.
| Parameter | Type | Description |
|---|---|---|
| statement | String |
Returns: SalBoolean.
PrepareAndExecute(statement, errorHandler)
Compiles and executes a SQL statement.
| Parameter | Type | Description |
|---|---|---|
| statement | String | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
PrepareSP(call, intoList)
Prepares a stored procedure invocation statement.
| Parameter | Type | Description |
|---|---|---|
| call | String | |
| intoList | String |
Returns: SalBoolean.
PrepareSP(call, intoList, nonQuery)
Prepares a stored procedure invocation statement.
| Parameter | Type | Description |
|---|---|---|
| call | String | |
| intoList | String | |
| nonQuery | Boolean |
Returns: SalBoolean.
PrepareSP(call, intoList, errorHandler)
Prepares a stored procedure invocation statement.
| Parameter | Type | Description |
|---|---|---|
| call | String | |
| intoList | String | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
PrepareSP(call, intoList, errorHandler, nonQuery)
Prepares a stored procedure invocation statement.
| Parameter | Type | Description |
|---|---|---|
| call | String | |
| intoList | String | |
| errorHandler | WhenSqlErrorHandler | |
| nonQuery | Boolean |
Returns: SalBoolean.
Read()
Returns an array with all the fields in the current row.
Returns: Object[].
Retrieve(name, bindList, intoList)
Retrieves a SQLBase compiled command. This method is supposed to be used only with SQLBase. However, the PPJ Framework adapts the calling syntax to other databases as well.
| Parameter | Type | Description |
|---|---|---|
| name | String | |
| bindList | String | |
| intoList | String |
Returns: SalBoolean.
Retrieve(name, bindList, intoList, nonQuery)
Retrieves a SQLBase compiled command. This method is supposed to be used only with SQLBase. However, the PPJ Framework adapts the calling syntax to other databases as well.
| Parameter | Type | Description |
|---|---|---|
| name | String | |
| bindList | String | |
| intoList | String | |
| nonQuery | Boolean |
Returns: SalBoolean.
Retrieve(name, bindList, intoList, errorHandler)
Retrieves a SQLBase compiled command.
| Parameter | Type | Description |
|---|---|---|
| name | String | |
| bindList | String | |
| intoList | String | |
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
Retrieve(name, bindList, intoList, errorHandler, nonQuery)
Retrieves a SQLBase compiled command.
| Parameter | Type | Description |
|---|---|---|
| name | String | |
| bindList | String | |
| intoList | String | |
| errorHandler | WhenSqlErrorHandler | |
| nonQuery | Boolean |
Returns: SalBoolean.
Rollback()
Executes a rollback on the current transaction.
Returns: SalBoolean.
Rollback(errorHandler)
Executes a rollback on the current transaction.
| Parameter | Type | Description |
|---|---|---|
| errorHandler | WhenSqlErrorHandler |
Returns: SalBoolean.
SetContext(context)
Sets the context to be used to resolve bind expressions.
| Parameter | Type | Description |
|---|---|---|
| context | Object |
Returns: SalBoolean. bool
SetContextToForm(context)
Sets the context to be used to resolve bind expressions.
| Parameter | Type | Description |
|---|---|---|
| context | Control |
Returns: SalBoolean. bool
SetContextToForm()
Sets the context to be used to resolve bind expressions.
Returns: SalBoolean. bool
SetIsolationLevel(isolation)
Sets the isolation level.
| Parameter | Type | Description |
|---|---|---|
| isolation | String | CS=Cursor Stability; RL=Release Locks; RO=Read Only; RR=Read Repeatability |
Returns: SalBoolean. bool
SetParameter(parameter, numberValue, stringValue)
Sets the value of a database parameter.
| Parameter | Type | Description |
|---|---|---|
| parameter | Int32 | |
| numberValue | Int32 | |
| stringValue | String |
Returns: SalBoolean.
SetResultSet(enable)
Enables result sets.
| Parameter | Type | Description |
|---|---|---|
| enable | Boolean |
Returns: SalBoolean.
SetResultSetMode(mode)
Defines the behavior for the ResultSet mode.
| Parameter | Type | Description |
|---|---|---|
| mode | ResultSetMode |
Returns: SalBoolean.
SetTimeout(timeout)
Specifies the maximum time to wait before generating an error.
| Parameter | Type | Description |
|---|---|---|
| timeout | Int32 |
Returns: SalBoolean.
VarSetup(context)
Saves the sql bind variables context.
| Parameter | Type | Description |
|---|---|---|
| context | Object |
Returns: SalBoolean.
Used By
| Name | Description |
|---|---|
| Sal.TblDoUpdates | Applies a SQL UPDATE statement to all table window rows with the Row Edited flag. |
| Sal.TblPopulate | Compiles, binds, and executes a SQL SELECT statement, then fetches the rows of the result set and populates a table window with them. |
| Sal.TblDeleteSelected | Applies a SQL DELETE statement to all table window rows with the ROW Selected flag. |
| Sal.TblDoDeletes | Applies a SQL DELETE statement to all table window rows that have flagsOn flags. |
| Sal.TblDoInserts | Applies a SQL INSERT statement to all the rows in a table window that have the ROW New flag. |
| Sal.WindowHandleToNumber | Converts a SalSqlHandle to a number. |
| Sal.ListPopulate | Populates a list box or combo box with a result set. SalListPopulate overrides any settings made with SalListSetTabs. If the SELECT statement returns data from multiple columns, each column's data displayed in a list box is separated by tabs. |
| SalWindowHandle.PopulateList | Populates a list box or combo box with a result set. SalListPopulate overrides any settings made with SalListSetTabs. If the SELECT statement returns data from multiple columns, each column's data displayed in a list box is separated by tabs. However, due to a Microsoft Windows limitation, each column's data displayed in a combo box is separated by a single '|' character. There is no space between one column's data, the separator character, and another column's data. |
| SalWindowHandle.DeleteSelected | Applies a SQL DELETE statement to all table window rows with the ROW Selected flag. |
| SalWindowHandle.DoDeletes | Applies a SQL DELETE statement to all table window rows that have nFlagsOn flags. |
| SalWindowHandle.DoInserts | Applies a SQL INSERT statement to all the rows in a table window that have the ROW New flag. |
| SalWindowHandle.DoUpdates | Applies a SQL UPDATE statement to all table window rows with the Row Edited flag. |
| SalWindowHandle.Populate | Compiles, binds, and executes a SQL SELECT statement, then fetches the rows of the result set and populates a table window with them. |
| SalComboBox.PopulateList | Populates a list box or combo box with a result set. SalListPopulate overrides any settings made with SalListSetTabs. If the SELECT statement returns data from multiple columns, each column's data displayed in a list box is separated by tabs. However, due to a Microsoft Windows limitation, each column's data displayed in a combo box is separated by a single '|' character. There is no space between one column's data, the separator character, and another column's data. |
| SalListBox.PopulateList | Populates a list box or combo box with a result set. SalListPopulate overrides any settings made with SalListSetTabs. If the SELECT statement returns data from multiple columns, each column's data displayed in a list box is separated by tabs. However, due to a Microsoft Windows limitation, each column's data displayed in a combo box is separated by a single '|' character. There is no space between one column's data, the separator character, and another column's data. |
| SalFormTableWindow.DeleteSelected | Applies a SQL DELETE statement to all table window rows with the ROW Selected flag. |
| SalFormTableWindow.DoDeletes | Applies a SQL DELETE statement to all table window rows that have nFlagsOn flags. |
| SalFormTableWindow.DoInserts | Applies a SQL INSERT statement to all the rows in a table window that have the ROW New flag. |
| SalFormTableWindow.DoUpdates | Applies a SQL UPDATE statement to all table window rows with the Row Edited flag. |
| SalFormTableWindow.Populate | Compiles, binds, and executes a SQL SELECT statement, then fetches the rows of the result set and populates a table window with them. |
| SalWindow.PopulateList | Populates a list box or combo box with a result set. |
| SalTableColumn.PopulateList | Populates a list box or combo box with a result set. SalListPopulate overrides any settings made with SalListSetTabs. If the SELECT statement returns data from multiple columns, each column's data displayed in a list box is separated by tabs. However, due to a Microsoft Windows limitation, each column's data displayed in a combo box is separated by a single '|' character. There is no space between one column's data, the separator character, and another column's data. |
| SalTableWindow.DeleteSelected | Applies a SQL DELETE statement to all table window rows with the ROW Selected flag. |
| SalTableWindow.DoDeletes | Applies a SQL DELETE statement to all table window rows that have nFlagsOn flags. |
| SalTableWindow.DoInserts | Applies a SQL INSERT statement to all the rows in a table window that have the ROW_New flag. |
| SalTableWindow.DoUpdates | Applies a SQL UPDATE statement to all table window rows with the Row_Edited flag. |
| SalTableWindow.Populate | Populates the table window with the result of the select. |
| SqlOra.PLSQLPrepare | This function compiles the anonymous PL/SQL block. This function looks very much like the regular SqlPrepare function, but the underlying code is meant specifically for handling Oracle PL/SQL blocks. |
| SqlOra.PLSQLExecute | This function executes the anonymous PL/SQL block that was prepared using SqlOraPLSQLPrepare. If the execution succeeds, then all output parameters from the PL/SQL block are updated by the time the control returns to the user. |
| SqlOra.PLSQLCommand | Executes an Oracle PL/SQL stored procedure. The first parameter identifies the SQL handle to the database. The second parameter is a command string used to invoke a PL/SQL stored procedure. For some strange reason, PLSQLCommand bind vars don't use the colon delimiter, so we need to parse the bind vars, add the delimiter and reassemble the string. |
| SalSqlHandle.FromHandle | Returns the SalSqlHandle object from the handle |
| Sql.SetIsolationLevel | Sets the isolation level. |
| Sql.SetParameter | Sets the value of a database parameter. |
| Sql.SetResultSet | Turns result set mode on or off for all handles associated with the same connection. |
| Sql.VarSetup | Saves the sql bind variables context. |
| Sql.GetStatementErrorInfo | |
| Sql.SetLockTimeout | Specifies the maximum time to wait before generating an error. |
| Sql.GetSessionHandle | |
| Sql.OraPLSQLExecute | Executes the anonymous PL/SQL block that was prepared using SqlOraPLSQLPrepare. |
| Sql.OraPLSQLPrepare | Compiles the anonymous PL/SQL block. |
| Sql.OraPLSQLCommand | Executes an Oracle PL/SQL stored procedure. Supports dynamic arrays and receive array parameters. |
| Sql.ConnectUsingCursor | Not supported. |
| Sql.DisconnectWithoutCursor | Not supported. |
| Sql.ExecutionPlan | Not supported. |
| Sql.GetCursor | Not supported. |
| Sql.GetSqlHandle | Not supported. |
| VisOutlineListBox.PopulateList |