Friday, March 9, 2012

PL/SQL command to print a saved file in unix?

I've created and written a file to a unix directory using a stored procedure. Is there a way through that same stored procedure to send that file to a printer.

Right now I'm using lp -d 1_it_zeb overpack_lbl.txt to print the file from a command prompt. How would I send this same command to unix using my procedure?

Thanks!
CraigOne method is to create a pipe on unix that performs a specific task, say printing in your case. The following example shows a pipe that is created such that it compresses that file being written to (in this case, PL/SQL).

#--Setup the pipeline to be used in the export process
mknod $dmp_file_name p
compress < $dmp_file_name > $dmp_file_name.Z &

You should be able to formulate a pipe to send the contents to a printer.

Or, you could set up a cron job to look at files being generated and once completed, send it off to the printer.

1 comment:

Unknown said...

SELECT * FROM daily_sales_activity PIVOT (MIN(visit_type) FOR visit_date IN ('1/Sep/2014' ,'2/Sep/2014' ,'3/Sep/2014' ,'4/Sep/2014' ,'5/Sep/2014' ,'6/Sep/2014','7/Sep/2014', '8/Sep/2014' , '9/Sep/2014','10/Sep/2014' ,'11/Sep/2014' ,'12/Sep/2014' ,'13/Sep/2014' ,'14/Sep/2014' ,'15/Sep/2014' , '16/Sep/2014' ,'17/Sep/2014','18/Sep/2014','19/Sep/2014','20/Sep/2014','21/Sep/2014','22/Sep/2014','23/Sep/2014','24/Sep/2014','25/Sep/2014','26/Sep/2014','27/Sep/2014','28/Sep/2014','29/Sep/2014','30/Sep/2014' )) where custname is not null " + whereclause + " ORDER BY CUSTNAME

Ihave this query i wand date as a header in column without harcode kindly help me out ...

Post a Comment