Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 19th, 2001, 02:34 AM
sri_julie sri_julie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 2 sri_julie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to sri_julie
Question

Hi,

I have one field uname in oracle db with varchar2 datatype.iam trying to insert a value like srividya's into that uname field from my asp form page.but iam getting the error..
the insert statement that iam using in asp page is,
-----------------------------
set conn=server.createobject("adodb.connection")
conn.open "dsn=sss;uid=ss;pwd=ss"
set rs= conn.execute("insert into xxx values('"&username&"')")
---------------------------
(where username is the variable name having srividya's has its value)
so, please tell me how to insert a quoted string value into the database.

Reply With Quote
  #2  
Old March 19th, 2001, 10:43 AM
dsb dsb is offline
PerlGuy
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Posts: 714 dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level)dsb User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 15 h 44 m 20 sec
Reputation Power: 36
Send a message via AIM to dsb
Talking

Just use the other kind of quotes as your delimiters.

So, if there are 1 or more single quotes in your string, use double quotes to enclose the value.

If there are 1 or more double quotes, use single quotes to enclose the value.

If there's both in your string...well then your going to have to ask someone else. But the above methods should work

Hope that helps
__________________
- dsb -
Perl Guy

Reply With Quote
  #3  
Old March 19th, 2001, 10:08 PM
sri_julie sri_julie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 2 sri_julie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to sri_julie
Smile

hi dsb,

thanks and i'll try that.

Quote:
Originally posted by dsb
Just use the other kind of quotes as your delimiters.

So, if there are 1 or more single quotes in your string, use double quotes to enclose the value.

If there are 1 or more double quotes, use single quotes to enclose the value.

If there's both in your string...well then your going to have to ask someone else. But the above methods should work

Hope that helps

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > inserting a string having quotes into the oracle db


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway