| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: OCI: How can I insert a string including an amphersand (&) from OCI??
Hi Ole.
What does your code look like?
Using OTL -- a generic C++ template interface to Oracle etc. available from http://otl.sourceforge.net/home.htm -- the following simple example that inserts rows into SCOTT.DEPT works with strings containing &:
#include <stdio.h>
#include "otlv32.h"
int main()
{
try {
otl_connect connection("scott/tiger_at_o901");
otl_stream statement;
statement.open(1,
"insert into dept " \
"values (" \
" :deptno<int>, :dname<char[15]>, :loc<char[14]>" \
")",
connection);
statement << 90 << "1" << "2";
return(0);
}
Cheers,
Finn
"Victor Kaminsky" <victorkaminsky_at_yahoo.de> wrote in message news:90a73003.0210121246.57f6feb1_at_posting.google.com... > Ole Hansen <oha_at_city.dk> wrote in message news:<3DA7F142.7060909_at_city.dk>...
> > Hi,
> >
> > I have troble escaping an amphersand (&) from within OCI.
> > Neither single quote (') or backslash (\) seems to work.
> >
> > The statement fails if I try to execute it from OCI if the string
> > includes an amphersand but I dont know how to escape an amphersand (&).
> >
> > I really need to store the amphersand with the string.
> >
> > Any ideas?
> >
> > Thanks in advance!
> > Ole Hansen
>
> maybe you could use the char() function. it is not nice, but could work
Received on Sun Oct 13 2002 - 03:11:11 CDT
![]() |
![]() |