Author |
Message
|
brgmo |
Posted: Thu Jun 12, 2008 2:39 am Post subject: Array |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Hi All,
Any ideas,what is the best way of handling multiple rows that are returned after firing a esql query. I mean,can i wrie a function or procedure which will query a database and return multiple records as an array.
Regards
brgmo |
|
Back to top |
|
 |
AkankshA |
Posted: Thu Jun 12, 2008 3:04 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
multiple rows can be returned from Db as an array....
u need to store the result in environment tree.. _________________ Cheers |
|
Back to top |
|
 |
brgmo |
Posted: Thu Jun 12, 2008 3:50 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Akansha,can you please give me a snippet of the code which copies data to Environment tree. I mean i am calling a procedure and then passing Environment as INOUT variable but the procedure is failing. |
|
Back to top |
|
 |
AkankshA |
Posted: Thu Jun 12, 2008 3:54 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
well i don't have the toolkit with me now...
so u r calling a procedure in DB or in eSQL...???
if its an eSQL procedurere.. then simply assign the o/p of database query to env tree elements with array []
if its in DB then i fear the road ahead is not easy.. _________________ Cheers |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 12, 2008 3:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
AkanshA...
There are no ARRAYs in ESQL.
There are only Trees and ROWS and LISTS.
Any time you use [] in ESQL, you are accessing a Tree element at a given position from the FIRSTCHILD.
brgmo - you are again asking a very basic question that you could have more easily, more quickly and better answered by 1) reading the documentation, 2) trying things first, 3) showing us what you read and what you tried if that did not work.
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vinbud117 |
Posted: Thu Jun 12, 2008 3:59 am Post subject: |
|
|
Acolyte
Joined: 22 Jul 2005 Posts: 61
|
Read about THE and ITEM in esql reference. It's important to understand to what fields the values get assigned.
Sample snippet:
Environment.Variables.Student[] = SELECT name, class from Database.Student. |
|
Back to top |
|
 |
|