|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Simply use two quotation marks:
Code:
insert into table test1( id, txtstr) values (1, ' It''s my first') |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
Yes Shammat
It's in Java can you explain please |
|
#6
|
|||
|
|||
|
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(); |
|
#7
|
|||
|
|||
|
thanks. it's worked.
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > quotation mark problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|