Jump to content

Csv Download From Plsql Job


rajprakashraj

Recommended Posts

Hello all, naku oka requirement icharu...

 

Select * from table1;

 

ee code ni plsql nightly job run chestaru, need to get the query results in csv file and place it in folder (C:\Users\xyz).

 

 

help fleeze :5_2_108:  :3D_Smiles_38:

Link to comment
Share on other sites

Hello all, naku oka requirement icharu...

 

Select * from table1;

 

ee code ni plsql nightly job run chestaru, need to get the query results in csv file and place it in folder (C:\Users\xyz).

 

 

help fleeze :5_2_108:  :3D_Smiles_38:

 

 

Create a sql script with these lines

 

 

spool c:\users\xyz\sample.csv

 

select * from table1;

 

spool off

 

 

 

that will get you what you want. run this script from command line for testing, check the file.

create a batch script which runs this and call that from nightly job

 

I'm assuming OS is windows. unix/linux aithe, create a shell script and ftp to windows

 

btw, select * from table1 is incorrect, you won't get commas. to get commas  select col1 || ',' || col2 || and so on... from table1

Link to comment
Share on other sites

Oracle apps Ithey
Better write shell script and call sql file
Sql file lo procedure ni call cheyyi
Procedure lo UTL_FILE package use chesuko
And you can sftp output or email to wherever you want.

Link to comment
Share on other sites

Oracle apps Ithey
Better write shell script and call sql file
Sql file lo procedure ni call cheyyi
Procedure lo UTL_FILE package use chesuko
And you can sftp output or email to wherever you want.

 

spool undaga, stored proc, utl_file enduku man?

Link to comment
Share on other sites

Exception handling kosam

 

straight select ki exception endi uncle comedy

 

aina sql handling istundi veetiki, oserror or unknown sqlerrors vaste, ivi pettochu

 

whenever sqlerror exit failure

 

whenever oserror exit failure

 

 

Link to comment
Share on other sites

straight select ki exception endi uncle comedy

 

aina sql handling istundi veetiki, oserror or unknown sqlerrors vaste, ivi pettochu

 

whenever sqlerror exit failure

 

whenever oserror exit failure

 

Char columns date ki convert chesinappudu

aa column format sarrigga lekapothey error kodutundi

its always advisable to create procedure for a report instead of spool for standard reports.

Link to comment
Share on other sites

Sql plus lo aitey spool use cheyochu man.. sql developer aitey direct option untadi kada to export to csv.. sql server data tools aitey direct import to csv using ssis man.. that's it man..

Link to comment
Share on other sites

Sql plus lo aitey spool use cheyochu man.. sql developer aitey direct option untadi kada to export to csv.. sql server data tools aitey direct import to csv using ssis man.. that's it man..

 

not manual

automate cheyyali anta 

Link to comment
Share on other sites

not manual

automate cheyyali anta 

 

ssis aitey simple for automation kada man... sql developer lo aitey bulkcpy use chesi query ni job la cheyyali anukuntunna... sql plus lo aitey telidu man... 

Link to comment
Share on other sites

×
×
  • Create New...