Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Posts
    5

    Unanswered: ORA-01704: string literal too long

    Hi,

    Getting the below mentioned error when I am trying to execute the sql statement of length( 8000 characters). The datatype of column I am storing this value is of type LONG.
    What is the maximum length of SQL statement Oracle supports?

    "ORA-01704: string literal too long"


    Here is the sql query that consists of 8000 characters:

    UPDATE SCOTT.EMP1 SET tempcol = 'This is an long string of length 8000 characters........................................ . .................................................. .................................................'


    'tempcol' is column of SCOTT.EMP1 which is of type long.

    Please let me know how to resolve this error?

    Environment details:
    ---------------------

    Version: Oracle 10.2.0.3
    OS : Windows XP


    Regards,
    Dayakar

  2. #2
    Join Date
    Nov 2008
    Posts
    5
    Hi,

    Using implicit mapping from string to long, you're limited by the max size of the varchar datatype !

  3. #3
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by Dayakar.venkivolu
    What is the maximum length of SQL statement Oracle supports?
    It's not the length of your statement, it's the length (as the error message says) of your literal.

    Oracle does not support character literals with more than 8000 characters. You need to use e.g. a prepared statement (with bind variables) in your programming language.

    Btw: The datatype LONG has been deprecated by Oracle since ~10 years. You should use a CLOB column instead.

  4. #4
    Join Date
    Dec 2008
    Posts
    5
    Hi Vincent,

    Thanks for your response!!!

    What do you mean by implicit mapping? Can you show me an example?Could you please elaborate?

    Regards,
    Dayakar

Posting Permissions

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