×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Calling Oracle Stored Procedure and Query from FEX FIle

Calling Oracle Stored Procedure and Query from FEX FIle

Calling Oracle Stored Procedure and Query from FEX FIle

(OP)
HI
i have a problem that i can not execute both Procedure and SQL Query from same fex.
For my applicaton i need to run procedure first which appends data to 2 oracle table and then i have to use sql query to retrive data back.
When i run the request it inserts records in Oracle tables. but it does not show any Query Output in browser window.
Because i have used SET ECHO=ALL;
it displays all procedure code in browser alongwith SQL Query. Surprisingly it does not show any error message.

SQL Query which is displayed  if i copy and run on SQL PLUS it gives me exact desired results. can anyone please tell me what is wrong Am i doing?


CODE FOR FEX File

SET ASNAMES=ON
-SET &ECHO = ALL;
-SET &CUSER = GETUSER(USERID);
-SET &SID = &CUSER || &YYMD.EVAL || &TOD.EVAL;
-MRNOEDIT BEGIN
SQL SQLORA
EX DBO.TOPNINSERT '&SID', '10', 'M', '200101', '200212', 'T';
SELECT
QUERY_RESULTS.ORDERING_NUMBER ,
QUERY_RESULTS.SESSION_ID ,
SUBSTR(ATTRIBUTE_1,1,100) ATTRIBUTE_1,
SUBSTR(ATTRIBUTE_2,1,100) ATTRIBUTE_2,
SUBSTR(ATTRIBUTE_A,1,100) ATTRIBUTE_A,
SUBSTR(ATTRIBUTE_B,1,100) ATTRIBUTE_B
FROM
QUERY_RESULTS,
QUERY_SUBSIDIARY_RESULTS
WHERE
QUERY_RESULTS.SESSION_ID = QUERY_SUBSIDIARY_RESULTS.SESSION_ID
AND QUERY_RESULTS.ORDERING_NUMBER = QUERY_SUBSIDIARY_RESULTS.ORDERING_NUMBER
AND
QUERY_RESULTS.SESSION_ID= '&SID';
-RUN
TABLE FILE SQLOUT
PRINT ORDERING_NUMBER AS 'ORDER NO'
SESSION_ID AS 'SESSION'
ATTRIBUTE_1 AS 'ATTR 1'
ATTRIBUTE_2 AS 'ATTR 2'
ATTRIBUTE_A AS 'ATTR A'
ATTRIBUTE_B AS 'ATTR B'
ON TABLE SET PRINT ONLINE
-MRNOEDIT END
-RUN




Thanks
Yogesh

RE: Calling Oracle Stored Procedure and Query from FEX FIle

I believe that you can correct the problem by putting an "END" after the execution of the stored procedure (after the ";"), after the select (again after the ";") and at the end of your table file. Hope this helps.

RE: Calling Oracle Stored Procedure and Query from FEX FIle

Correction: Leave off the "end" after the "select". Also delete the -RUN before the "table file sqlout" (this has been tested in 4.3.6 sp2 )

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close