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 :)
Thanks,
Gopala
On Thu, Jan 24, 2013 at 12:24 PM, Adriano dos Santos Fernandes <
adrian...@gmail.com> wrote:
> On 24/01/2013 10:14, Gopala Krishna Gundeboyina wrote:
> > @Alex: I embedded standalone Firebird Server (not embedded Firebird
> > server) in to my application as a Dll. So Firebird Server works as a
> > standalone most of the time but only for configured external tables it
> > uses my library for data retrieval.
> >
> > I have this done on Firebird Server v2.3 at the time ExtDS is not
> > availabe i believe.
> >
> > With that I think I can now put my requirement in detail.Lets say I
> > have a SQL query:
> >
> > * select * from VISITLOG /*+ USERCATEGORY='cat1' */
> >
> > From the above query, I want to get data for a group of users which
> > the underlying API understands and uses it as an index for data
> > retrieval . I can extract this comment in a sql statement, but as you
> > said the problem is I cannot see it once it is translated to BLR. (I
> > do not want to parametrize hint I just meant this happens in SP, VIews
> > and parametrized queries)
> >
> >
> If you make your external tables to have a HINT column, you can do:
>
> select * from VISITLOG where HINT = 'USERCATEGORY=''cat1'''
>
> You'll have to parse blr, but there is no way other than this to make it
> work inside stored procedures.
>
> It's very ugly, but will work.
>
>
> 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
>
------------------------------------------------------------------------------
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