C error SQL pointer
My function takes pointer *d
as parameter.
I wrote that line - EXEC SQ开发者_如何转开发L 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 get the following error
Semantic error
EXEC SQL VAR d->x is STRING;
Waiting for your suggestions.
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.
精彩评论