Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
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.
Go
New
Search
Notify
Tools
Reply
  
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, 2009Reply With QuoteReport 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: 381 | Location: Europe | Registered: February 05, 2007Reply With QuoteReport 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, 2009Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.