forums › forums › SQLyog › Using SQLyog › Storing Path Names – Prob
- This topic is empty.
-
AuthorPosts
-
-
January 19, 2006 at 5:40 am #9450snowman53Member
Hi,
I am trying to store Windows file path names as varchar (using the default character set).
However, the back slash is dropped and the string is truncated.
I have tried putting the path string in quotes, but it still drops the back slash. I also tried using varbinary and text types with the same result.
Suggestions?
Thanks!
-
January 19, 2006 at 5:57 am #20291peterlaursenParticipant
I can easily do that (of course). See attached!
Which version of SQLyog do you use? a very old SQLyog version maybe? Well it has to be VERYVERYVERY old then …
Also have a look at HISTORY pane. When inserting 'c:backslash' the SQL would be like
Code:insert into `test2`.`TableName1` ( `id`, `t` ) values ( Â '', Â 'c:\backslash' )This is the correct escaping!
Suggestions? Well … answer all what we ask for here:
http://www.webyog.com/faq/6_26_en.html
.. especially I would like to know if you use HTTP-tunnelling.
-
January 19, 2006 at 10:12 am #20292peterlaursenParticipant
AHA … 😀
Tell me: do you use the GUI or do you write statements yourself ?
no. 2 – right ??
Did you ever study the use of escaping within strings:
http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html
Also see attached!
and BTW: I don't think that even the very first SQLyog (ver 0.9) had such a bug with the GUI! Though I never tried it!
If it is not an 'Error 40' then it possibly could be a PHP mal-configuration!
(an 'Error 40' is when the error is 40 centimeters from the monitor 😆 )
-
January 19, 2006 at 10:50 am #20293peterlaursenParticipant
BTW: let me remind you of one detail more. If you have a mycolumn contaning a string 'c:folderfile'
and you would find all entries starting with the substring 'c:folder' you must write SQL like
Code:SELECT …. FROM mytable WHERE mycolumn LIKE 'c:\\folder\\%'When parsed with LIKE '\\' is stripped down to '\' – next '\ is considered an escaped '' , that is a literal ''.
to put it another way:
Code:SELECT 'backs\ash' LIKE '%\\%'returns TRUE. And it is the ONLY correct way to do it!
See another example with the data from above in attached.
-
-
AuthorPosts
- You must be logged in to reply to this topic.