[SQL Yoga] Trying to get started.

Trevor DeVore lists at mangomultimedia.com
Tue Feb 16 15:22:36 EST 2010


On Feb 16, 2010, at 3:10 PM, Andrew Kluthe wrote:

> Ok, I made an Database object, I made a connection object. Do I have  
> to
> dbobject_reloadSchema before I can do this?

The very first time SQL Yoga connects to your db it will import the  
schema. You only need to call dbobject_reloadSchema if you later  
change the db schema. A lesson with some more info/visuals here:

Introduction to the Database Object and Database Schema: <http://revolution.screenstepslive.com/spaces/revolution/manuals/sqlyoga/lessons/6870 
 >

> on PopulateListOnFilter
>   local tLeaseList, tSQL, tConditions
>
>   put sqlquery_createObject("tlease") into theQueryA
>   put "Type is" && gType && "and ActiveLease is" && gLeaseStatus into
> tConditions
>   sqlquery_set theQueryA, "conditions", tConditions
>   sqlquery_retrieveAsArray theQueryA, theDataA

Another way to do the conditions that might be more readable:

sqlquery_set theQueryA, "conditions", "Type is :1 and ActiveLease is : 
2", gType, gLeaseStatus

Basically you define placeholders and then pass in the values starting  
with param 4.

See sqlquery_set docs for more info:
http://www.bluemangolearning.com/revolution/docs/sql_yoga/api_docs/Documents/stack_libSQLYoga_command_sqlquery_set.htm

>   put the result into theError
>   if theError is empty then
>      set the dgText [false] of group "LeaseGrid" to theDataA
>      esle
>      answer "Error Populat Leases:" && theError
>   end if
> end PopulateListOnFilter
>
> It says it cannot find the table or a query template 'tlease'.
>
> When I do reloadSchema, the plugin doesn't list all of my tables  
> (there are
> MANY MANY in here because of the different views for reporting).  
> When I copy
> and paste the schema listed in the plugin it cannot find "tlease" at  
> all in
> it.
>
> Is there a table limit to SQL Yoga?

There isn't a table limit but only tables returned by  
revDatabaseTableNames are currently imported. Perhaps  
revDatabaseTableNames doesn't list views? What db are you using and is  
tlease a table or view? I can always update the importer code if  
revDatabaseTableNames isn't working properly.

-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com




More information about the use-livecode mailing list