Hello once again...
I'm using SQLDA, but, as i understand, it's useful after the query executed, but my problem, is that incoming query can be more than memory allocated for it. I know the size of query, but i can't dynamicly allocate memory for it when i'm declaring a host variable because when i'm trying to put the variable with known size in declaration, SQL precompiler fails with the message: "Variable hostvarquery not defined or not usable"
Here is a small part of my programm (to illustrate what i'm talking about):
Code:
//bytes -- incoming variable
EXEC SQL BEGIN DECLARE SECTION;
char hostvarquery[bytes];
EXEC SQL END DECLARE SECTION;
//myquery is a pointer to incoming query
strcpy(hostvarquery,myquery);
//Here is a problem string
EXEC SQL PREPARE MyStatement from :hostvarquery;
//*mydaptr is a pointer to SQLDA struct
EXEC SQL DESCRIBE MyStatement INTO :*mydaptr;
If declare hostvarquery like this:
Code:
EXEC SQL BEGIN DECLARE SECTION;
char hostvarquery[1024];
EXEC SQL END DECLARE SECTION;
all will be fine, but hostvarquery will not be dynamic, and if a client sends query bigger than 1024 - it will not work

My question is how to make the size of hostvarquery dynamic?
Thanx one more time!