IJagServer interface  SharedProperty interface

Chapter 3: ActiveX IDispatch Interface Reference

IJagServerResults interface

Description

Type Library

JAGAXWrapLib

ProgID

Jaguar.JagServerResults

Provides methods to send rows to a EAServer client application.

Methods

See also

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide




IJagServerResults.BeginResults

Description

Begins the sequence of calls that sends a result set to the client.

Syntax

IJagServerResults.BeginResults(ByVal numColumns as Integer)

Parameters

numColumns

An integer that specifies the number of columns in the result set to be sent.

See also

EndResults

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide




IJagServerResults.BindCol

Description

Deprecated equivalent of BindColumn. The two methods are equivalent, except that the BindCol sourceBuf and indicator parameters are not explicitly declared as [in, out] in the type library.

Syntax

IJagServerResults.BindColumn(
        ByVal itemNumber As Integer,
        sourceBuf,
        ByVal maxBuflen As Integer,
        indicator As Integer)

Parameters

itemNumber

See BindColumn.

sourceBuf

See BindColumn.

maxBufLen

See BindColumn.

indicator

See BindColumn.

Usage

BindCol is a deprecated equivalent of BindColumn. The two methods are equivalent, except that the BindCol sourceBuf and indicator parameters are not explicitly declared as [in, out] in the type library. You must use BindColumn in Visual Basic applications and with most other tools that use the ActiveX IDispatch interface.

See also

BindColumn




IJagServerResults.BindColumn

Description

Binds a program variable to a column in a result set.

Syntax

IJagServerResults.BindColumn(
        ByVal itemNumber As Integer,
        sourceBuf,
        ByVal maxBuflen As Integer,
        indicator As Integer)

Parameters

itemNumber

An integer specifying the column number. The first column is 1.

sourceBuf

A variable to supply values for this column when row data is sent with the SendData method. The variable must be of a datatype that can be converted to the SQL datatype that was specified when DescribeCol was called for the column. “ActiveX to SQL datatype conversions” lists SQL datatypes and allowable bind types. You must use a different variable for each column, even if two columns have the same datatype.

maxBufLen

For character and binary data, the maximum length that values for this column can have.

indicator

An integer passed by reference. Before calling the SendData method to send each row, set the indicator variable to indicate whether the column’s current value is null. You must use a different indicator variable for each column. Indicator values are as follows:

Value

To indicate

0

Column value is not null and must be read from the sourceBuf Variant buffer.

-1

Column value is null.

Usage

BindCol associates a program variable with a column in a result set. When SendData is called to send a row, it reads the column value for the current row from the variable that is bound to the column.


ActiveX to SQL datatype conversions

The SQLDatatype value passed to DescribeCol determines the datatype with which column values are sent over the network. If the program variable type does not map directly to the column’s SQL datatype, SendData attempts to convert the value. The figure below shows the supported conversions between SQL datatypes and bind variable types. An X indicates a supported conversion.

See also

ColAttributes, DescribeCol, SendData

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide




IJagServer.ColAttributes

Description

Specifies additional metadata for a column to be sent in a result set.

Syntax

IJagServerResults.ColAttributes(
        ByVal itemNumnber as Integer,
        “COLUMN_MONEY”,
        ByVal trueFalse as Boolean
)

Parameters

itemNumber

An integer specifying the column number. The first column is 1.

trueFalse

A Boolean value. A value of True means that the column represents a cash value.

See also

DescribeCol

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide




IJagServerResults.DescribeCol

Description

Describes a result set column.

Syntax

IJagServerResults.DescribeCol(
        ByVal itemNumber as Integer,
        ByVal columnName as String,
        ByVal SQLDatatype as String,
        ByVal columnSize as Long,
        ByVal precision as Long,
        ByVal scale as Long,
        ByVal nullable as Boolean
)

Parameters

itemNumber

An integer specifying the column number. The first column is 1.

columnName

A string specifying the column’s name.

SQLDatatype

A string specifying the name of the column’s SQL datatype. This value determines the datatype of values sent to the client. Values are specified in a buffer that is bound to the column with BindColumn. The table below lists the SQL datatype strings. See BindColumn for details on how to bind column values.

Table 3-1: SQL datatypes for DescribeCol

SQL datatype string

Description

“SQL_BIT”

A boolean value (1 bit of data).

“SQL_TINYINT”

A one-byte integer.

“SQL_SMALLINT”

A two-byte integer.

“SQL_INTEGER”

A four-byte integer.

“SQL_REAL”

A four-byte IEEE floating point value.

“SQL_FLOAT”

An 8-byte IEEE floating point value.

“SQL_DOUBLE”

Same as “SQL_FLOAT”

“SQL_NUMERIC”

A fixed-point fractional number with precision and scale specified by parameters precision and scale.

“SQL_DECIMAL”

Same as “SQL_NUMERIC”.

“SQL_CHAR”

A string of a fixed length not greater than 255 characters. Values shorter than the length specified by columnSize are padded with spaces.

“SQL_VARCHAR”

A string of varying length, limited to 255 characters in length.

“SQL_LONGVARCHAR”

A string of varying length, with no length limit.

“SQL_DATE”

An ODBC date value.

“SQL_TIME”

An ODBC time value.

“SQL_TIMESTAMP”

An ODBC timestamp value.

“SQL_BINARY”

An array of bytes, whose values have a fixed length not greater than 255 characters.

“SQL_VARBINARY”

An array of bytes, whose values have varying length not greater than 255 characters.

“SQL_LONGVARBINARY”

An array of bytes, whose values have varying length with no length limit.

columnSize

For character or binary columns, a long integer that specifies the maximum length for column values.

precision

A long integer that specifies the precision of column values. For “SQL_NUMERIC” or “SQL_DECIMAL” columns, precision indicates the maximum number of decimal digits that a value may have. For other datatypes, precision is ignored.

scale

An integer that specifies the scale for column values. For “SQL_NUMERIC” or “SQL_DECIMAL” columns, scale indicates the number of decimal digits to the right of the decimal point. For other datatypes, scale is ignored.

nullable

A Boolean value that specifies whether the column can contain null values. True indicates that the column may have null values.

See also

BindColumn, ColAttributes

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide




IJagServer.EndResults

Description

Indicates that all rows in a result set have been sent.

Syntax

IJagServerResults.EndResults(ByVal rowCount as Long)

Parameters

rowCount

A positive long integer that specifies the number of rows that were sent to the client.

See also

BeginResults, SendData

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide




IJagServer.ResultsPassthru

Description

Deprecated equivalent of ResultSetsPassthrough. The methods are equivalent except that the ResultsPassthrough pInfo parameter is not explicitly declared [in, out] in the type library.

Syntax

IJagServerResults.ResultsPassthrough(
        ByVal conlibName as String,
        ByVal conlibPtr,
        ByVal pthruType as String,
        pInfo as Long
)

Parameters

conlibName

See ResultSetsPassthrough.

conlibPtr

See ResultSetsPassthrough.

pthruType

See ResultSetsPassthrough.

pInfo

See ResultSetsPassthrough.

Usage

ResultsPassthrough is a deprecated equivalent of ResultSetsPassthrough. The methods are equivalent except that the ResultsPassthrough pInfo parameter is not explicitly declared [in, out] in the type library.

You must use ResultSetsPassthrough in Visual Basic and other tools that use the IDispatch interface.

See also

ResultSetsPassthrough




IJagServer.ResultSetsPassthrough

Description

Forwards results from a remote database query to the client.

Syntax

IJagServerResults.ResultsPassthrough(
        ByVal conlibName as String,
        ByVal conlibPtr,
        ByVal pthruType as String,
        pInfo as Long
)

Parameters

conlibName

A string with one of the following values:

conlibPtr

The “handle” for the connectivity library control structure used to retrieve results. When using ODBC, pass a handle to an HSTMT control structure as conlibPtr. The HSTMT must be in a state that allows SQLFetch to be called without error.

When using Client-Library, set conlibPtr to a Client-Library CS_COMMAND control structure. The CS_COMMAND must be in a state that allows ct_results to be called without error.

pthruType

A string with one of the following values:

pInfo

Pass as NULL if using ODBC or whenever using the “ALL_RESULTS” option to forward all results with one call.

When forwarding individual Client-Library result sets, you must pass an integer variable by reference as pInfo. ResultSetsPassthrough sets the pInfo variable to specify whether all results have been retrieved from the CS_COMMAND structure, as follows:

pInfo value

To indicate

NoInfo (0)

More results remain to be processed.

NoMoreResults (1)

All results have been processed.

Usage

ResultSetsPassthrough forwards ODBC or Client-Library result sets to the client.

All results from a query can be forwarded with one call using the “ALL_RESULTS” option for the pthruType parameter. To forward single result sets, use the “CURRENT_RESULTS” option.

See also

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide




IJagServerResults.SendData

Description

Sends one row in a result set.

Syntax

IJagServerResults.SendData();

Usage

SendData sends a row of data to the client. Values for each are read from the variables that were bound to the column with the BindColumn method.

See also

BeginResults, DescribeCol, EndResults

Chapter 25, “Sending Result Sets,” in the EAServer Programmer’s Guide





Copyright © 2005. Sybase Inc. All rights reserved. SharedProperty interface