开发者

C error SQL pointer

开发者 https://www.devze.com 2022-12-21 00:18 出处:网络
My function takes pointer *d as parameter. I wrote that line - EXEC SQ开发者_如何转开发L VAR d->x is STRING;

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号