SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    May 2001
    Location
    San Francisco, CA, USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    \'Illegal Character\' sending double-quote to ODBC connection

    Hello all,

    Does anyone know of a way to get an ODBC connection to send double-quotes using Silk 5.0.3?

    I'm trying to send Oracle SQL commands to an Oracle 8.0.6 database, using the DB_Exectue Silk command. The commands I have use double-quote (") characters in them. Whenever I send a command through using an ODBC connection, I get a message:
    "*** Error: (42000) [Microsoft][ODBC driver for Oracle][Oracle]ORA-00911: invalid character"
    The specific statement I'm trying to send is:
    delete from "/CWLD/EVT_ARC";
    Though any statement with double-quotes produces the same error.

    I had the same problem going to an MSSQL database before, but in that case I just switched to using single quotes, which the ODBC connection handles without problems. For Oracle SQL, I have to use the double-quote character.

    Anyone else ever seen this issue, and know if any kind of workaround?

    Thanks!

    -Chris

    ------------------


    [This message has been edited by Mohneyman (edited 10-23-2001).]

  2. #2
    Member
    Join Date
    Jun 2001
    Location
    Bedford, MA, USA
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: \'Illegal Character\' sending double-quote to ODBC connection

    Chris,
    The first thing that comes to mind is to try a different ODBC driver. It looks like you're using Microsoft's. Have you tried Oracle's ODBC driver?

    Alternatively, you might try escaping the double-quotes to get them past the driver. I believe the ODBC escape character is a single quote character.
    try: delete from '"/CWLD/EVT_ARC'";

    - Jim

    ------------------

  3. #3
    Senior Member
    Join Date
    Dec 1999
    Location
    Sarasota FL USA
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: \'Illegal Character\' sending double-quote to ODBC connection

    With SQL Server you can configure what the charter is for the quote. On our servers, the single quote is used not the double.

    ------------------

  4. #4
    Junior Member
    Join Date
    May 2001
    Location
    San Francisco, CA, USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: \'Illegal Character\' sending double-quote to ODBC connection

    Thanks for the thoughts. Still no luck. The idea of switching the quote character is good, but I don't think it's an option in this case. I should have clarified that the database I'm trying to work with is an Oracle SQL DB, being used for a SAP instance. So I think we're tied to using double-quotes by the APIs of SAP, but I'll look into that.

    ------------------

  5. #5
    Junior Member
    Join Date
    May 2001
    Location
    San Francisco, CA, USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: \'Illegal Character\' sending double-quote to ODBC connection

    Okay - update. I was printing the string that was being sent to verify it's value looked corect. Silly me. When I run in debug, I see that the string actually has 2 double quotes. So the string I define is:

    STRING sString = 'delete from "/CWLD/EVT_CUR";'

    The string that prints from the print(sString) is: delete from "/CWLD/EVT_CUR";

    However, the local variable in debug mode is:
    "delete from ""/CWLD/EVT_CUR"";"

    It looks like I may be having a problem with Silk's internal representation of the string value. Even though I can define it and print it using single-quotes, Silk is converting them to double-quotes, then doubling the double-quotes in-string. So it may actually be trying to send the string through the DB_ExecuteSQL as: delete from ""/CWLD/EVT_CUR"";

    When I try using that at my SQL Plus command line, I get an illegal zero-length identifier message. The ODBC is giving me 'illegal character,' which might be the ODBC representation of the same string.

    All of which leads me back to the thought that this may just be a limitation of Silk. Anyone else ever seen this and can confirm it?

    Thanks,

    -Chris

    ------------------

  6. #6
    Junior Member
    Join Date
    May 2001
    Location
    San Francisco, CA, USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: \'Illegal Character\' sending double-quote to ODBC connection

    SOLUTION: Change Drivers!

    Okay, I was able to fix it, and thought it might help to post it to the forum. The problem I was having looks like it was due to the drivers. Apparently, with either the 'Microsoft ODBC for Oracle' or 'SQL driver' drivers, the double quote characters are not parsed properly, and I get the 'illegal character' error back. When I switched to a 'Oracle ODBC driver' (mine came from the installation of Oracle 8.0.6 client) I was able to get commands to go through.

    One caveat here is that the Oracle driver does not return any values if you have a successful statement that is not a select. So after doing an insert or a commit you won't get anything back if you try to do a DB_FetchNext. That caused me to error out the first time I tried the driver and I didn't realize that until later (loosing a day or so).

    Thanks again for all the suggestions!

    -Chris

    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:31 AM.

Copyright BetaSoft Inc.