Query with underscore in table name

11 views
Skip to first unread message

Web Specialist

unread,
Oct 15, 2008, 8:11:37 PM10/15/08
to DataFaucet ORM
Hi Isaac. Congratulations for this great job. After testing
onTap(months ago) I'm here testing datafaucet! And I'm very happy with
this ORM.

Looking your sample code below how to do a query with underscore in
table name(SIA_BAND)?


<cfscript>
// get the datasource
ds = request.DataFaucet.getDatasource();
qry = ds.query_from_SIA_BAND_where_ban_co_band_lte_5();
</cfscript>

Cheers
Marco Antonio

rob_parkhill

unread,
Oct 15, 2008, 10:04:26 PM10/15/08
to DataFaucet ORM
Marco,

If you have this query structured as a <cfquery> you can actually
just copy that and paste it to the Liquify function that can be found
on the DataFaucet website.

It should return something like this:

<cfscript>
ds = request.DataFaucet.getDatasource();
stmt = ds.getSelect("*","SIA_band");
stmt.filter("band_co_band",= 5,"<");
getValues = stmt.execute();
</cfscript>

I entered this:

<cfquery name="getValues">
Select * from SIA_band where band_co_band <= 5
</cfquery>

Rob

Isaac Dealey

unread,
Oct 16, 2008, 12:54:38 AM10/16/08
to dataf...@googlegroups.com
Rob Parkhill wrote:
> If you have this query structured as a <cfquery> you can actually
> just copy that and paste it to the Liquify function that can be found
> on the DataFaucet website.

Thanks Rob. I think the liquify tool is a good idea for getting started
with something like this, although it will use the "traditional"
datafaucet syntax, rather than the dynamic query syntax that uses
onMissingMethod(). That means two things, 1) it will be a little more
efficient because it will have to lex and parse less and 2) it will work
with ColdFusion 7.

On Oct 15, 8:11 pm, Web Specialist <especialista...@gmail.com> wrote:
> Hi Isaac. Congratulations for this great job. After testing
> onTap(months ago) I'm here testing datafaucet! And I'm very happy with
> this ORM.

Thanks Marco! :) If you get a chance I'd love to hear any thoughts
(suggestions / criticisms) you might have on the onTap framework as well.
I've got a survey up for a little while and still trying to get more
participation.

http://ontap.riaforge.org/blog/index.cfm/2008/9/14/Framework-Survey


> Looking your sample code below how to do a query with underscore in
> table name(SIA_BAND)?
>
> <cfscript>
>   // get the datasource
>   ds = request.DataFaucet.getDatasource();
>   qry = ds.query_from_SIA_BAND_where_ban_co_band_lte_5();
> </cfscript>

As long as you're using CF8, I believe that should work as is. If you're
on CF8 and that's not working, let me know and I'll go back and have
another whack at the onMissingMethod parser to see if I can resolve that
issue. :) That syntax is relatively new, so I wouldn't be surprised if
there are still a few rough edges. As a matter of fact, Gabe let me know
just the other day that I had apparently used refind() instead of
refindnocase() in the parser for the Gateway CFC which made FindBy_blah
() case-sensitive. I detest case sensitivity, so of course I immediately
checked the code to see why. Luckily it was an easy fix. :)

Thanks for getting involved. :)

--
[ ike ] founder - DataFaucet ORM

phone: 781.769.0723

http://www.datafaucet.com


Reply all
Reply to author
Forward
0 new messages