PL/SQL :: Spool File Output From Unix To Windows
May 22, 2013
I'm running a sql file in Unix (using SQLPLUS command) and i want the file output to be sent to local windows directory. I specified the windows directory name in my Spool command (Spool C:/<Directory Name> ) , But it is not working
Our Unix server is a FTP server but i don't want to FTP the spool file from unix to Windows as the spool file is Huge and it takes hours for the transfer to complete (and we have to run the script multiple times).
Is there a way i can have the spool file created in Local windows directory when i run my sql script in Unix?
View 5 Replies
ADVERTISEMENT
Jan 20, 2011
I use sqplus in oracle to output the command output to text file .
I use below set environment variable.
SQL> set echo off;
SQL> set linesize 3999;
SQL> set feedback off;
SQL> set feedback off;
SQL> set termout off;
SQL> set pagesize 0;
SQL> spool mapping.txt
select C_SIM_MSISDN,C_SIM_IMSI from RCA_SMART_CARD order by C_SIM_MSISDN;
In ouput file , it look like
SQL> select C_SIM_MSISDN,C_SIM_IMSI from RCA_SMART_CARD order by C_SIM_MSISDN;
060010007 10007
:
:
:
SQL> spool off;
any setting or command that allow me to remove the first sql command line" SQL>select XXXX" and the last command "SQL>spool off" after start up the "spool mapping.txt"
View 1 Replies
View Related
Jan 20, 2011
I use sqplus in oracle to output the command output to text file .
I use below set environment varialble.
SQL> set echo off;
SQL> set linesize 3999;
SQL> set feedback off;
SQL> set feedback off;
SQL> set termout off;
SQL> set pagesize 0;
SQL> spool mapping.txt
select C_SIM_MSISDN,C_SIM_IMSI from RCA_SMART_CARD order by C_SIM_MSISDN;
In ouput file , it look like
SQL> select C_SIM_MSISDN,C_SIM_IMSI from RCA_SMART_CARD order by C_SIM_MSISDN;
060010007 10007
:
:
:
SQL> spool off;
any setting or command that allow me to remove the first sql command line" SQL>select XXXX" and the last command "SQL>spool off" after start up the "spool mapping.txt"
View 8 Replies
View Related
Mar 7, 2011
I would like to store my sql query output into text file.Like for example:
select name from emp where emp_id=101;
Here output should be in text file as
swapna.
I dont want to use spool statement here,since If I use it,spool statement will also be printed in text file which is not my requirement.I just want to take only output.
View 1 Replies
View Related
Jun 14, 2011
I would like to develop a form which will be replica of windows explorer.It should be able to read all files or files from a specific folder from an unix platform.
if yes can i have a template. I do not want to start from the scratch since I do not have much time.
View 5 Replies
View Related
Oct 26, 2011
I need to do the following via the sql plus command prompt :
1. Execute a large ".pls" script file which does various inserts and updates to a table.
2. Spool the output of "select * from updatedtable;" to a text file to see the changes made.
3. Rollback all the updates and inserts in the script.
View 2 Replies
View Related
Jan 3, 2011
I am looking forward for getting the output of audit records in a non-editable format as in pdf or something of that sort. Is it possible from Oracle 10g Rel-2?Can i spool output as PDF format?
View 6 Replies
View Related
Jul 4, 2013
I have 11.2.0.3 Db in HP UX 11.31, I have to spool a table output in csv format which contains arabic letters in few columns. my spool output is not showing the arabic letters properly.
[oratest@]$ echo $NLS_LANGAmerican_America.
AL32UTF8 V$NLS_PARAMETERS NLS_LANGUAGE
AMERICANNLS_TERRITORY
AMERICANLS_CURRENCY
$NLS_ISO_CURRENCY
AMERICANLS_NUMERIC_CHARACTERS
.,NLS_CALENDAR
[Code]....
View 0 Replies
View Related
Oct 4, 2011
when i am calling stored procedure with input and output parameters from batch file .. I am getting the following message ..
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 4 11:48:51 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 14
code which i have written ...
DEClARE
RETCODE NUMBER;
RETMSG VARCHAR2(200);
EXEC SP_SELCT_EMPLOYEE_DATA(277080,'EMPNAME ','EMAIL@EMAIL.COM', 9028045686,111333,25000,'PUNE',35,RETCODE ,RETMSG );
EXIT
Procedure Name :
PROCEDURE SP_SELCT_EMPLOYEE_DATA (
-- A_EMPLOYEE_ID IN VARCHAR2,
--A_JOB_ID IN EMPLOYEES.JOB_ID%TYPE,
P_EMPLOYEE_ID IN EMPLOYEES.EMPLOYEE_ID%TYPE,
P_EMPLOYEE_NAME IN EMPLOYEES.EMPLOYEE_NAME%TYPE,
P_EMAIL IN EMPLOYEES.EMAIL%TYPE,
[code]....
View 2 Replies
View Related
Apr 27, 2012
How to spool the Japanese characters in table using UTL_FILE. I tried with utl_file.fopen it's general,it's spooling. but i am not sure it this right way or not. in this case we need to change any character.
We can't see this characters in TOAD. Only possible in PLSQL developer
create table test1(name varchar2(1000),fname varchar2(1000))
insert into test1 values ('名を入力してください。','姓を入力してください。')
commit;
View 6 Replies
View Related
Jul 10, 2013
I am using something like below , the query runs fine in oracle SQL developer.But I would like to generate a text file by running the script, so I added the Spool command, and those settings,
I tried to run it in SQL developer or SQLplus, they both fail.In SQL developer: I got: ORA-00933: SQL command not properly ended00933. 00000 - "SQL command not properly ended"*Cause: *Action:Error at Line: 16 Column: 1,542In SQLPlus, but I got an error: SP2-0734: unknown command beginning "CteRace As..." - rest of line ignored.it seems it doesn't understand the common expression table. -- SQL code below:set heading offset feedback offset newpage noneset echo offset termout
[code]...
View 3 Replies
View Related
Jul 26, 2011
To add application name in a spool file, I am using the below way.
sqlplus username/pwd@tns @xyz.sql APP0115
SQL> define appname="'&1'"
Enter value for 1: APP0115
SQL> prompt &appname
'APP0115'
SQL> spool &appname._html_jobs.csv;
SP2-0768: Illegal SPOOL command
Usage: SPOOL { <file> | OFF | OUT }
where <file> is file_name[.ext] [CRE[ATE]|REP[LACE]|APP[END]]
But I am getting the above error in the spool file clause because of single quote printing infront of the spool file. But the method of defining a character is "'&1'". So I cannot avoid this single quote in the define clause.
'APP0115'
print the appname like APP0115 instead 'APP0115'.then only I can use this in the spool file clause?
View 3 Replies
View Related
Jun 6, 2013
Oracle version Oracle Database 11g Release 11.2.0.1.0 - 64bit Production running on CentOS Linux release 6.0 (Final), kernel 2.6.32-71.29.1.el6.x86_64.
I am having a hard time spooling a file and displaying special Brazilian characters, even though I can see them correctly in SQLDeveloper:
LEOPOLDO COUTO DE MAGALHÃES JÚNIOR
Spool:
LEOPOLDO COUTO DE MAGALH?ES JUNIOR
I've tried changing the NLS_LANG at the session level, but that cannot be done. I don't want to change the default language of my DB, but really need these characters to display correctly in a file.
View 16 Replies
View Related
Jul 19, 2012
I am calling a stored procedure from a shell script. This stored procedure is having a CLOB object as an OUT parameter. How to write the data in CLOB object a existing file which is there in my client system. Below is the shell and sql scripts.
Shell script
( echo "hello" ) > /root/file.txt
sqlplus -s $user/$pass@$tns @/root/proc.sql /root/file.txt << EOF
EOFSQL script
set pages 0
set trimspool off
[Code]...
spool offThis code writes contents of the OUT variable to file.txt, but my existing data ('hello') is lost.
I figured the it...Use append in the spool command...
View 1 Replies
View Related
Jun 24, 2013
How I can connect database on unix OS and windows what is the deference.
View 7 Replies
View Related
Aug 20, 2010
how to create a file in a folder based on todays date. i need to know how to define a variable in sqlplus and assign a value to it.Here is the code below. The code gets executed without creating a spool file.
DEFINE _DATE = replace('C:\_sysdate_EU001.csv', '_sysdate_', TO_CHAR(SYSDATE, 'DD-MON-YYYY'))
spool _DATE
set serveroutput on size 100000
select * from dual;
spool off
View 14 Replies
View Related
Jul 15, 2013
I would like to spool a clob column to a flag file, however some of the clob are greater than 32k, and I have to have the same record in a single line in the file. Is there any way to achieve this through spooling?
set heading off
set feedback off
set term off
set long 1000000
set longchunksize 500000
set line 32767
set trimspool on
set pagesize 50000
spool file.txt
@--this is my select statement.
spool off
exit
View 1 Replies
View Related
Oct 11, 2011
I want to spool CLOB data into flat file ?
View 6 Replies
View Related
May 20, 2010
We are using Oracle Applications hosed on UNIX servers. There is a custom form in XXX_TOP/forms/US folder that I need to modify.
My Windows desktop has Forms Builder 10g installed. I ft pied fmb file over from UNIX server to my Windows desktop and tried opening it. I get an error FRM-18108:
Failed to load the following objects: APPSTAND, etc etc.
Obviously I am not doing it right. What is the correct way of modifying a form file sitting on UNIX server, using Forms Builder installed on Windows desktop? Do I need to copy all dependent objects to Windows desktop along with fmb file?
View 2 Replies
View Related
Oct 12, 2010
I have to pick a text file created in UNIX server directory and send it as an mail attachment.The problem here is, when the file size exceeding more than 10 MB. I think there is a way to zip a file in UNIX with some .gz extension or something like that.
how to zip a file in unix server using PL/SQL code. So that I will pick the zipped file and send it as an attachment.
View 4 Replies
View Related
Apr 14, 2010
I have text file with data in UNIX. I want to clear only records(make empty the file) using UTL_FILE..
I know we can remove the text file from UNIX and create file again with same name...
Is there any other way??
View 5 Replies
View Related
Apr 15, 2010
I need to develop a form which has to read and display the contents of a text file that is stored in the Unix system where the Oracle data base is installed. So basically its the database server and not the forms application server.
1. Create an external table for the file everytime when the form is loaded by dropping and re creating the table and base the data block in the form on that table and execute_query and display the contents.
2. I am confused whether to use webutil or utlfile packages to read from the file and display on the screen as the file resides in the database or Oracle server and not forms application server or client machine.
View 5 Replies
View Related
Nov 11, 2011
I have a file which is placed on a certain location on unix server. I want to write a code which picks up that file and emails it to certain recipients.
View 3 Replies
View Related
May 19, 2007
I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C.I created a shared lib (libextproc.so) for the following function.
int sysrun(char *command)
{
return system(command);
}
This function runs fine when caled through a driver function in C, meaning that the shared lib is fine.In PL/SQL, I have used the following method to invoke a UNIX command:-
create or replace library shell_lib as '/home/ECETRAonsite/oracle/OraHome1/lib/libextproc.so';
/
create or replace function sysrun (syscomm in varchar2)
return binary_integer
as language C
name "sysrun"
library shell_lib
parameters(syscomm string);
/
Now when I call this PL/SQL function to invoke the command, it is run succesfully but does not create the file.
SQL>
1 declare
2 rc number;
3 begin
4 rc := sysrun('/bin/touch /home/ECETRAonsite/oracle/OraHome1/test/sach');
5 dbms_output.put_line('Return Code='||rc);
6* end;
SQL> /
Return Code=0
PL/SQL procedure successfully completed.I have verified that the path for 'touch' is correct.Following are my configuration files.
listener.ora
-------------
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
[code]...
View 1 Replies
View Related
May 4, 2010
after precompiling the cmpre.pc file, i got cmpre.c file. when i try compiling this .c file, am facing the following error...
servername:/.../home/usr/compile-> cc -g cmpre.c
ld: 0711-317 ERROR: Undefined symbol: .sqlorat
ld: 0711-317 ERROR: Undefined symbol: .sqlcxt
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
View 1 Replies
View Related
Nov 24, 2011
I have a requirement to read a file from windows m/c and write into Unix Server. How can i do that in Oracle forms.
I tried TEXT_IO package.But that is not allowing to access Unix path.
View 2 Replies
View Related
Sep 4, 2008
The output below is looked mass..
1) the capital letter is the name of column
2) consists 8 data for each column name
Quote: STATISTICS_DATE INSTANCE_NAME GENESIS_PORT
-------------------- ---------------------------------------------------------------- ------------
COUNT TOTAL_TIME MAX_TIME MIN_TIME AVERAGE_TIME
--------- ---------- --------- --------- ------------
03-AUG-08 MatlMgr_UpdateInstance140028
35 6.8685906 .83870006 .06330299 .19624545
View 2 Replies
View Related
Oct 15, 2013
i need a script which can take input from a file and give output to other txt file, something like below :
input.txt
001
002
003
004
Query:
select name from employee where employeecode=<ENTRY FROM INPUT.TXT FILE>
Result should go to OUTPUT.TXT File.
View 7 Replies
View Related
May 12, 2010
I am an IT auditor who has been using Oracle 10g Express to test some audit scripts we have created. I write the output of each query in the script to a separate file because it makes it easier for us to go through. However, I cannot get SQLPlus to spool the output files at all. I do not get any errors from running the script, and I can see the results in the SQLPlus window, but I cannot find where the files are actually spooling to, if they are spooling at all.
I didn't specify a network path for any of the spool files because the scripts need to be as generic as possible so they can run on any Windows or UNIX box. An example of my code is below:
spool Audit_Ver
SELECT * FROM V$VERSION;
spool off
But if I search my harddrive for "Audit_Ver" no such file can be found anywhere.
View 7 Replies
View Related
Feb 17, 2011
I began studying Oracle and SQL Developer and I have the following question: If I run a large number of INSERT commands into a table using a SQL Worksheet from the SQL Developer, the fact that in the "Script Output" window a "1 rows inserted" message appears for each created record. slows the execution. How can I inhibit displaying this message in the "Script Output" window during the execution of my INSERT commands?
View 5 Replies
View Related