If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Get CURRENT TIMESTAMP problem in SQLJ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-04, 04:43
cybie cybie is offline
Registered User
 
Join Date: Jan 2004
Location: Hong Kong
Posts: 8
Get CURRENT TIMESTAMP problem in SQLJ

Dear all,

I am a newcomer for SQLJ, and there is a requirement to get the current timestamp as the unique identifier for the message I/O.

Hence i try to code as follows:

#sql [connContext]
{ SET :currentTimestampFromDB = CURRENT TIMESTAMP };

I found this coding works fine in MVS and z/OS environment, but it seems not able to customize db2 sqlj profile, and it throws the following error when I'd take a try to customize it:

[IBM][SQLJ Driver] SQJ0001W Customizing profile "Temp_SJProfile0".


PROFILE NAME: Temp_SJProfile0
SOURCE PROGRAM:
C:\WSAD_Workspace\Java_Source\database\org\imc\cor e\database\

ENTRY LINE MESSAGES
------ ------ ------------------------------------------------------------
SQL0060W The "SQLJ" precompiler is in progress.
0 413 SQL0104N An unexpected token ":" was found following ":".
Expected tokens may include: "<identifier>".
SQL0091W Precompilation or binding was ended with "1"
errors and "0" warnings.

Looking forward for the prompt reply, and thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 07-21-04, 07:15
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Arrow

Well why don't you try omitting the ':'
as the error code suggests?

Also try using values(current timestamp) on
the right side of the declaration
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On