revDataFromQuery - list of columns

Jez jbradshaw at blueyonder.co.uk
Tue Jul 1 12:43:01 EDT 2003


My mistake - I had a typo in my list of columns - still it's an odd error to
get!
Thanks anyway - your answer pointed me to some useful techniques I wasnt
aware of.

----- Original Message ----- 
From: "Jan Schenkel" <janschenkel at yahoo.com>
To: <use-revolution at lists.runrev.com>
Sent: Tuesday, July 01, 2003 10:26 AM
Subject: Re: revDataFromQuery - list of columns


> --- Jez <jbradshaw at blueyonder.co.uk> wrote:
> > I'm accessing an Access database via ODBC. How come
> > I can do this:
> > put revDataFromQuery(,,db_id,"select * from pl where
> > pl_team_id =
> > :1","tm_id") into field "Players"
> >
> > but I cant replace the * with a list of columns.
> > When I do this:
> >
> > put revDataFromQuery(,,db_id,"select
> > pl_id,pl_name,pl_desc from pl where
> > pl_team_id = :1","tm_id") into field "Players"
> >
> > I get an error that it;s expecting a 2nd parameter.
> > If you cant do this, is
> > there any way you can plug in parameters to a
> > predefined query/record-set in
> > Database Query Builder?
> >
>
> Hi Jez,
>
> Odd behaviour ; but then again I never use the ':n'
> constructs ; have you tried the following ?
>   put merge("SELECT pl_id,pl_name,pl_desc FROM pl
> WHERE pl_team_id = [[tm_id]]") into tSQLQuery
>   put revDataFromQuery(,,db_id,tSQLQuery)
>
> As for using the Database Query Builder :
> - make an extra query with the connection details ;
> let's name it "pl_tm_id_query"
> - now you can change the query and refresh any fields
> connected to that query by scripting
>   put merge("SELECT pl_id,pl_name,pl_desc FROM pl
> WHERE pl_team_id = [[tm_id]]") into tSQLQuery
>   revSetSQLOfQuery "pl_tm_id_query", tSQLQuery
>
> Hope this helped,
>
> Jan Schenkel.
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same time."
(La Rochefoucauld)
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>





More information about the use-livecode mailing list