Xref: alice comp.databases.oracle.server:73526 comp.lang.c++:144866
Path: alice!news-feed.fnsi.net!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail
From: Alex Vinokur <alexander.vinokur@telrad.co.il>
Newsgroups: comp.databases.oracle.server,comp.lang.c++,comp.programming
Subject: SQLDA and STL
Date: Thu, 11 Nov 1999 14:00:15 GMT
Organization: Deja.com - Before you buy.
Lines: 69
Message-ID: <80ei5d$pbl$1@nnrp1.deja.com>
X-Article-Creation-Date: Thu Nov 11 14:00:15 1999 GMT
X-Http-User-Agent: Mozilla/4.51 [en] (X11; I; SunOS 5.6 sun4m)
X-Http-Proxy: 1.0 x23.deja.com:80 (Squid/1.1.22) for client 212.25.72.130
X-MyDeja-Info: XMYDJUIDalexv7274



Here is the SQLDA (SQL Descriptor Area) structure
        used in dynamic SQL programs in databases.

struct SQLDA
{
    long    N;          /* Descriptor size in number of entries */
    char  **V;     /* Ptr to Arr of addresses of main variables */
    long   *L;              /* Ptr to Arr of lengths of buffers */
    short  *T;                /* Ptr to Arr of types of buffers */
    short **I;     /* Ptr to Arr of addresses of indicator vars */
    long    F;         /* Number of variables found by DESCRIBE */
    char  **S;          /* Ptr to Arr of variable name pointers */
    short  *M;       /* Ptr to Arr of max lengths of var. names */
    short  *C;    * Ptr to Arr of current lengths of var. names */
    char  **X;         /* Ptr to Arr of ind. var. name pointers */
    short  *Y;  /* Ptr to Arr of max lengths of ind. var. names */
    short  *Z;  /* Ptr to Arr of cur lengths of ind. var. names */
};

That is C language structure.
Using SQLDA, we have to
        - allocate storage space,
        - deallocate one,
        - check of bounds violation.


Is it planed to create new SQLDA structure (class)
        based on STL (Standard Template Library)?
Something like this :

class SQLDA_based_on_STL
{
   private :
        long                    N; // Descriptor size in number of
entries
        vector<string>          V; // Vector of main variables
        vector<long>            L; // Vector of lengths of
buffers
        vector<long>            T; // Vector of types of buffers
        vector<vector<short> >  I; // Matrix of addresses of indicator
vars
        long                    F; // Number of variables found by
DESCRIBE
        vector<string>          S; // Vector of variable names
        vector<short>           M; // Vector of max lengths of var.
names
        vector<short>           C; // Vector of current lengths of var.
names
        vector<string>          X; // Vector of ind. var. name
        vector<short>           Y; // Vector of max lengths of ind. var.
names
        vector<short>           Z; // Vector of cur lengths of ind. var.
names
   public :
        SQLDA_based_on_STL ();
        // Stuff
};

Advantages of STL are well-known.

Such a class will enable us to avoid taking care of storage management.

        Alex


Sent via Deja.com http://www.deja.com/
Before you buy.
