Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello, I want to insert the next 1

Status
Not open for further replies.

MARELUAD

Programmer
Jan 13, 2003
37
NL
Hello,

I want to insert the next string from ACCESS97 to Oracle
"insert into test (PROJECTNUMBER, PROJECTNAME)
VALUES(" & number & ",'" & name & "')"

number = 12345
name = foto's

Now I get the error ORA-01756

Thanks.
 
I'll put money on it being because there's a quote mark in your string.

That would turn it into:
Code:
"insert into test (PROJECTNUMBER, PROJECTNAME)  
 VALUES(12345,'foto's')"
Which wouldn't work.

Try removing the quote first and see if that works.
 
The problem is the quote in: foto's
But how can I insert this string?

 
when inserting it it'll need to be two quote marks, ie:
Code:
''

Although this might cause you problems when using it later.

For a system I worked on we replaced all quote marks in data with something we could later replace back (<Q>) to avoid errors occuring.

Either that or you just remove all the quote marks.

Which ever way you do it you'll probably need to do a REPLACE.

Which side is your code on to copy the data, Access or Oracle?
 
(Note: the best solution would come from Oracle if they would cause double quotes to have the same functionality as singe quotes. Hmmm.)

Another solution we have used to advantage is to replace all &quot;single quotes&quot; (') [ascii 39] with a &quot;backward quote&quot; (`) [ascii 96], and to ensure that your future inputs also filter for that replacement. The backward quote looks close enough to the forward quote that no seems to notice or complain.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top