Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 8th, 2005, 11:21 PM
magic07 magic07 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 35 magic07 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 12 m 26 sec
Reputation Power: 5
Question quotation mark problem

Hi everybody,
i have a one problem, maybe it's very simple, but could't solve this problem, when i am inserting text data to table, i am getting error that inserting text data has quotation mark,

insert into table test1( id, txtstr)
values (1, ' It's my first ')

problem is qoutation mark It's

how can i insert text with qoutation mark, anybody can help me?
thanks in advance

Reply With Quote
  #2  
Old February 9th, 2005, 01:53 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 969 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 27 m 16 sec
Reputation Power: 57
Simply use two quotation marks:
Code:
insert into table test1( id, txtstr)
values (1, ' It''s my first') 

Reply With Quote
  #3  
Old February 9th, 2005, 05:09 AM
magic07 magic07 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 35 magic07 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 12 m 26 sec
Reputation Power: 5
shammat
you didn't understand me. yuor style i know.
"It's my first" just example. Users will type data to textbox, about 3000 symbols, and In your way i have to seach quotation from text, i didn't want search quotation mark from textbox then add '.
just i want to insert all text, without searching qouatation.

Reply With Quote
  #4  
Old February 9th, 2005, 05:36 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 969 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 27 m 16 sec
Reputation Power: 57
Depends on the programming language that you use.

If it is Java then I would recommend to use a PreparedStatement, that will handle the conversion for you.

Reply With Quote
  #5  
Old February 9th, 2005, 05:59 AM
magic07 magic07 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 35 magic07 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 12 m 26 sec
Reputation Power: 5
Yes Shammat
It's in Java
can you explain please

Reply With Quote
  #6  
Old February 9th, 2005, 06:28 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 969 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 27 m 16 sec
Reputation Power: 57
Code:
String theValue = "It's my first";
int id = 42;
String sql = "INSERT INTO test (id, txtstr) VALUES (?,?)";
PreparedStatement stmt = connection.prepareStatement(sql);
stmt.setInt(1, id);
stmt.setString(2, theValue);
stmt.executeUpdate();
connection.commit();

Reply With Quote
  #7  
Old February 9th, 2005, 07:19 AM
magic07 magic07 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 35 magic07 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 12 m 26 sec
Reputation Power: 5
Thumbs up

thanks. it's worked.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > quotation mark problem


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 6 hosted by Hostway