|
Post by davos1 on May 3, 2009 13:11:24 GMT -5
mhm I have posted it in coding questions but maybe it is this category. because when using the read/data command it replaces automatically the ' for '' inside a text. direct example: data "insert into x(one,two,tree,four) values ('a','b','c',none);" read a$ print a$
it prints "insert into x(one,two,tree,four) values (''a'',''b'',0,''c'',none);"
so, mysql values can not be inserted in sqlite using data command lines...
also it happens here: data """hi ('how are u')""" prints "hi(''how are u'')"
|
|
|
Post by mackrackit on May 3, 2009 13:35:13 GMT -5
I think it is supposed to happen that way... Like in a HTML command. Use the single quote inside of the double quote. So the single quote really represents a double quote.
You may have to use an escape function. Something like one of the following may help.
' ----------------------------------------- ' Convert single quotes to double quotes ' ----------------------------------------- FUNCTION dblQuote$(str$) i = 1 qq$ = "" while (word$(str$,i,"'")) <> "" dblQuote$ = dblQuote$;qq$;word$(str$,i,"'") qq$ = "''" i = i + 1 WEND END FUNCTION
' ----------------------------------------- ' Convert single quotes to SPACE ' ----------------------------------------- FUNCTION clrQuote$(str$) i = 1 qq$ = "" while (word$(str$,i,"'")) <> "" clrQuote$ = clrQuote$;qq$;word$(str$,i,"'") qq$ = " " i = i + 1 WEND END FUNCTION
' ----------------------------------------- ' Convert SPACE quotes to "_" ' ----------------------------------------- FUNCTION spQuote$(str$) i = 1 qq$ = "" while (word$(str$,i," ")) <> "" spQuote$ = spQuote$;qq$;word$(str$,i," ") qq$ = "_" i = i + 1 WEND END FUNCTION
|
|
|
Post by Carl Gundel - admin on May 4, 2009 10:34:59 GMT -5
Well, I think that's definitely a bug. Thanks.
-Carl
|
|