AW: AW: AW: RecID from Cursor

erne ernestogiannotta at tiscalinet.it
Tue Feb 15 22:57:44 CST 2005


Hi,

On 15 feb 2005, at 21:38, Florian Bogeschdorfer wrote:

> You could also use
>
> SELECT RecID, * FROM ...
>
> Then it would be first again.
>

and if you have a join you could do

SELECT a.RecID, b.RecID, a.*, b.* FROM Tbl1 a, Tbl2 b...

then you can get

RecidOfTbl1 = curs.ULongField(1).Value
RecidOfTbl2 = curs.ULongField(2).Value

unfortunately V1.x sql doesn't support field alias
(as in "a.RecID as RecidOfTbl1")
and you can't use curs.Field("RecID") syntax because it can become 
ambiguos if there's more than one in cursor


Cool Runnings,
Erne.

> Florian
>
>> -----Ursprüngliche Nachricht-----
>> Von: valentina-bounces+fb=memedia.de at lists.macserve.net 
>> [mailto:valentina-
>> bounces+fb=memedia.de at lists.macserve.net] Im Auftrag von Chuck Pelto
>> Gesendet: Dienstag, 15. Februar 2005 21:35
>> An: Valentina Developers
>> Betreff: Re: AW: AW: RecID from Cursor
>>
>> Maybe not, Florian,
>>
>> This is more like SQL than RB. The question is that with your 
>> suggested
>> syntax for the SQL query, SELECT *, RecID.....
>>
>> ...the star means all fields. Right? Putting a comma and "RecID" after
>> the star, seems to me to indicate All Fields + RecID. The placement
>> would be all the fields in the table followed by the RecID field.
>>
>> According to Ruslan's comment about going after the field number where
>> the RecID is found, (1) in his first example and (3) in his second, it
>> seems logical to me that if the RecID is being tacked onto the end of
>> all the other fields, that the value of n could be determined by a 
>> call
>> of curs.FieldCount. Then use n in the call of...
>>
>> recID = curs.ULongField(n).Value()
>>
>> Regards,
>>
>> Chuck
>>
>> On Feb 15, 2005, at 1:23 PM, Florian Bogeschdorfer wrote:
>>
>>> I guess you got to wait for other (Real Basic) people to start 
>>> working
>>> again. Ruslan is probably out of office (its about 1 am over there) 
>>> :-)
>>>
>>> Florian
>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: valentina-bounces at lists.macserve.net [mailto:valentina-
>>>> bounces at lists.macserve.net] Im Auftrag von Chuck Pelto
>>>> Gesendet: Dienstag, 15. Februar 2005 21:20
>>>> An: Valentina Developers
>>>> Betreff: Re: AW: RecID from Cursor
>>>>
>>>>
>>>> On Feb 15, 2005, at 1:10 PM, Chuck Pelto wrote:
>>>>
>>>>>
>>>>> On Feb 15, 2005, at 1:07 PM, Florian Bogeschdorfer wrote:
>>>>>
>>>>>>
>>>>>>> Okay....
>>>>>>>
>>>>>>> Suppose I'm not SELECTing on RecID.
>>>>>>>
>>>>>>> I'm selecting on other data in the table.
>>>>>>>
>>>>>>> How do I get the record ID in that scenario?
>>>>>>>
>>>>>> .net/mailman/listinfo/valentina
>>>>>>
>>>>>> SELECT *,RecID FROM whereever WHERE whatever ...
>>>>>
>>>>> So then, getting the RecID would look like....
>>>>>
>>>>> recID = curs.ULongField(?).Value() //????
>>>>
>>>> Is the answer to my question "n"? Where n is the last field in all 
>>>> the
>>>> field found in the SELECT *?
>>>>
>>>>
|er| musical box
|ne| a media store



More information about the Valentina mailing list