Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Operating Systems & Databases (http://www.baanboard.com/baanboard/forumdisplay.php?f=4)
-   -   Cursors in LN 10.2 (http://www.baanboard.com/baanboard/showthread.php?t=69328)

penahill 4th October 2016 05:50

Cursors in LN 10.2
 
I am trying to find out if I can use a prepare/cursor logic to query data in LN. I am coming from an Informix background using 4gl and very green in LN

Let me give an example of an Informix 4gl cursor logic I would like to use in LN:

let sql = 'SELECT item, price, on_hand FROM table_a '
' WHERE item = ', s.item, 'AND company = ' compr

PREPARE cp_cursor FROM sql
DECLARE cx_cursor FROM cp_cursor
FOREACH cx_cursor INTO p.item, p.price,p.on_hand
Do logic
END FOREACH

I know the FOREACH loop is the selectdo in LN but I would like to build a sql where clause in a string so I can use the input field(s) values to help in getting to the data quicker and more accurate.

Thanks in advance for your response.

Paul

bhushanchanda 4th October 2016 06:52

You can use Dynamic SQL


All times are GMT +2. The time now is 15:34.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com