Aug 22, 2012; 05:02
Kim Vandenbroek
Issue with 'encode_sqlfull' custom type
Hi All,
I tried out Jolle Carlestam's "encode_sqlfull.inc" type posted on TagSwap.
I was able to download the type, but I encountered an error after placing
the tag in LassoStartup on a Lasso 9 site.
Here's a snippet from the error stack:
Failure while running startup script:
/var/lasso/instances/xxxx//LassoStartup/encode_sqlfull.inc -1 Parser error.
/var/lasso/instances/xxxx//LassoStartup/encode_sqlfull.inc: Error while
parsing. Unexpected: LESS line: 29, col: 1
And the code is below. I'm not sure what "Unexpected: LESS" means, anyone
else?
Thanks,
---
Kim Vandenbroek
<?LassoScript
/**
encode_sqlfull
Alternative to encode_sql that also deals with escaping % and _ so that the
resulting string can be safely used when creating sql queries with LIKE
sections.
See Bil Corrys talk from LDC Chicago 2008: All Your Base Are Belong To Us
2011-08-31 JC First version
**/
define string ---> encodesql_full()::string => {
local(text = string(self))
#text -> replace(regexp(`(["'\\])`), `\\\1`) & replace('\0', `\0`)
#text -> replace(`%`, `\%`)
#text -> replace(`_`, `\_`)
return #text
}
define encode_sqlfull(text::string) => #text -> encodesql_full
?>
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Aug 22, 2012; 12:21
Ke Carlton
Re: Issue with 'encode_sqlfull' custom type
Aug 22, 2012; 11:51
Jolle Carlestam
Re: Issue with 'encode_sqlfull' custom type
Re: Issue with 'encode_sqlfull' custom type