Re: Syntax error in Pro*C

From: Peter Sylvester <peters_at_mitre.org>
Date: 1996/07/31
Message-ID: <31FF4825.291C_at_mitre.org>#1/1


guthrie,ian wrote:

<clip>
> It does not like the :rback. If I replace it with the actual value, (e.g.,
> r01), it compiles. What's wrong with the syntax?
>
> Thanks,
>
> Ian
> --

Well for one thing, the statement {rback.arr[4] = '\0';} is overwriting past the end of the array, as well as introducing garbage.

Should be {rback.arr[3] = '\0';}.

You probably have to use dynamic SQL for this task, such as:

sprintf(my_sql.arr,
 "SET TRANSACTION USE ROLLBACK SEGMENT %s", p); my_sql.len = strlen(my_sql.arr);
EXEC SQL EXECUTE IMMEDIATE :my_sql;

-Peter Sylvester
Mitre Corp. Received on Wed Jul 31 1996 - 00:00:00 CEST

Original text of this message