tags:

views:

52

answers:

1

my function take pointer *d as parameter. i write that line - EXEC SQL VAR d->x is STRING; Actually i want a variable which can store the value of d->x. with that variable i can manipulate some other work

i got error

Semantic error EXEC SQL VAR d->x is STRING;

can anybody help.

+1  A: 

If I were to guess, you want to have a char array, or a char pointer with enough memory, and then put your query string in it:

char query[BIG_ENOUGH];
sprintf(query, "EXEC SQL VAR %s is STRING;", d->x);

The above assumes that your have a string in d->x, and that you want the string value in your SQL query. I don't know if your SQL query is well-formed though.

If this is not what you want, you need to post more information.

Alok
Miss! `EXEC SQL VAR` is Oracle's embedded SQL statement, can be included directly into source
qrdl