Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2007
    Posts
    2

    Unanswered: Same SQL Being run from two applications producing different error messages

    Hi All,

    I'm at a loss to explain the following and hoping someone out there can help.

    I had a problem with the following SQL:

    INSERT INTO TABLE1 VALUES
    (2007/09/10 13:49:55, 'Test', 'Testing', 'Tested')

    Now obviously i knwo there is a problem in this SQL being that the Date and Time are not around quotes but that aside i wanted to find out something else.

    Running that statement in TOAD gives me the following error message:

    ORA-00917 : Missing Comma.

    Running the exact same statement in SQL Plus gives the following error message:

    SP2-0552: Bind Variable "49" not declared.

    Any ideas why the same Statement ran against the same database using two different applications are giving me two different errors.

    Look forward to your answers.

    Thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    The value of NLS_DATE_FORMAT differs.

    >INSERT INTO TABLE1 VALUES
    (2007/09/10 13:49:55, 'Test', 'Testing', 'Tested')

    Above is a POORLY written INSERT statement that should NEVER be released into Production. It deserves to generate error.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Sep 2007
    Posts
    2
    The question is not really about the syntax since i know this is wrong and poorly written. This is simply a test i was doing from which i found two different results from two diffeent applications.
    The question that i wanted answered was why i am getting two different errors from two different applications with the same SQL Statement.
    Is there something different about the connection string used.

    If anyone has any ideas, they would be most appreicated.

  4. #4
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by Oracle_Maestro
    Any ideas why the same Statement ran against the same database using two different applications are giving me two different errors.
    Because each application deals differently with your errors.

    But why do you care at all. The statement is wrong, so why try to run it at all.

  5. #5
    Join Date
    Feb 2005
    Posts
    57
    I suspect its to do with how the two applications parse the SQL statement. The first error TOAD detects is what it sees as a parameter error, expecting a comma between date and time. The first error SQL*Plus detects is an undeclared bind variable :49

Posting Permissions

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