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

    Unanswered: UPdate statement with functions

    Hi,

    I have one complicated update statement. On this statement I am updating few columns by using some functions & its Index. There is some syntax error, which I am missing. can some one correct this please

    update SAMPLE.SD.table1 SET FIRST_NAME = f1(FIRST_NAME),
    LAST_NAME = f2(LAST_NAME)
    where COLU_ID = 1 WITH (INDEX(ORANGE));

    here f1,f2 are functions.
    If i remove WITH clause from the above statement it is working.
    But My WITH clause is mandatory.

    Please provide me the exact syntax for this.

    Thanks

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    This is a SQL Server syntax. DB2 does not have hints.
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  3. #3
    Join Date
    Jul 2014
    Posts
    294
    Can u make it clear, Db2 does not have hints . what does it mean? We can't use index in an UPdate statement in db2.

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    the with statement part is not supported
    db2 optimizer will select the index if decided that this needed/possible
    optimizer profiling can be used (look at infocenter for details)
    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
    Thanks przytula_guy

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
  •