Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    5

    Unanswered: TRANSLATE function - please help

    Hi,
    Does anybody know why i get this error:
    SQL0176N The second, third or fourth argument of the TRANSLATE scalar
    function is incorrect. SQLSTATE=42815

    with this query:
    SELECT TRANSLATE(p.meno, 'aaaaccdeeeiillnnoooorrsstuuuuyzzAAAACCDEEEIILLNNO OOORRSSTUUUUYZZ', 'ăćčďěĺľńňőŕřśšťűůźžĂĆČĎĚĹĽŃŇ ŐŔŘŚŠŤŰŮŹŽ')
    FROM oa.pracovnik p;

    ---
    CREATE TABLE oa.pracovnik (
    ...
    meno CHARACTER(20),
    ...
    );

    Thanks in advance.

    Adam Kovari

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    What platform and DB2 Version/Release are you using?

    Here is a result on DB2 for Windows V9.1.
    Code:
    connect to SAMPLE user db2admin using ********; 
    ---------------------------------------------------------- 
       Database Connection Information 
    
     Database server        = DB2/NT 9.1.2 
     SQL authorization ID   = DB2ADMIN 
     Local database alias   = SAMPLE 
    
    A JDBC connection to the target has succeeded. 
    -------------------- Commands Entered -------------------- 
    CREATE TABLE oa.pracovnik ( 
            meno            CHARACTER(20) 
    ); 
    ---------------------------------------------------------- 
    DB20000I  The SQL command completed successfully. 
    
    -------------------- Commands Entered -------------------- 
    SELECT TRANSLATE(p.meno, 
    'aaaaccdeeeiillnnoooorrsstuuuuyzzAAAACCDEEEIILLNNOOOORRSSTUUUUYZZ', 
    'ťئݬ') 
    FROM oa.pracovnik p; 
    ---------------------------------------------------------- 
    
    1 
    -------------------- 
    
      0 record(s) selected.

  3. #3
    Join Date
    Jul 2008
    Posts
    5
    Thank you for your effort.
    I'm using DB2 Express-C 9.5 on Windows XP 32.
    I' ve found, just a minut ago, that it works on databases with codepage 1250, but not with utf-8, therefore i have converted my database.

    Thank you very much!

Posting Permissions

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