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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] SET userid to variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] SET userid to variable
 Login/Join
 
Platinum Member
posted
Hello,

Is there a way to set a stored procedure's parameter variable to the userid? I seem to be having difficulties doing this. Thanks

Here's the code - '&ppnum' is the stored proc variable

 -* File pulse18.fex

ENGINE SQLMSS SET DEFAULT_CONNECTION IVB
SQL SQLMSS
EX ORBIT.dbo.PULSE18Agent '&ppnum'

;

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS SQLOUT
END

DEFINE FILE SQLOUT
PPNUME/A7=(EmpID);
USERID/A8='&IBIC_user';
USERID9/A8=(USERID);
USERNUM/A6=EDIT(USERID9, '$$999999');
USERID2/A8=UPCASE(7,USERID9,'A7');
END

SET NODATA = ' '

SET &ppnum = USERID2

TABLE FILE SQLOUT
PRINT
     EmpID
     FName
     LName
     Division
     Team
     Role
     TotRank
     COMPUTE Rank/D6.1% = TotPerRank * 100;
     TotPoints
     COMPUTE Productivity/D6.1% = Prod * 100;
     ProdRank
     COMPUTE Rank/D6.1% = ProdPerRank * 100;
     ProdPoints
     RCpH
     RCpHRank
     COMPUTE Rank/D6.1% = RCpHPerRank * 100;
     RCpHPoints
     UpH
     UpHRank
     COMPUTE Rank/D6.1% = UpHPerRank * 100;
     UpHPoints
     CIQ
     CIQRank
     COMPUTE Rank/D6.1% = CIQPerRank * 100;
     CIQPoints
     MonScore
     MonRank
     COMPUTE Rank/D6.1% = MonPerRank * 100;
     MonPoints
HEADING
"Pulse - Core Sales"
" "
FOOTING BOTTOM
"Report Date: <+0>&DATE <+0> "
"Created By the Reporting Group"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
END 

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


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Virtuoso
posted Hide Post
IBIC_user is not passed as a standard variable. You would have to do something special (for instance in the site.wfs) to get this done. Is there some method in place to pass the variable?
And by the way, SET &ppnum=USERID2 is not a valid statement. Don't know exactly what you are trying to accomplish with that...

I think you had best do the username thing first, using dialog manager, and then do the call to the stored procedure - something like:
-SET &ppnum = UPCASE(8,&IBIC_user,'A8');

ENGINE SQLMSS SET DEFAULT_CONNECTION IVB
SQL SQLMSS
EX ORBIT.dbo.PULSE18Agent '&ppnum'
;


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
Are you trying to get USERID2 into &ppnum ?


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Yes - I've need to get the defined field USERID2 into &ppnum which is the stored procs parameter. I'll try Gam's suggestion. I'll get back to you guys. Thanks!


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
You cannot pass a field value directly into a dialogue manager variable. You would have to retrieve the value into a file and then -READ it -

TABLE FILE parmfile
PRINT USERID2
WHERE [your predicate]
ON TABLE SAVE AS SPPARM
END
-RUN
-READ SPPARM, &ppnum

Notes:
  • Use SAVE and not HOLD - default format is ALPHA and you do not get a .mas which you do not need.
  • Usage of the comma after the saved file name in the -READ statement negates the need to specify variable length.
  • This will, of course, only read the first value in the saved file.
  • The -RUN is necessary to ensure that the table request is actioned prior to the DM code for reading it.


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
The other way to get a field value into a variable is to create the set statement in the TABLE FILE, and -INCLUDE the save file.
TABLE FILE CAR
 PRINT COMPUTE SET_LINE/A80 = '-SET &|MyVal = ''' || COUNTRY || ''';' ;
 BY COUNTRY NOPRINT
 WHERE COUNTRY EQ 'ENGLAND'
 ON TABLE SET HOLDLIST PRINTONLY
 ON TABLE SAVE AS INC_SET
END
-RUN
-INCLUDE INC_SET
-TYPE &MyVal


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
There are many feline pelts around at the moment Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
That there is, all depends on which cat you get it from. Big Grin


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] SET userid to variable

Copyright © 1996-2020 Information Builders