Skip to main content
Version: 2023

SalSqlHandle

Namespace: PPJ.Runtime.Sql

Assembly: PPJ.Web.49 (4.9.0.0)

Summary description for SalSqlHandle.

public struct SalSqlHandle : ValueType, ISerializable, IXmlSerializable

Properties

Instance memberBindVars

SalSqlBindVariables: Returns the collection of bind variables parsed from the last prepared statement.

Instance memberCommand

IDbCommand: Returns the inner prepared command object.

Instance memberConnection

IDbConnection: Returns the inner connection object.

Instance memberDatabase

String: Returns the SqlDatabase variable that had been used to connect.

Instance memberDataReader

IDataReader: Returns the underlying IDataReader object. It's null if ResultSet is on, use DataSet instead.

Instance memberDataSet

DataSet: Returns the underlying DataSet object. It's null if ResultSet is off, use DataReader instead.

Instance memberHandle

IntPtr: Returns the handle for this SalSqlHandle object

Instance memberIsNull

Boolean: Checks if this SalSqlHandle object contains a null db connection.

Instance memberLastError

SalSqlError: Returns the last error occurred.

Instance memberLastErrorCode

SalNumber: Returns the last error code.

Instance memberLastErrorMessage

SalString: Returns the last error message.

Instance memberLastErrorPosition

SalNumber: Returns the last error position.

Instance memberLastStatement

String: Returns the last sql statement executed on this handle.

Instance memberPassword

String: Returns the SqlPassword variable that had been used to connect.

Instance memberProperties

SqlProperties: Returns the properties associated with the connection.

Instance memberProviderDataReader

IDataReader: Returns the original DataReader object. It's null if ResultSet is on, use DataSet instead.

Instance memberTransaction

IDbTransaction: Returns the current open transaction.

Instance memberUser

String: Returns the SqlUser variable that had been used to connect.

Methods

Instance memberClearContext()

Clears the sql context.

Returns: SalBoolean. bool

Instance memberCloseAllSPResultSets()

Closes any result sets generated by the execution of a stored procedure.

Returns: SalBoolean. bOk

Instance memberCloseResultSet()

Closes the result set.

Returns: SalBoolean.

Instance memberCommit()

Commits all of the SQL transaction's cursors that are connected to the same database.

Returns: SalBoolean. bOk

Instance memberCommit(errorHandler)

Commits all of the SQL transaction's cursors that are connected to the same database.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean. bOk

Instance memberConnect()

Connects to a database. Uses Sql.Database, Sql.User and Sql.Password.

Returns: SalBoolean.

Instance memberConnect(errorHandler)

Connects to a database. Uses Sql.Database, Sql.User and Sql.Password.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberConnect(database, user, password)

Connects to a database.

ParameterTypeDescription
databaseStringDatabase to connect to
userStringUser name
passwordStringPassword

Returns: SalBoolean. bool

Static memberDirectoryByName(serverName)

Returns the database names on the specified server.

ParameterTypeDescription
serverNameStringThe name of the server.

Returns: String[]. string[]

Instance memberDisconnect()

Disconnects from a database.

Returns: SalBoolean. bool

Instance memberDisconnect(errorHandler)

Disconnects from a database.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberExecute()

Executes a SQL statement that was prepared with SqlPrepare or retrieved with SqlRetrieve.

Returns: SalBoolean.

Instance memberExecute(errorHandler)

Executes a SQL statement that was prepared with SqlPrepare or retrieved with SqlRetrieve.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberFetchNext(code)

ParameterTypeDescription
codeSalNumber&

Returns: SalBoolean.

Instance memberFetchNext(code, errorHandler)

ParameterTypeDescription
codeSalNumber&
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberFetchNext()

Fetches the next row in a result set.

Returns: SalNumber.

Instance memberFetchNext(errorHandler)

Fetches the next row in a result set.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalNumber.

Instance memberFetchPrevious(code)

ParameterTypeDescription
codeSalNumber&

Returns: SalBoolean.

Instance memberFetchPrevious(code, errorHandler)

ParameterTypeDescription
codeSalNumber&
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberFetchPrevious()

Fetches the previous row in a result set.

Returns: SalNumber.

Instance memberFetchPrevious(errorHandler)

Fetches the previous row in a result set.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandlerError handler.

Returns: SalNumber.

Instance memberFetchRow(code)

ParameterTypeDescription
codeSalNumber&

Returns: SalBoolean.

Instance memberFetchRow(row, code)

ParameterTypeDescription
rowInt32
codeSalNumber&

Returns: SalBoolean.

Instance memberFetchRow(row, code, errorHandler)

ParameterTypeDescription
rowInt32
codeSalNumber&
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberFetchRow(row)

Fetches a row according at the absolute row position.

ParameterTypeDescription
rowInt32Position of the row to fetch.

Returns: SalNumber. Sys.FETCH_Ok, Sys.FETCH_EOF.

Instance memberFetchRow(row, errorHandler)

Fetches a row according at the absolute row position.

ParameterTypeDescription
rowInt32Position of the row to fetch.
errorHandlerWhenSqlErrorHandlerError handler.

Returns: SalBoolean.

Static memberFromHandle(handle)

Returns the SalSqlHandle object from the handle

ParameterTypeDescription
handleIntPtr

Returns: SalSqlHandle.

Instance memberGetContext()

Returns the previously saved context for the sql handle.

Returns: Object.

Instance memberGetError(nError, sError)

ParameterTypeDescription
nErrorSalNumber&
sErrorSalString&

Returns: SalBoolean.

Instance memberGetErrorPosition(nPos)

ParameterTypeDescription
nPosSalNumber&

Returns: SalBoolean.

Instance memberGetErrorPosition()

Returns the offset of the error position within the last SQL statement.

Returns: SalNumber.

Instance memberGetIsolationLevel()

Returns the isolation level.

Returns: SalString.

Static memberGetLastStatement()

Returns the last SQL statement used on this connection.

Returns: String.

Instance memberGetModifiedRows(nRows)

ParameterTypeDescription
nRowsSalNumber&

Returns: SalBoolean.

Instance memberGetModifiedRows()

Returns the number of rows affected by the most recent INSERT, UPDATE, or DELETE statement.

Returns: SalNumber.

Instance memberGetNextSPResultSet(intoList, end)

ParameterTypeDescription
intoListString
endSalBoolean&

Returns: SalBoolean.

Instance memberGetNextSPResultSet(intoList)

Returns the next result set returned by a stored procedure.

ParameterTypeDescription
intoListString

Returns: SalBoolean.

Instance memberGetObjectData(info, context)

Get object data

ParameterTypeDescription
infoSerializationInfo
contextStreamingContext

Instance memberGetParameter(parameter, nValue, sValue)

ParameterTypeDescription
parameterInt32
nValueSalNumber&
sValueSalString&

Returns: SalBoolean.

Instance memberGetResultSetCount(count)

ParameterTypeDescription
countSalNumber&

Returns: SalBoolean.

Instance memberGetResultSetCount()

Returns the number of rows in the result set.

Returns: SalNumber.

Instance memberGetResultSetCount(errorHandler)

Returns the number of rows in the result set.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalNumber.

Instance memberGetResultSetCount(count, errorHandler)

ParameterTypeDescription
countSalNumber&
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberGetSessionHandle(hSession)

ParameterTypeDescription
hSessionSalSqlSessionHandle&

Returns: SalBoolean.

Instance memberGetSessionHandle()

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

Instance memberGetStatementErrorInfo(errorNumber, errorDescription, sqlState)

ParameterTypeDescription
errorNumberSalNumber&
errorDescriptionSalString&
sqlStateSalString&

Returns: SalBoolean.

Instance memberMoveNext()

Moves to the next row in the result set.

Returns: Boolean. True if the current row has been updated to the next row.

Instance memberMovePrev()

Moves to the previous row in the result set.

Returns: Boolean. True if the current row has been updated to the previous row.

Instance memberMoveTo(row)

Moves to the specified row in the result set.

ParameterTypeDescription
rowInt32New current row.

Returns: Boolean.

Instance memberOraPLSQLCommand(command)

Executes an Oracle PL/SQL stored procedure. Supports dynamic arrays and receive array parameters.

ParameterTypeDescription
commandSalString

Returns: SalBoolean.

Instance memberOraPLSQLCommand(command, errorHandler)

Executes an Oracle PL/SQL stored procedure. Supports dynamic arrays and receive array parameters.

ParameterTypeDescription
commandSalString
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberOraPLSQLExecute()

Executes the anonymous PL/SQL block that was prepared using SqlOraPLSQLPrepare.

Returns: SalBoolean.

Instance memberOraPLSQLExecute(errorHandler)

Executes the anonymous PL/SQL block that was prepared using SqlOraPLSQLPrepare.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberOraPLSQLPrepare(anonymousPLSQLBlock)

Compiles the anonymous PL/SQL block.

ParameterTypeDescription
anonymousPLSQLBlockSalString

Returns: SalBoolean.

Instance memberOraPLSQLPrepare(anonymousPLSQLBlock, errorHandler)

Compiles the anonymous PL/SQL block.

ParameterTypeDescription
anonymousPLSQLBlockSalString
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberParseIntoVariables(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.

ParameterTypeDescription
intoListStringList of into variables: i.e. ":var1, :var2"

Instance memberPrepare(statement)

Compiles a SQL statement for execution.

ParameterTypeDescription
statementString

Returns: SalBoolean.

Instance memberPrepare(statement, errorHandler)

Compiles a SQL statement for execution.

ParameterTypeDescription
statementString
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberPrepareAndExecute(statement)

Compiles and executes a SQL statement.

ParameterTypeDescription
statementString

Returns: SalBoolean.

Instance memberPrepareAndExecute(statement, errorHandler)

Compiles and executes a SQL statement.

ParameterTypeDescription
statementString
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberPrepareSP(call, intoList)

Prepares a stored procedure invocation statement.

ParameterTypeDescription
callString
intoListString

Returns: SalBoolean.

Instance memberPrepareSP(call, intoList, nonQuery)

Prepares a stored procedure invocation statement.

ParameterTypeDescription
callString
intoListString
nonQueryBoolean

Returns: SalBoolean.

Instance memberPrepareSP(call, intoList, errorHandler)

Prepares a stored procedure invocation statement.

ParameterTypeDescription
callString
intoListString
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberPrepareSP(call, intoList, errorHandler, nonQuery)

Prepares a stored procedure invocation statement.

ParameterTypeDescription
callString
intoListString
errorHandlerWhenSqlErrorHandler
nonQueryBoolean

Returns: SalBoolean.

Instance memberRead()

Returns an array with all the fields in the current row.

Returns: Object[].

Instance memberRetrieve(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.

ParameterTypeDescription
nameString
bindListString
intoListString

Returns: SalBoolean.

Instance memberRetrieve(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.

ParameterTypeDescription
nameString
bindListString
intoListString
nonQueryBoolean

Returns: SalBoolean.

Instance memberRetrieve(name, bindList, intoList, errorHandler)

Retrieves a SQLBase compiled command.

ParameterTypeDescription
nameString
bindListString
intoListString
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberRetrieve(name, bindList, intoList, errorHandler, nonQuery)

Retrieves a SQLBase compiled command.

ParameterTypeDescription
nameString
bindListString
intoListString
errorHandlerWhenSqlErrorHandler
nonQueryBoolean

Returns: SalBoolean.

Instance memberRollback()

Executes a rollback on the current transaction.

Returns: SalBoolean.

Instance memberRollback(errorHandler)

Executes a rollback on the current transaction.

ParameterTypeDescription
errorHandlerWhenSqlErrorHandler

Returns: SalBoolean.

Instance memberSetContext(context)

Sets the context to be used to resolve bind expressions.

ParameterTypeDescription
contextObject

Returns: SalBoolean. bool

Instance memberSetContextToForm(context)

Sets the context to be used to resolve bind expressions.

ParameterTypeDescription
contextControl

Returns: SalBoolean. bool

Instance memberSetContextToForm()

Sets the context to be used to resolve bind expressions.

Returns: SalBoolean. bool

Instance memberSetIsolationLevel(isolation)

Sets the isolation level.

ParameterTypeDescription
isolationStringCS=Cursor Stability; RL=Release Locks; RO=Read Only; RR=Read Repeatability

Returns: SalBoolean. bool

Instance memberSetParameter(parameter, numberValue, stringValue)

Sets the value of a database parameter.

ParameterTypeDescription
parameterInt32
numberValueInt32
stringValueString

Returns: SalBoolean.

Instance memberSetResultSet(enable)

Enables result sets.

ParameterTypeDescription
enableBoolean

Returns: SalBoolean.

Instance memberSetResultSetMode(mode)

Defines the behavior for the ResultSet mode.

ParameterTypeDescription
modeResultSetMode

Returns: SalBoolean.

Instance memberSetTimeout(timeout)

Specifies the maximum time to wait before generating an error.

ParameterTypeDescription
timeoutInt32

Returns: SalBoolean.

Instance memberVarSetup(context)

Saves the sql bind variables context.

ParameterTypeDescription
contextObject

Returns: SalBoolean.

Used By

NameDescription
Sal.TblDoUpdatesApplies a SQL UPDATE statement to all table window rows with the Row Edited flag.
Sal.TblPopulateCompiles, binds, and executes a SQL SELECT statement, then fetches the rows of the result set and populates a table window with them.
Sal.TblDeleteSelectedApplies a SQL DELETE statement to all table window rows with the ROW Selected flag.
Sal.TblDoDeletesApplies a SQL DELETE statement to all table window rows that have flagsOn flags.
Sal.TblDoInsertsApplies a SQL INSERT statement to all the rows in a table window that have the ROW New flag.
Sal.WindowHandleToNumberConverts a SalSqlHandle to a number.
Sal.ListPopulatePopulates 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.PopulateListPopulates 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.DeleteSelectedApplies a SQL DELETE statement to all table window rows with the ROW Selected flag.
SalWindowHandle.DoDeletesApplies a SQL DELETE statement to all table window rows that have nFlagsOn flags.
SalWindowHandle.DoInsertsApplies a SQL INSERT statement to all the rows in a table window that have the ROW New flag.
SalWindowHandle.DoUpdatesApplies a SQL UPDATE statement to all table window rows with the Row Edited flag.
SalWindowHandle.PopulateCompiles, binds, and executes a SQL SELECT statement, then fetches the rows of the result set and populates a table window with them.
SalComboBox.PopulateListPopulates 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.PopulateListPopulates 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.DeleteSelectedApplies a SQL DELETE statement to all table window rows with the ROW Selected flag.
SalFormTableWindow.DoDeletesApplies a SQL DELETE statement to all table window rows that have nFlagsOn flags.
SalFormTableWindow.DoInsertsApplies a SQL INSERT statement to all the rows in a table window that have the ROW New flag.
SalFormTableWindow.DoUpdatesApplies a SQL UPDATE statement to all table window rows with the Row Edited flag.
SalFormTableWindow.PopulateCompiles, binds, and executes a SQL SELECT statement, then fetches the rows of the result set and populates a table window with them.
SalWindow.PopulateListPopulates a list box or combo box with a result set.
SalTableColumn.PopulateListPopulates 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.DeleteSelectedApplies a SQL DELETE statement to all table window rows with the ROW Selected flag.
SalTableWindow.DoDeletesApplies a SQL DELETE statement to all table window rows that have nFlagsOn flags.
SalTableWindow.DoInsertsApplies a SQL INSERT statement to all the rows in a table window that have the ROW_New flag.
SalTableWindow.DoUpdatesApplies a SQL UPDATE statement to all table window rows with the Row_Edited flag.
SalTableWindow.PopulatePopulates the table window with the result of the select.
SqlOra.PLSQLPrepareThis 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.PLSQLExecuteThis 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.PLSQLCommandExecutes 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.FromHandleReturns the SalSqlHandle object from the handle
Sql.SetIsolationLevelSets the isolation level.
Sql.SetParameterSets the value of a database parameter.
Sql.SetResultSetTurns result set mode on or off for all handles associated with the same connection.
Sql.VarSetupSaves the sql bind variables context.
Sql.GetStatementErrorInfo
Sql.SetLockTimeoutSpecifies the maximum time to wait before generating an error.
Sql.GetSessionHandle
Sql.OraPLSQLExecuteExecutes the anonymous PL/SQL block that was prepared using SqlOraPLSQLPrepare.
Sql.OraPLSQLPrepareCompiles the anonymous PL/SQL block.
Sql.OraPLSQLCommandExecutes an Oracle PL/SQL stored procedure. Supports dynamic arrays and receive array parameters.
Sql.ConnectUsingCursorNot supported.
Sql.DisconnectWithoutCursorNot supported.
Sql.ExecutionPlanNot supported.
Sql.GetCursorNot supported.
Sql.GetSqlHandleNot supported.
VisOutlineListBox.PopulateList