![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| variable substitution in ksh | aoussenko | Shell Programming and Scripting | 3 | 06-11-2009 03:17 PM |
| Sed variable substitution when variable constructed of a directory path | alrinno | Shell Programming and Scripting | 2 | 07-11-2008 02:24 PM |
| KSH variable substitution | tipsy | Shell Programming and Scripting | 5 | 08-14-2006 05:07 PM |
| awk variable substitution | apalex | UNIX for Dummies Questions & Answers | 1 | 09-10-2004 06:02 PM |
| Substitution in a variable | spragueg | UNIX for Advanced & Expert Users | 3 | 10-18-2001 09:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
DB variable substitution in Pro*C
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 |
|
||||
|
to_date takes a char
Code:
EXEC SQL BEGIN DECLARE SECTION;
static long db_sample_date_val=0;
static int db_sample_time_val=0;
static char something[32]={0x0};
EXEC SQL END DECLARE SECTION;
sprintf(something, "%d:%05d", db_sample_date_val, db_sample_time_val)
EXEC SQL
INSERT
INTO sample_tbl(sample_dt)
VALUES (TO_DATE(:something, 'J:SSSSS'));
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|