Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Inserting values containing single quotes...

Re: Inserting values containing single quotes...

From: Dave Carr <david_carr_at_cargill>
Date: 28 Jun 1999 16:21:28 GMT
Message-ID: <01bec193$ca2ad2f0$9415010a@fdcmes01wp>


Hello Joerg,

I've tried this and while it works in the SQL*Plus window, it does not work in the code.

I am using VB6/ADO and the MS ODBC for Oracle.

Any ideas???

-Dave

Joerg Leute <leute_at_itdesign.de> wrote in article <7l5198$10t9$1_at_news.lf.net>...

>

> use replace to replace a single quote with 2 single quotes, which works
>
> dim strInsert as String
> strInsert = "My'Test"
> INSERT INTO TEST Name Values('" & strInsert & "')
> doesn't work
>
> but if you do it like this
>
> INSERT INTO TEST Name Values('" & replace(strInsert,"'","''") & "')
>
> It works...
  Received on Mon Jun 28 1999 - 11:21:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US