@DBCOMMAND Select Multiple Columns/Fields

hi,

i have several fields that needs to get data from my ODBC database. i found out that if i compute each field with individual @DBCOMMAND formulas, it takes time for the data to reflect whenever my document refreshes. and so, i decided to create one field that has the only @DBCOMMAND which selects all necessary data from my ODBC database, and from therein, i will be able to assign the values to its corresponding field.

here’s my problem…

query:= @DbCommand (“ODBC”; “db”; “user”; “pass”; “SELECT field1, field2, field3 FROM db.table WHERE field4 LIKE '%XXX%'”);

the query above should only return one (1) and only one (1) row, and it did! but this one row should have three (3) columns, right? columns field1, filed2, field3… base on my understanding, if i access query[1], this means row no.1… i already tried this, and yes, if i access query[2], it will give me an “index out of bounds” error…

im asking for this: how will i retrieve the values from field2 and field3 as i am only able to access field1 in this case… ive already tried @EXPLODE but still not working…

your help is highly appreciated…

sincerely,

jacky

Subject: @DBCOMMAND Select Multiple Columns/Fields

Hi Jacqueline,

Why don’t you use LS:DO rather. Much easier and more efficient.

But a button in somewhere, and get the resultset from you sql qry, then set each field with the corresponding resultset column value.

Less frustrating, and then you do a connection once.

Lexi