Forums
iWay Products
Using a stored procedure to select a column from a table.|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
Hi,
I am trying to do something rather simple but am having problems getting it to work. I have created a stored procedure that accepts a parameter that will be used to select a column (COLUMNA) from a row in a table and then return another column's value (COLUMNB) to the calling flow. The problem is that COLUMNB holds the literal value 'COLUMNB' and not the value of COLUMNB. SQL SELECT COLUMNB FROM TABLE WHERE COLUMNA = '&PARM1' END -SET &&OUTPARM = COLUMNB; -RUN -EXIT I am not sure if the above is the correct way to do this or if I should be using a synonym to hold the input and output parameters. Any suggestions will be greatly appreciated. Thank you in advance. TomG WebFOCUS 7.6.7 Linux csv/.txt, pdf, Excel |
||
|
|
Platinum Member |
Do you want the database value in &&OUTPARM? Then:
TABLE FILE ... PRINT COLUMNB FROM WHERE COLUMNA = '&PARM1' ON TABLE SAVE END -RUN -READ SAVE &&OUTPARM.A20 -TYPE &&OUTPARM -EXIT Test: WF 7.6.10 Prod: WF 7.6.9 DB: Progress, IBM DB2, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle 9i/10g. |
|||
|
|
Member |
Hi Frans,
Your solution is exactly what I was looking for. Thank you for your help on this. Tom WebFOCUS 7.6.7 Linux csv/.txt, pdf, Excel |
|||
|
| Powered by Social Strata |
| Please Wait. Your request is being processed... |
|
Forums
iWay Products
Using a stored procedure to select a column from a table.
