SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
export rezult from SQL Select

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
export rezult from SQL Select
Author Message
Bobo



Joined: 22 Sep 2003
Posts: 5

Post export rezult from SQL Select Reply with quote

Is it posible when exporting rezults form SQL Select to include header row?

-----------------------------------------------------------------------
Dim retrieved_rows, number

Dim exported_rows, number

// Connect to database

DatabaseConnect( "abc" )

// Reterieve data

DatabaseRetrieve( "select col1, col2 from table1", retrieved_rows )

// Save current month data in Excel file

DatabaseSave( "c:\\Reports\\table1.xls", "xls", exported_rows )

// Disconnect from database

DatabaseDisconnect
------------------------------------------------------------------

File table1.xls contains data but no column names (col1,col2)

Mon Jul 31, 2006 5:32 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: export rezult from SQL Select Reply with quote

You would need to add it yourself, for example

DatabaseRetrieve( "select \"col1_header\", \"col2_header\" union all select col1, col2 from table1", retrieved_rows )

Another solution is to create a preformatted Excel file with headers, fonts, cell formats, formulas, etc... and an "on startup" macro. From a job you can save the exported data into temp XLS of CSV file and then start the preformatted file and have the macro load the data from the temp one.

: Is it posible when exporting rezults form SQL Select to include header row?

: -----------------------------------------------------------------------
: Dim retrieved_rows, number

: Dim exported_rows, number

: // Connect to database

: DatabaseConnect( "abc" )

: // Reterieve data

: DatabaseRetrieve( "select col1, col2 from table1", retrieved_rows )

: // Save current month data in Excel file

: DatabaseSave( "c:\\Reports\\table1.xls", "xls",
: exported_rows )

: // Disconnect from database

: DatabaseDisconnect
: ------------------------------------------------------------------

: File table1.xls contains data but no column names (col1,col2)

Mon Jul 31, 2006 7:27 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.