×
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

Results of SQL Server Stored Procedure Call

Results of SQL Server Stored Procedure Call

Results of SQL Server Stored Procedure Call

(OP)
Hi,

I am executing two different SQL Stored procedures from WebFOcus. I want to get the results of both the stored procedures in one output report file. How do I do that? Here is my code

SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryDataA
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27',0;

TABLE FILE SQLOUT
PRINT *
END

SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryData
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27';

TABLE FILE SQLOUT
PRINT *

END


Here I am using two 'TABLE FILE SQLOUT' statements to get two different report file outputs. If I just use one 'TABLE FILE SQLOUT', it does not work. Please help me in this.

Thanks in advance.

Thambaiya

RE: Results of SQL Server Stored Procedure Call

Try This :

FILEDEF MYSQLOUT DISK D:\TEMP\MYSQLOUT.FTM
SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryDataA
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27',0;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS MYSQLOUT
END

FILEDEF MYSQLOUT DISK D:\TEMP\MYSQLOUT.FTM (APPEND
SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryData
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27';

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS MYSQLOUT
END

TABLE FILE MYSQLOUT
PRINT *
END

The caveat is the FILDEF to a permanent directory must be unique to each request otherwise 2 users hitting the enter
key at the same time could overwrite each others. There are techniques from IBI to prevent this.

UNIX and MVS platforms have similar allocations.

RE: Results of SQL Server Stored Procedure Call

(OP)
Thanks FOCMAN for the answer. I forgot to tell you one crucial information. The resluting columns from the two stored procedures are different. The output that I am getting from your code is giving me the columns of the first stored procedure 'spgoa_GetSummaryDataA' for the outputs of both the procedures. (Please note the names of the stored procedures are different - 'spgoa_GetSummaryDataA and 'spgoa_GetSummaryData)What should I do to get two different sets of columns of data to get appended to one file. Please advice me.

Thanks for all the help.

Thambaiya

RE: Results of SQL Server Stored Procedure Call

Try this :

FILEDEF MYSQLOUT DISK D:\TEMP\MYSQLOUT.FTM
SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryDataA
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27',0;
TABLE FILE SQLOUT
PRINT *
ON TABLE SAVE AS MYSQLOUT
END

FILEDEF MYSQLOUT DISK D:\TEMP\MYSQLOUT.FTM (APPEND
SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryData
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27';

TABLE FILE SQLOUT
PRINT *
ON TABLE SAVE AS MYSQLOUT
END


The result will be just a save file with all items from both
stored procs in it. HOLD creates a MFD (schema) of your answerset but being your requests return different data you can only create this output file with 2 different formats in it.

RE: Results of SQL Server Stored Procedure Call

(OP)
Hi FOCUSER,

Now, I am getting the two rows. But I do not get  the column names for both the result sets. That is simply I get two rows of data - one for each SQL stored procedure.I do not get the column headings for even a single procedure. Moreover, the report text file is also not opening to the user. It simply gets saved as a text file in the path that we provided. How do I resolve this?

Thanks
Thambaiya

RE: Results of SQL Server Stored Procedure Call

Try this :

FILEDEF MYSQLOUT DISK D:\TEMP\MYSQLOUT.HTM
SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryDataA
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27',0;
TABLE FILE SQLOUT
PRINT *
ON TABLE SAVE AS MYSQLOUT FORMAT HTML
END

FILEDEF MYSQLOUT DISK D:\TEMP\MYSQLOUT.HTM (APPEND
SQL SQLMSS

EX GOA01_SQL.dbo.spgoa_GetSummaryData
'30A882AA-D6F7-4A34-8F71-4157C6CEDE27';

TABLE FILE SQLOUT
PRINT *
ON TABLE SAVE AS MYSQLOUT FORMAT HTML
END

This creates HTML Output of all data with column headings.

If you change 'FORMAT HTML' to 'FORMAT WP' you will get more
conventional report look.

RE: Results of SQL Server Stored Procedure Call

(OP)
Thanks a lot FOCMAN. It worked great.

Thambaiya

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