On 24/01/2013 11:40, Gopala Krishna Gundeboyina wrote:
> Hi Adriano,
>
> I have this implemented as an UDF and currently using it as
> workaround. My queries look like this:
>
> * select * from VISITLOG where HINTUDF('USERCATEGORY=''cat1''') =1.
>
> I am parsing the blr to extract this information and also optmized it
> to execute the HINTUDF udf only once instead for each row. But as you
> said it is ugly and user has to take pain in escaping single quotes if
> the hint involves sql queries or nested sql queries which is a
> possibility.
>
> * select * from VISITLOG where HINTUDF('select * from USERS where
> catogary=''cat1'') =1.
>
> But it works just fine. Moving this to comment section will be a neat
> way and it is readable too in editors :)
>
Firebird 3 has an additional string encoding (it will not be backported
by the project, but maybe you can do it for your version).
q'{ ... ... ... ' ... ... ... }'
q'[ ... ... ... ' ... ... ... ]'
q'( ... ... ... ' ... ... ... )'
The single quote inside it is not escaped. You can also open/close with
the same character:
q'# ... ... ... ' ... ... ... #'
Adriano
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel