Syntax error in Pro*C

From: guthrie,ian <ilg_at_elan.cc.bellcore.com>
Date: 1996/07/30
Message-ID: <4tmc2k$e28_at_elan.cc.bellcore.com>#1/1


I am using Pro*C release 2.1.2.0.0, Oracle version 7.2.2 on Solaris 2.4. I have the following code segment:

	varchar rback[4];
        char *p;

        if (p=getenv("RBACK")) {
                strncpy((char *)rback.arr, p, 3);
                rback.arr[4] = '\0';
                rback.len = strlen((char *) rback.arr);

                EXEC SQL SET TRANSACTION USE ROLLBACK SEGMENT :rback;
 
                if (sqlca.sqlcode != 0) {
                        printf("cannot set rollback segment %s\n", rback.arr);
                        sql_error();
                }
 
        }
        else
                printf("Environment variable RBACK, not defined.\n");
 

I get the following compile error:

	Syntax error at line 1417, column 49, file srf.pc:
                EXEC SQL SET TRANSACTION USE ROLLBACK SEGMENT :rback;
	..............................................................1
	(1) PCC-S-02201, Encountered the symbol ":" when expecting one 
	of the following:
	
	   an identifier,

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

--
Received on Tue Jul 30 1996 - 00:00:00 CEST

Original text of this message