|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Strings with string's
im trying to select something that has an Apostrophe in it, for example word.title = 'didn't'
so is there a way in SQL to quote the whole thing without getting an error? |
|
#2
|
|||
|
|||
|
What you do is that you quote the apostrophe.
Code:
... LIKE 'som\'ing' And if you use PHP then you can use the mysql_real_escape_string() function and it will quote all characters that can cause an error for you.
__________________
/Stefan |
|
#3
|
|||
|
|||
|
err
'Electrician\'s book'
get: ORA-01756: quoted string not properly terminated |
|
#4
|
||||
|
||||
|
the reason you got an error is that you tried to run some syntax which works in mysql but doesn't work in oracle
the reason you got that mysql syntax is because you posted your question in the mysql forum!! in oracle, you must use two consecutive single quotes Code:
'Electrician''s book' i will move your thread over to the oracle forum |
|
#5
|
|||
|
|||
|
You din't mention that you where using Oracle and since this is a MySQL forum that is rather important to mention because the DB's differ in syntax.
Use double apostrophe in that case: Code:
... LIKE 'som''ing' When they are grouped together like that they will be considered as one in the string. |
|
#6
|
|||
|
|||
|
oh sorry, i thought oracle was mySQL... ive just started learning.
so whats the difference between the 2? |
|
#7
|
||||
|
||||
|
Quote:
Then you have a lot to learn my friend. ![]() Quote:
Over 49,000 employees and they are as similar as David and Goliath regarding company size, revenue and technology. |
|
#8
|
||||
|
||||
|
that's like saying "oh, i thought the lada was the same as the ferrari"
they are both cars ... |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Strings with string's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|