[Gambas-user] How to address more than one table in resultset
Ron
ron at ...1740...
Thu Jan 29 16:35:49 CET 2009
Benoit Minisini schreef:
> On jeudi 29 janvier 2009, Ron_1st wrote:
>
>> On Thursday 29 January 2009, Benoit Minisini wrote:
>>
>>> The '!' syntactic sugar works only if you use an identifier. Otherwise
>>> you must use the [] syntax: rResult["triggers.id"].
>>>
>> Does gambas returns then from second table 'triggers' the field 'id'
>> as "triggers.id" ?
>>
>> The query "SELECT * FROM table1,table2 WHERe table1.id= table2.id"
>> I'v never seen every field is returned as "table1.anyname".
>>
>> Just a question, I can't remember 100% or try ATM here to verify.
>>
>>
>
> Alas, it depends on the database driver. (SQL... standard ?)
>
>
For my purpose it works, with MySQL, and rResult["triggers.id"].
But my events.id is not linked to triggers.id, it event.trigger1 ->
triggers.id
This solution with brackets is in my case better than the 'as "xx"'
solution, since I use quite a few fields from both tables, and the query
string got a bit long ;-)
Regards,
Ron_2nd.
More information about the User
mailing list