Hi,
I have declared two DB variables as
EXEC SQL BEGIN DECLARE SECTION;
static long db_sample_date_val;
static int db_sample_time_val;
EXEC SQL END DECLARE SECTION;
and I'm using these varibales in my code as
EXEC SQL
INSERT
INTO sample_tbl(sample_dt)
VALUES (TO_DATE(:db_sample_date_val::db_sample_time_val, 'J:SSSSS'));
I have to use colon infornt of the DB variable for value substitution. But when I execute this query using Pro*C,
I'm getting an SQL Exception because of the two colon being used.
I also tried TO_DATE(':db_sample_date_val::db_sample_time_val', 'J:SSSSS') and
TO_DATE(':db_sample_date_val':':db_sample_time_val', 'J:SSSSS'). But I still get the Exception.
Can anyone help me with this piece of code ?
Thanks in advance!!!
Mary Antony