Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    Using a stored procedure to select a column from a table.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using a stored procedure to select a column from a table.
 Login/Join
 
Silver Member
posted
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
 
Posts: 31 | Registered: June 01, 2009Report This Post
Guru
posted Hide Post
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 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 454 | Location: Europe | Registered: February 05, 2007Report This Post
Silver Member
posted Hide Post
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
 
Posts: 31 | Registered: June 01, 2009Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    Using a stored procedure to select a column from a table.

Copyright © 1996-2020 Information Builders