0

My function takes pointer *d as parameter.

I wrote 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 get the following error

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

Waiting for your suggestions.

4
  • 2
    post the code please, and tell us which database you are using. Commented Feb 18, 2010 at 10:09
  • Who gives you such error? Did you compile your source using proc ? Commented Feb 18, 2010 at 11:02
  • oh qrdl, i am using make file for compilation. Commented Feb 18, 2010 at 11:52
  • make doesn't compile by itself - it invokes some other programs, based on dependency rules. So my question is - which program gets invoked by make to perform actual compilation? Or this question is no longer relevant, as you have accepted obviously incorrect answer? Commented Feb 18, 2010 at 12:43

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.