Home    |    Concepts   |   API   |   Samples
Concepts > Schema Objects
Streams and Queries
 
API Comparison

Streams transfer data between the ArcSDE client and server. Streams are similar to DBMS cursors for accessing a set of attributes and stepping through a selected set one row at a time.

A typical operation sequence is:

  • Create a stream
  • Initiate a statement or query on the stream
  • Execute the stream
  • Fetch a single record from the stream
  • Retrieve column values and feature geometry from the fetched record
  • Close a stream at the end of a series of fetches
  • Free the stream when finished using it

In addition to providing a cursor interface to the application developer, a stream implements buffered communications between the ArcSDE client and server. Each stream is an independent object with its own statement or query, resulting set of features or rows, and current position in the set. A stream handle, which provides access to the stream, is returned to the application upon successful creation of a stream. Because each stream is independent, applications can create as many streams as necessary to accomplish the task; however, additional streams increase the amount of memory used on both the client and server.

SE_CONNECTION Connection;
SE_STREAM Stream;
SE_ERROR Connect_error;
LONG rc;
CHAR *server, *instance, *database, *user, *passwd;

/* Connect to ArcSDE */
rc = SE_connection_create(server, instance, database, user, passwd, &Connect_error, &Connection);

/*See Error handling section for check_error function code. */
check_error (Connection, NULL, rc, "SE_connection_create");

/* Create a stream for the query */
rc = SE_stream_create (Connection, &Stream);

/* See Error handling section for check_error function code. */
checke_error (Connection, NULL, rc, "SE_stream_create");

/* Body of application */
/* Release the stream when it is no longer needed */
rc = SE_stream_free (Stream);

/* Disconnect from ArcSDE */
SE_connection_free (Connection);

CONTENT
feedback | privacy | legal