Structure declaration  Message functions

Chapter 1: Overview

symoff datatype

symoff is an ODL-specific datatype that is a ODL object handle. Many database interface object methods use an ODL object to store retrieved table data. For example, the columnInfo() method requires access to an object in which to store a list of tables.

To supply an object’s symoff to a function or method, such as columnInfo(), use the ODL bysymbol() function on the object, which involves three steps:

  1. Declare a variable of type symoff, for example:

    symoff mydest;
    
  2. Declare a variable for the type of object for which you need the symoff, for example:

    string targetstring;
    
  3. Use the bysymbol() function on the object variable to return its symoff to the symoff variable. Continuing with the same example:

    mydest=bysymbol(targetstring);
    

    Then, use the symoff value as an argument to the method. The code should look similar to this:

symoff outsym;
string tbl;
string col;
string out;
int rv;
outsym=bysymbol(out);
tbl=“authors”;
col=”city”;
rv=my_cldbi.columnInfo(outsym.tbl.col);

Alternatively, you can skip steps 1 and 3 above, and directly pass the function itself as the symoff argument to the method. In that case, the code should look similar to this:

string tbl;
string col;
string out;
int rv;
tbl=”authors”;
col=”city”;
rv=my_cldbi.columnInfo(bysymbol(out).tbl.col);




Copyright © 2005. Sybase Inc. All rights reserved. Message functions

View this book as PDF