SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
DatabaseRetrieve to execute stored procedure

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
DatabaseRetrieve to execute stored procedure
Author Message
Eugene



Joined: 29 Dec 2003
Posts: 11

Post DatabaseRetrieve to execute stored procedure Reply with quote

Hi,

We use 24x7 ver. 3.4.24
We are trying to execute stored procedure and save result set to a file.
Here is the code we use:

DatabaseRetrieve("execute sp_name",rows_return )

DatabaseSave( "c:\\temp\\test", "CSV", rows_return )
We have log inside stored procedure and see that it executes twice every time when we call it once.
This is not a new problem and we contacted you about it few years ago when we use earlier versions.
Please let us know if there is any solution in version we use or later versions.

Thank you

Mon Jul 18, 2005 9:22 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: DatabaseRetrieve to execute stored procedure Reply with quote

The procedure is executed twice for the following reason - it is executed first to obtain the result set definition, second time it is executed normally.
The solution to this issue as the same as it was suggested earlier which is to use a temporary table

DatabaseExecute( "create table #my_results (col1 int, col2 ....)", rows )
DatabaseExecute( "insert into #my_results execute sp_name",rows )
DatabaseRetrieve( "select * from #my_results, rows )
DatabaseExecute( "drop table #my_results", rows )

: Hi,

: We use 24x7 ver. 3.4.24
: We are trying to execute stored procedure and save result set to a file.
: Here is the code we use: DatabaseRetrieve("execute
: sp_name",rows_return )

: DatabaseSave( "c:\\temp\\test", "CSV", rows_return )
: We have log inside stored procedure and see that it executes twice every time
: when we call it once.
: This is not a new problem and we contacted you about it few years ago when we
: use earlier versions.
: Please let us know if there is any solution in version we use or later
: versions.

: Thank you

Mon Jul 18, 2005 10:49 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.