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     Accessing PL/SQL Return Value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Accessing PL/SQL Return Value
 Login/Join
 
Platinum Member
posted
When I call a PL/SQL procedure that returns a character string, I don't know how I can access the string in my WebFocus program.

I am running the following code:
-SET &PASSWORD = 'MYPASSWORD';

SQL SQLORA SET SERVER MRS_SEC

SQL SQLORA
EX MRS_SEC.PASSWORD_ENCRYPTION2.GET_ENCRYPTED_PASSWORD '&PASSWORD', ?;
END



Here is the PL/SQL procedure:
   PROCEDURE get_encrypted_password (
      p_password VARCHAR2,
      v_encrypt OUT VARCHAR2
   )     
   IS  

   BEGIN  
      v_encrypt := encrypt(p_password);
   END;

  


And I get this output:
FILE=@@@@0016 ,SUFFIX=FIX SEGNAME=@@@@0016 FIELDNAME=V_ENCRYPT ,E01 ,A2000 ,A2000 ,$ 7E6EA28391C98C890B9F474165466AF3 


The value 7E6EA28391C98C890B9F474165466AF3 is what I need to access, but I don't know how to get a handle on it.

I also tried TABLE FILE SQLOUT at the end of the EX call, but I got an error message.

Can anyone please help me iron out my syntax to enable me to access the string?

Thanks very much,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
Expert
posted Hide Post
The manual "Adapter Administration..." shows you how to call the stored procedure, but not what to do after the call.

Silly question, but have to tried TABLE FILE @@@@0016?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Hey Francis,

Definitely not a silly question (and I don't think you would ever ask one!) Smiler

I have tried that, and I get
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: @@@@0016
BYPASSING TO END OF COMMAND

Thanks for the suggestion though.

I have found a way using REFCURSOR such that I can get the string into an amper variable when accessing the data from a table in the PL/SQL procedure. And for this particular problem, I can get it to work using select of encrypt(p_password) from DUAL, but I find that very clumsy.

So I'm still hoping to find a more straightforward way to do this. It must exist!!

Thanks,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
Platinum Member
posted Hide Post
Francis,

I reread the section on the Oracle adapter that you referred to (I had a copy from the Tech Support section which also contained an example), and it looks like I can only accomplish this with the cursor method. In other words, I can't just assign a value to a variable and process it in WF. Although as indicated above, I do get a line of text containing the string that I had hoped to be able to assign into an amper variable, so it's unfortunate I can't access it!

Thanks again,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
Virtuoso
posted Hide Post
smiths,

quote:
SQL SQLORA
EX MRS_SEC.PASSWORD_ENCRYPTION2.GET_ENCRYPTED_PASSWORD '&PASSWORD', ?;
END


In my experience one should write:
  
SQL SQLORA
EX MRS_SEC.PASSWORD_ENCRYPTION2.GET_ENCRYPTED_PASSWORD '&PASSWORD';
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS SMITHS
END
TABLE FILE SMITHS
PRINT *
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Platinum Member
posted Hide Post
Daniel,

Yeah, I thought that something like that should work. I modified your version slightly to include the '?' (because it failed with lack of parameters otherwise) that is required for the return parameter, plus I've changed the proc name slightly:
 -SET &PASSWORD = 'XX';

SQL SQLORA SET SERVER MRS_SEC

SQL SQLORA
EX MRS_SEC.PASSWORD_ENCRYPTION2.XX_GET_ENCRYPTED_PASSWORD '&PASSWORD', ?;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS SMITHS
END
TABLE FILE SMITHS
PRINT *
END
 


I get the following error:
 (FOC1400) SQLCODE IS 6550 (HEX: 00001996) 
: ORA-06550: line 1, column 67:                                           
: PLS-00103: Encountered the symbol ")" when expecting one of the         
: following:                                                              
:    ( - + case mod new not null others                    
:      avg         
:    count current exists max min prior sql stddev sum variance           
:    execute forall merge time timestamp interval date                    
:                      
:      pipe                         
:    
(FOC1405) SQL PREPARE ERROR. 
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SMITHS  
BYPASSING TO END OF COMMAND

 


I was able to get it working with the following code:
 -SET &ECHO = ALL;

SQL SQLORA SET SERVER MRS_SEC

SQL SQLORA
EX MRS_SEC.PASSWORD_ENCRYPTION2.get_encrypted_password 'SMITHS';
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS H_ENCRYPT
END
-RUN

DEFINE FILE H_ENCRYPT
ENCRYPT_PSWD/A32 = EDIT(PASSWORD_ENCRYPTION2_ENCRYPT_:B, '99999999999999999999999999999999');
END

TABLE FILE H_ENCRYPT
PRINT ENCRYPT_PSWD
ON TABLE HOLD AS H_2
ON TABLE SET ASNAMES ON
END

-RUN

-READ H_2 &ENCRPTPSWD.A32

-SET &ENCRPTPSWD = TRUNCATE(&ENCRPTPSWD);

-TYPE ENCRPTPSWD: (&ENCRPTPSWD)
 


against this PL/SQL procedure:
    PROCEDURE get_encrypted_password (
      p_password VARCHAR2,
      c_histtable OUT rectype
   )     
   IS  

   BEGIN  
   OPEN c_histtable FOR SELECT encrypt(p_password) 
            FROM dual
                 ;   
   END;
 


A bit kludgey, but it seems to work.

But I would prefer something simple like you suggested would work without the need for a cursor in the PL/SQL proc.

Thanks for your time!
Sean

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


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report 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     Accessing PL/SQL Return Value

Copyright © 1996-2020 Information Builders