JagNewSharedData  JagResultsPassthrough

Chapter 5: C Routines Reference

JagNewSharedDataByIndex

Description

Create a shared variable with the specified index number or retrieve the existing variable with the specified index.

Syntax

JagStatus JagNewSharedData (
            JagDataCollection * pCollection,
            SQLINTEGER index,
            JagBoolean * pExists,
            JagSharedData ** ppProp)

Parameters

pCollection

The handle of the collection in which you want to create the shared variable.

index

An integer that uniquely identifies the shared variable within the collection. index can be any number within the range of the SQLINTEGER datatype.

ppProp

The shared variable handle.

pExists

The address of a JagBoolean status variable. *pExists is set to one of the following values:

Return value

To indicate

JAG_TRUE

If a shared variable with the specified index number already exists

JAG_FALSE

If a shared variable with the specified index number is created

Returns

Return value

To indicate

JAG_SUCCEED

Success

JAG_FAIL

Failure

Check the server’s log file for more information when JagNewSharedDataByIndex fails.

Usage

The JagNewSharedDataByIndex creates a shared variable with the specified index number or returns a reference to the existing shared variable with that index. Newly created variables are initialized to NULL and a reference to the new variable is returned.

Shared variables are either named or indexed. Indexed variables are created with JagNewSharedDataByIndex and retrieved with JagGetSharedDataByIndex. Named variables are created with JagNewSharedData and retrieved with JagGetSharedData.

Indexed shared variables are uniquely identified by the collection which contains them (see JagGetCollection) and the index assigned when the property is created with JagNewSharedDataByIndex.

See Appendix C, “Creating C Components,” in the EAServer Programmer’s Guide for more information.

See also

JagFreeSharedDataHandle, JagGetSharedData, JagGetSharedDataByIndex, JagGetSharedValue, JagNewSharedData, JagSetSharedValue





Copyright © 2005. Sybase Inc. All rights reserved. JagResultsPassthrough