Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2014
    Posts
    294

    Unanswered: ERROR when updating a Date field

    Hi,

    I have written a procedure to update a date field in a table through a function. I am facing some error.Kindly help me, what I am missing here.


    error:
    below is the error i am getting:

    An unexpected token ".00" was found following "E = 2014-06-28-00.00". Expected tokens may include: "END-OF-STATEMENT".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.17.30
    Run of routine failed.


    Kinldy let me know wat to add/change here
    Last edited by HABBIE; 09-26-14 at 03:19.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    how do you call the proc - parameter
    have you tried debug ?
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jul 2014
    Posts
    294
    Yes,

    I am calling through Ibm data studio.
    on debug, I can find this

    UPDATE gfagkfgkfa SET BIRTHDATE = 2014-06-23-00.00.00

    may be it is stopping my update stmt.
    Last edited by HABBIE; 09-26-14 at 03:19.

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    should be : birthdate = '2014-06-23' if birthdate is date format
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Jul 2014
    Posts
    294
    Yes,

    I am trying that

    SET STMT1= 'UPDATE '|| DBNAME ||'.'|| TBNAME ||' SET '|| CNAME || ' = ''' || TED ||'';

    The string constant beginning with "'2014-06-23-00.00.00" does not have an ending string delimiter.. SQLCODE=-10, SQLSTATE=42603, DRIVER=4.17.30
    Run of routine failed.
    - Roll back completed successfully.

    when i am placing ending quote it is throwing an error.


    Kindly let me know ..
    Last edited by HABBIE; 09-25-14 at 11:17.

  6. #6
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    try this:
    Set stmt1= 'update '|| dbname ||'.'|| tbname ||' set '|| cname || ' = ''' || ted ||'''';
    Regards,
    Mark.

  7. #7
    Join Date
    Jul 2014
    Posts
    294
    Thanks Mark,

    It is working.

Tags for this Thread

Posting Permissions

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