• Welcome to SQLitening Support Forum.
 

News:

Welcome to the SQLitening support forums!

Main Menu

How to retrieve???

Started by Gary Stout, January 18, 2011, 06:07:50 PM

Previous topic - Next topic

Gary Stout

I am finally getting the ball rolling with SQLitening after putting it off for way too long now.

I have a table that contains 5 fields :

FamilyID   
MemberID   
TransID   
BatchID   
EventID   


This table basically stores program information for the next Transaction # ID, for example. There will never be more than 1 record in the table.
Since I don't know exactly what the TRANSID will be, how can I retrieve this field value without doing a search for unknown information?
In other words, if this was a random file, I would retrieve the record by record number, without searching, and use the value that the record held.

hopefuly this makes sense  ;)

Gary
Gary Stout
gary@sce4u.com

Marc Giao

#1
Hi Gary,

Assume the table is called "tbl_ids" and the fields contain strings, then it would be as follows:


slSel "SELECT * FROM tbl_ids"

slGetRow
a$ = slFN("FamilyID")
b$ = slFN("MemberID") 
c$ = slFN("TransID")
d$ = slFN("BatchID")
e$ = slFN("EventID")
slCloseSet 'just in case you have more rows and don't know it :)


That's it, hope it helps.

Marc

Gary Stout

Marc,

Thanks for the reply! 
In searching the forums, I did find something that seemed to work ok. I do understand your example as well.


slSEL "Select * FROM ProgramData WHERE RowID = 1", %rs1


Gary
Gary Stout
gary@sce4u.com

Marc Giao

Hi Gary,

Yes, that will do it too but I prefer not to reference rows so here is one more way if you just want one or more fields:

QuoteslSel "SELECT TransID FROM PorgramData"

Don't you just love how simple it is :)

Marc

Gary Stout

Quote from: Marc Giao on January 19, 2011, 12:42:00 AM
Don't you just love how simple it is :)

I do love the simplicity. I have been able to eliminate a bunch of Tsunami search code. With Sqlitening, it is amazing how few lines of code will do the same thing and more.  :)
Much more control over how the data is retrieved.

Gary Stout
gary@sce4u.com