Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Hong Kong
    Posts
    8

    Unanswered: 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.

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •