Consultor Eletrônico



Kbase 13780: HLI/C - Limit to the number of columns allowed in SELECT.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
HLI/C - Limit to the number of columns allowed in SELECT.


If you are using dynamic SQL then, in principle there's no limit to th
e number of columns allowed in the SELECT. In practice, it seems to b
e around 200 columns. If you are using static SQL and the SQL
preprocessor, there is a limit.

Here is what happens when the preprocessor generates code.
Suppose we have the following Embedded SQL in the C file:

EXEC SQL FETCH GetCursor INTO
:EventId INDICATOR :indEventId;

the preprocessor generates the following code fragment:

/* EXEC SQL FETCH GetCursor INTO
:EventId INDICATOR :indEventId;
{
static char sqltxt[] = {
'F','E','T','C','H',' ','G','e','t','C','u','r','s','o','r',' ','I','N',
'T','O',' ','e','s','q','l','o','0',' ','I','N','D','I','C','A','T','O',
'R',' ','e','s','q','l','o','1','.',0};
static char sqlfmt[] = {'3','3','s','-','4','i',0};
sqlv[0] = (char *) EventId;
sqlv[1] = (char *) &indEventId; <---+
sqlcdbind(&SQLCODE); |
sqlfetch(sql0,(int) 0x08,sqltxt,sqlfmt); |
if (SQLCODE == 100) goto label2; /
if (SQLCODE < 0) goto label2; /
} /
/
/
/
/
The important point is the sqlv array here . This array is
dimensioned STATICALLY - that is, we set the initial limit on the
number of elements in this array. By default it's set to 75. So,
what's probably happening is that they've overwritten memory by
referencing 80 columns. (This limit only appears in V6 - it's been
eliminated in V7).

To change the limit, have them create a file, called hliargv.c,
containing the following two lines in it:

#define ARGVSIZE 100 <--- this should be set to whatever
they want...
char *sqlv[ARGVSIZE];

they should then change their ld file so that it references this
object file.


Progress Software Technical Support Note # 13780