dbTalk Databases Forums  

dbisql output when using temporary tables in stored procedure

sybase.public.ase.general sybase.public.ase.general


Discuss dbisql output when using temporary tables in stored procedure in the sybase.public.ase.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cspsp
 
Posts: n/a

Default dbisql output when using temporary tables in stored procedure - 02-22-2012 , 11:19 AM






Hi.

I'm trying to output results of my stored procedure to an Excel file
and calling this from a batch file to run regularly.

I'm using:
Adaptive Server Enterprise/15.0.3/EBF 16738 ESD#2/P/NT(IX86)/Windows
2003/ase1503/2708/32-bit/OPT/Mon Jul 27
20:19:56 2009

Interactive SQL version 11.0.0 build 1649

Here's my code:

myprocedure.sql :
create procedure dbo.myprocedure()
as
begin
create table #temptable ( myid varchar(10), lname varchar(10),
fname varchar(10) )
insert into #temptable values('1234567890','Smith','John')
select * from #temptable
end

runreport.sql : exec myprocedure ; output to 'myreport.xls' format
html ;

runreport.bat : dbisql -nogui -c "uid=reportuser;pwd=reportuser" -host
myserver -port 5000 read runreport.sql

If I run the sql file in the Interactive SQL GUI, it outputs the excel
file perfectly. But when I run it using the command line dbisql, it
outputs just the headers, no data into the output 'myreport.xls' file.
The data is echoed to screen when -q option is not selected.

This only happens when I use temporary tables for my output. If I just
run a simple select on an existing database table, the output contains
headers & data.

Any suggestions?

Thanks.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.