Focal Point
[CLOSED] Print multiple parameters that are selected table Column titles

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1557004595

December 15, 2010, 03:02 PM
roy
[CLOSED] Print multiple parameters that are selected table Column titles
from this list (the parameters) Column titles of a table
I want to display only the columns selected as a multiple select

(in my HTML as a list)










Tried this works for only 1 option value at a time i.e. 1 Column only as output (no good)

&Opt_SQL = '&Opt_SQL'
-SET &TEXT2 = STRREP(&Opt_SQL.LENGTH,&Opt_SQL,4,' or ',1,',',&Opt_SQL.LENGTH,'&Opt_SQL');
-SET &TEXT3 = STRIP(&TEXT2.LENGTH,&TEXT2,'''','&TEXT2');
SQL SQLMSS PREPARE SQLOUT FOR
SELECT
&TEXT3
FROM dbo.ServiceApplication
;
END
TABLE FILE SQLOUT
PRINT
*
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
END


when I try 2 or more option values I get an error

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
December 15, 2010, 03:14 PM
Waz
What does &TEXT3 contain when multiple are selected ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 15, 2010, 03:22 PM
roy
the error is

(FOC1517) UNRECOGNIZED COMMAND ''BUSINESSSPONSOR'' OR ''CERTSTATUS'' =
'''BUSINESSSPONSOR'' OR ''CERTSTATUS'''
(FOC1400) SQLCODE IS 156 (HEX: 0000009C) XOPEN: 42000
: Microsoft SQL Native Client: [42000] Incorrect syntax near the keyword 'OR'. [42000] Statement(s) could not be prepared. [] Deferred prepare could not be completed.
L (FOC1405) SQL PREPARE ERROR.
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
BYPASSING TO END OF COMMAND

However the removal of the ' or ' was I believe successful


WebFOCUS 7.6
Windows, All Outputs
December 15, 2010, 03:35 PM
roy
WAS

-? & informed me that it did not have the results required


WebFOCUS 7.6
Windows, All Outputs
December 15, 2010, 04:04 PM
roy
Upper Case ' OR ' and it works now in the line
-SET &TEXT2 = STRREP(&Opt_SQL.LENGTH,&Opt_SQL,4,' or ',1,',',&Opt_SQL.LENGTH,'&Opt_SQL');


WebFOCUS 7.6
Windows, All Outputs
December 15, 2010, 04:20 PM
Waz
Add -SET &ECHO=ALL; before the -SET &TEXT2

And add -TYPE &TEXT3 after -SET &TEXT3.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 16, 2010, 09:15 AM
roy
Waz
Thank you, I forget that WEB FOCUS is Case Sensitive… I guess I’m just a case insensitive kind of guy.


WebFOCUS 7.6
Windows, All Outputs
December 16, 2010, 03:42 PM
Waz
I certainly didn't spot the case difference, I suspect that I'm insensitive too, certainly been called it a lot.

Smiler


Did the case change help ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 16, 2010, 04:05 PM
roy
Waz

Yes the Case sensitivity and its observation has made the query work... so the next step is an eloquent (simple) code to display what is selected from the HTML options List (left side of page) into a GUI display list (right side) so the user can onclick copy the selection to the display list where a confirmation of items can occur...then the query runs with the selected parameters


WebFOCUS 7.6
Windows, All Outputs
December 16, 2010, 04:19 PM
Waz
Good luck,

If you need help, we are only a post away. Smiler


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!