A PROBLEM WITH SINGLE QUOTES IN A VARCHAR2 VARIABLE IN ORACLE

Results 1 to 3 of 3

Thread: A PROBLEM WITH SINGLE QUOTES IN A VARCHAR2 VARIABLE IN ORACLE

  1. #1
    Solution Guest

    Default A PROBLEM WITH SINGLE QUOTES IN A VARCHAR2 VARIABLE IN ORACLE

    Hi,<BR><BR> When you update/insert data in to a Oracle Database from VB or ASP, you write SQL statements and make the change via ADO&#039s,RDO&#039s etc. the sql stms may look like <BR>sqlstmt = "Update table1 " <BR>sqlstmt = sqlstmt & " set my_Column = " & myData<BR>sqlstmt = sqlstmt & " where condition = true"<BR><BR>The problem arises when myData has a single quote in it<BR>eg. myData = "Ralph&#039s Flower Market "<BR><BR>Now in ORacle single quot is the same as double quotes in VB.I tried using some oracle escape characters like the /, but did not work. Is there a way that someone has tried and works ?<BR><BR>Thanks in advance<BR>

  2. #2
    Jaska Guest

    Default RE: A PROBLEM WITH SINGLE QUOTES IN A VARCHAR2 VARIABLE IN ORACLE

    Is this what you are looking for?<BR><BR>squote=chr(39)<BR>myData = "Ralph" & squote & " s Flower Market "

  3. #3
    Solution Guest

    Default RE: A PROBLEM WITH SINGLE QUOTES IN A VARCHAR2 VARIABLE IN ORACLE

    The problem is that Oracle will have a problem with just one single quote.<BR><BR>The solution is to put to single quotes together<BR>so myData = "Ralph" & squote & squote "s Flower Markiet"<BR><BR>This works fine when i pass to the Oracle database.

Posting Permissions

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