SPOOL command in 10g
Hello:
I'm trying to send results to a file and the output that I am getting includes the query.
This is what I've done to send to a file.
SQL> SPOOL DEPARTMENT.CSV
SQL> SELECT DEPARTMENT_ID, LAST_NAME, SALARY
2 FROM EMP_DETAILS_VIEW
3 WHERE SALARY > 12000;
SQL> SPOOL OFF
This is how my file looks after I run this query.
SQL> SELECT DEPARTMENT_ID, LAST_NAME, SALARY
2 FROM EMP_DETAILS_VIEW
3 WHERE SALARY > 12000;
20Hartstein 13000
80Russell 14000
80Partners 13500
90De Haan 17000
90King 24000
90Kochhar 17000
SQL> SPOOL OFF
Can someone help me out? I don't understand why the query is appearing in the CSV file.
Thank you in advance.
what you can do is create a file abc.sql on your system with
spool 'C:\a.csv';
select * from emp;
spool off;
and call this file from caommand prompt
@C:/abc.sql;
Similar Messages
-
heyyall,
am trying to use the spool command to save a file from an output but i get the message:
SPOOL save.lis
SP2-0606: Cannot create SPOOL file save.lis
am using sql-plus 10.2.0.1.0
?No its not an advanced setup , its just i logged into database using putty, easy to use.
In Command Promt we use dir command to list the directories , in the same way in database ls list the subfolders/subdirectories and files present in the current directory.
I think you are using local database only right?.
Then go to command prompt (i.e., go to run and type cmd)
And from there i had done this scenario, please view it so that you can understand clearly
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Balaji K>dir
Volume in drive C has no label.
Volume Serial Number is 0282-81BD
Directory of C:\Users\Balaji K
03/27/2011 12:04 AM <DIR> .
03/27/2011 12:04 AM <DIR> ..
03/26/2011 03:04 AM <DIR> .VirtualBox
02/25/2011 04:57 PM <DIR> Contacts
03/26/2011 06:07 PM <DIR> Desktop
03/25/2011 06:00 PM <DIR> Documents
03/25/2011 08:44 PM <DIR> Downloads
03/04/2011 06:06 PM <DIR> Favorites
02/25/2011 04:57 PM <DIR> Links
02/25/2011 04:57 PM <DIR> Music
02/25/2011 04:57 PM <DIR> Pictures
02/25/2011 04:57 PM <DIR> Saved Games
02/25/2011 04:57 PM <DIR> Searches
03/26/2011 10:04 PM <DIR> Tracing
02/25/2011 04:57 PM <DIR> Videos
02/25/2011 06:07 PM <DIR> VirtualBox VMs
0 File(s) 0 bytes
16 Dir(s) 43,067,936,768 bytes free
C:\Users\Balaji K>sqlplus sys as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 27 00:04:44 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> spool example.txt
SQL> desc dba_users;
Name Null? Type
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
PASSWORD VARCHAR2(30)
ACCOUNT_STATUS NOT NULL VARCHAR2(32)
LOCK_DATE DATE
EXPIRY_DATE DATE
DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
CREATED NOT NULL DATE
PROFILE NOT NULL VARCHAR2(30)
INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
EXTERNAL_NAME VARCHAR2(4000)
SQL> select username from dba_users;
USERNAME
SYS
SYSTEM
ANONYMOUS
MDSYS
OUTLN
DIP
TSMSYS
FLOWS_FILES
CTXSYS
DBSNMP
FLOWS_020100
USERNAME
XDB
HR
13 rows selected.
SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Produ
ction
C:\Users\Balaji K>dir
Volume in drive C has no label.
Volume Serial Number is 0282-81BD
Directory of C:\Users\Balaji K
03/27/2011 12:04 AM <DIR> .
03/27/2011 12:04 AM <DIR> ..
03/26/2011 03:04 AM <DIR> .VirtualBox
02/25/2011 04:57 PM <DIR> Contacts
03/26/2011 06:07 PM <DIR> Desktop
03/25/2011 06:00 PM <DIR> Documents
03/25/2011 08:44 PM <DIR> Downloads
03/27/2011 12:05 AM 2,398 example.txt
03/04/2011 06:06 PM <DIR> Favorites
02/25/2011 04:57 PM <DIR> Links
02/25/2011 04:57 PM <DIR> Music
02/25/2011 04:57 PM <DIR> Pictures
02/25/2011 04:57 PM <DIR> Saved Games
02/25/2011 04:57 PM <DIR> Searches
03/26/2011 10:04 PM <DIR> Tracing
02/25/2011 04:57 PM <DIR> Videos
02/25/2011 06:07 PM <DIR> VirtualBox VMs
1 File(s) 2,398 bytes
16 Dir(s) 43,067,940,864 bytes free
C:\Users\Balaji K>
See now you can see the example.txt which we had spooled. Now if go with
C:\Users\Balaji K>edit example.txt command you can see that all the data is spooled into it.
And instead of exiting sqlplus, if you want to continue some other operations , then you can give spool off command .
sql> spool off.
Hope this helps you :)
Thanks,
Balaji K.
Edited by: balaji k on Mar 26, 2011 11:42 AM
Edited by: balaji k on Mar 26, 2011 11:43 AM -
Preserve a single space at the end of line using spool command
Hi,
Can you please help me to write the result of an sql query into a file with the last column of the row ending with a single space?
For example:
COL1DATA|COL2DATA|COL3DATA<space1>
As mentioned in the example the col3 value in the file should end with a single space. And there should not be any delimiters at the end of the row.
I tried with set trimspool on/off. But, it didn't work. When I say trimspool on - it is trimming all the trailing spaces.
When I say trimspool off - it is retaining all the trailing spaces to the size of the line.
But, I do not wish to modify the file through shell commands once it is written thru spool. I mean I do not wish to append spaces to the end of a line using shell script or any other method.
I do not wish to use other methods like UTL_FILE also.
Please help me how to do it using spool command?
Thank you.
RamanaMy requirement is that all the trailing spaces should be truncated except the last one in the row.Why?
As you have discovered a single column in sqlplus, is always a fixed length regardless of the size of the data, if the length of the data varies the output is padded to the maximum or line size with spaces. The trim and trimpsool commands are there to remove all the spaces from the end of a line if there are any. There are no commands to trim all the spaces except one, or even to trim all the spaces except two, or three even.
If you want such custom processing you should post process the file in the OS using sed, awk or perl or something designed for such things. -
Spool command in SQL Developer 3.1
Hi,
I am using sqldeveloper-3.1.05.97 .
There are few scripts that I need to run on a EBS sandbox to generate txt files for a analysis tool input .
The script is meant to be run with SQL * Plus but I am getiing a TNS listener error due to which I want to use SQL Developer.
The Spool command is able to create file in local directory but the oputput is not the query result but the query itself. Please help if anything is wrong in the syntax below:
ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';
SET NEWPAGE 0
SET SPACE 0
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET COLSEP |
SET MARKUP HTML OFF
SET LINESIZE 600
SPOOL FND_USER.txt
SELECT USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, START_DATE, END_DATE, DESCRIPTION, LAST_LOGON_DATE, PASSWORD_DATE, PASSWORD_ACCESSES_LEFT, PASSWORD_LIFESPAN_ACCESSES, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, CUSTOMER_ID, SUPPLIER_ID
FROM APPS.FND_USER;
SPOOL OFFHi Partha,
It seems the line "SET PAGESIZE 0" is suppressing all output in SQL Developer, and not just "all headings, page breaks, titles, the initial blank line, and other formatting information" as documented for SQL*Plus. Keep in mind that SQL Developer does not yet provide full support for all SQL*Plus formatting commands. For example, without SET PAGESIZE 0, the script output tab shows these messages:
line 2: SQLPLUS Command Skipped: set NEWPAGE 0
line 3: SQLPLUS Command Skipped: set SPACE 0
line 8: SQLPLUS Command Skipped: set MARKUP HTML OFF
I will log a bug for this.
Regards,
Gary
SQL Developer Team -
Spool Command with dbms_metadata.GET_DDL function
Hi All,
My requirement is before applying a patch on the Database Schema, I need to take a backup of the db objects DDL script, so that incase if I want to rollback I can use it. what I am trying to use is the dbms_metadata.GET_DDL function to get the DDL script and with the help of spool command store that in a text file.
The problem I am encountering is the whole script runs without an error but whne I check the spool file for certain big packages the DDL script is not fully exported. The below is the script that I make use of to generate the DDL script.
set heading off
set feedback off
set echo off
set term off
set newpage none
set space 0
set trimout on
set TRIMSPOOL ON
column c1 format a4000
set long 99999
set lines 1000
exec DBMS_METADATA.SET_TRANSFORM_PARAM (DBMS_METADATA.SESSION_TRANSFORM, 'PRETTY', true);
spool c:\Rollback.sql
select dbms_metadata.GET_DDL('FUNCTION',u.object_name) || '/' c1
from user_objects u
where object_type = 'FUNCTION'
and object_name in ('FN_CALCMASTERDATA_AGE','FUNC_ASSIGNBENEFITSNONFLEX','FUNC_CHECKNEWEMPLOYEE');
select dbms_metadata.GET_DDL('PACKAGE_SPEC',u.object_name) || '/' c1
from user_objects u
where object_type = 'PACKAGE'
and object_name in('PKGT_BEN_YEAR_DETL','PKGT_BENS_TEST');
select dbms_metadata.GET_DDL('PACKAGE_BODY',u.object_name) || '/' c1
from user_objects u
where object_type = 'PACKAGE'
and object_name in ('PKGT_BEN_YEAR_DETL','PKGT_BENS_TEST','PKGT_FLEX_INITIALIZATION','PKGT_EMP');
spool off
Note: Database Oracle 10 g,
Client Machine Windows XP from where the script is ran.
Is there any limitation in amount of data that can be spooled? or is there is any better way to accomplish this task, please help.
Thanks
Saamiset long longer ;-)
set long 1000000 longchunksize 1000000 linesize 32000 pagesize 0 -
How to Use SPOOL Command with Bind Variables
For the Following SPOOL I want the GEN_DATE to be entered by the User at the time of execution of the SQL Script. Is it possible in SPOOL Command.
set colsep , -- separate columns with a comma
set pagesize 1000 -- get rid of disturbing ---- between pages
set heading on -- Print column heading
set trimspool on -- remove trailing blanks. eliminating the spaces up to eol
set linesize 700 -- line size should be the sum of the column widths
spool spool_results.csv
SELECT *
FROM GUI_SITE_JOURNAL
WHERE GENDATE_ BETWEEN '2012-11-01 00:00:00:00000' AND '2012-11-02 00:00:00:00000'* ORDER BY GEN_DATE;
spool off;
The reason is to give the ability to user so that he can enter any range without modifying the code of the script.
Can Any one help me please.
Edited by: user10903866 on Feb 18, 2013 7:44 PMHi,
user10903866 wrote:
For the Following SPOOL I want the GEN_DATE to be entered by the User at the time of execution of the SQL Script. Is it possible in SPOOL Command.Do you want the user input in the SPOOL command, or do you want it in the query?
set colsep , -- separate columns with a comma
set pagesize 1000 -- get rid of disturbing ---- between pages
set heading on -- Print column heading
set trimspool on -- remove trailing blanks. eliminating the spaces up to eol
set linesize 700 -- line size should be the sum of the column widths
spool spool_results.csv
SELECT *
FROM GUI_SITE_JOURNAL
WHERE GENDATE_ BETWEEN '2012-11-01 00:00:00:00000' AND '2012-11-02 00:00:00:00000'* ORDER BY GEN_DATE;What is the data type oif gen_date?
If it's a string, that's a big mistake. Information about dates belongs in DATE columns.
If it's a DATE, then don't try to compare it to strings, such as '2012-11-01 00:00:00:00000' .
spool off;
The reason is to give the ability to user so that he can enter any range without modifying the code of the script.
Can Any one help me please.One way to do that is with substitution variables:
SET VERIFY OFF
ACCEPT start_gen_date PROMPT "Starting date (e.g., 2013-02-18 23:00:00.00000): "
ACCEPT end_gen_date PROMPT "Ending date (e.g., 2013-02-18 23:59:59.99999): "
SPOOL spool_results.csv
SELECT *
FROM gui_site_journal
WHERE gen_date BETWEEN '&start_gen_date'
AND '&end_gen_date'
ORDER BY gen_date;
SPOOL OFFThere are security considerations. Substitution variables give devious users the power to issue any SQL command, such as DROP TABLE. Users that have SQL*Plus access already have that power, anyway. -
How to write data to existing file using spool command?
Hi,
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
set serveroutput off
set feedback off
set term off
set echo off
variable out CLOB
define file='&1'
begin
pack.proc(:out);
end;
spool &file
select :out from dual;
spool offThis code writes contents of the OUT variable to file.txt, but my existing data ('hello') is lost. Please help me.
I figured the it...Use append in the spool command... :)
Edited by: Balaji on Jul 19, 2012 8:55 PM>
Hi Balaji
I figured the it...Use append in the spool command... :Please mark the thread as answered as per the FAQ.
Paul... -
hello;
we try this command in sql plus(ok)
spool c:\sample.dat
select * from employee;
spool off
my problem is this possible to include spool command in program units using
form builder.
PROCEDURE mis$atm_dat_creation IS
BEGIN
SPOOL C:\ETPS\PAYROLL.DAT;
SELECT '2146260011460000000'||company_name
||atm_account_number,
DECODE(LENGTH(salary),14,LPAD(salary,15,'0')
,13,LPAD(salary,15,'00')
,12,LPAD(salary,15,'000')
,11,LPAD(salary,15,'0000')
,10,LPAD(salary,15,'00000')
,9,LPAD(salary,15,'000000')
,8,LPAD(salary,15,'0000000')
,7,LPAD(salary,15,'00000000')
,6,LPAD(salary,15,'000000000')
,5,LPAD(salary,15,'0000000000')
,4,LPAD(salary,15,'00000000000')
,3,LPAD(salary,15,'000000000000')
,2,LPAD(salary,15,'0000000000000')
,1,LPAD(salary,15,'00000000000000')
,salary)||
'900003'||TO_CHAR(effectivity_date,'MMDDYYYY')
FROM atm_transactions;
SPOOL OFF;
SELECT SUM(SALARY)
FROM atm_transactions;
END;
pls helps....SPOOL is not a SQL statement or a PL/SQL command, it is a SQL*Plus environment command.
Using Oracle Developer, the most efficient way to produce file output is through Oracle Reports, not Forms.
Best! -
A question about the SPOOL command in sqlplus
Dear all,
I have a question about the SPOOL Command and I would appreciate if you could kindly give me a hand. Consider the following sql script.
SPOOL result.txt
SELECT * FROM mytable;
SPOOL OFF;This works pretty well, and the whole content of the table "mytable" is exported to the text file "result.txt". However, sqlplus prints also the number of lines
printed after each query. As a result, after running this script, at the end of the file, I have always a line like
"20541 lines returned"How can I avoid this line (the number of returned lines) in my result file?
Thanks in advance,
DariyooshPeter Gjelstrup wrote:
Hi Dariyoosh,
As you are about to find out, SQL*Plus is a really powerful tool once the wonders of it are discovered.
You really should study the reference
http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/toc.htm
In your current case especially the SET command
http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/ch_twelve040.htm#BACGAJIC
Regards
PeterHello there,
Thank you very much for your attention to my problem and in particular the interesting links.
Kind Regards,
Dariyoosh -
How i can Change Column width in Spool command
Hello Experts ,
coulmn name turnover has data type number(7) in oracle database
i want to change it to turnover number (4) in select query of spool command
because i want to create a flat file with width 4 to column turnover
please suggest me
Thanks
Kamal
Message was edited by:
user521387
Message was edited by:
user521387Did you try
set col turnover format 9999Another option is to convert the number into a string
select to_char(turnover, '9999')
from mytable;Message was edited by:
Jens Petersen -
Is it possible to automate the extraction using spool command?
Hi,
I am trying to export data from table to excel. But the result i am getting will be in million records. Till now i am manually extracting the data using plsql developer. but it is hampering my work alot when i am extracting.
i am able to extract the data using below spool command in sqlplus
set feed off markup html on spool on
spool 'd:\filename.xls'
select * from ca_trial_milestones;
spool off
set markup html off spool off
But is it possible to run it in sql/plsql developer and schedule it on night time.
U r replies will help me alot.
Thanks alot in advance981145 wrote:
Hi,
I am trying to export data from table to excel. But the result i am getting will be in million records. Till now i am manually extracting the data using plsql developer. but it is hampering my work alot when i am extracting.
i am able to extract the data using below spool command in sqlplus
set feed off markup html on spool on
spool 'd:\filename.xls'
select * from ca_trial_milestones;
spool off
set markup html off spool off
But is it possible to run it in sql/plsql developer and schedule it on night time.
U r replies will help me alot.
Thanks alot in advanceYou can create a batch file in window and then setting appropriate environment setting you can do
sqlplus user/pass@connect @scriptnamewhere scriptname is you above script.
You can then schedule this in windows schduler
However excel can not handle more than 1,048,576 rown as of version 2010
You can save the spool as html file and you will able to view the resultset. -
Hi,
Windows batch file is used to call the sql script.
SPOOL command is used to generate log file for that sql script, but log file path needs to be dynamic.
But how to dynamically supply specific directory path to that spool command ?scott@ORCL> SET TERMOUT OFF
scott@ORCL>
scott@ORCL> DEFINE dynamic_filename = idle
scott@ORCL> COLUMN which_dynamic NEW_VALUE dynamic_filename
scott@ORCL>
scott@ORCL> SELECT 'prefix_'
2 ||TO_CHAR( SYSDATE, 'YYYYMMDD' )
3 ||'_'
4 ||TO_CHAR( SYSDATE, 'HH24MISS' )
5 ||'.log' which_dynamic
6 FROM dual;
WHICH_DYNAMIC
prefix_20120309_125849.log
1 row selected.
scott@ORCL>
scott@ORCL> SET TERMOUT ON
scott@ORCL>
scott@ORCL> SPOOL &dynamic_filename
scott@ORCL>
scott@ORCL> SELECT * FROM dual;
D
X
1 row selected.
scott@ORCL>
scott@ORCL> SPOOL OFF
scott@ORCL> host notepad &dynamic_filename
scott@ORCL>Source:http://stackoverflow.com/questions/1524498/how-to-append-system-time-to-the-file-name-in-oracle
Regards
Girish Sharma -
Dear friends,
I am trying to get the list of active and inactive sessions for some users and created a script for this but getting some error message.
Could you please check why I am getting this error while running from the putty. The same sql command I run from sql developer and get the output with no errors.
Script:
set pagesize 0
set feedback off
set echo off
sqlplus '/as sysdba'
spool kill_session_list.sql;
select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';'
from v$session
where type!='BACKGROUND'
and username in('RO_USER','KHALIED','INFAREP','DAC','DMUSER_PROD','LAND_PROD','STAGE_PROD','BIUSER_PROD','OLAPDW','DWRO');
spool off;
exit
Error msg:
./kill_session_generate.sql: line 5: spool: command not found
./kill_session_generate.sql: line 6: syntax error near unexpected token `||'
./kill_session_generate.sql: line 6: `select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';''
Thanks.877938 wrote:
Dear friends,
I am trying to get the list of active and inactive sessions for some users and created a script for this but getting some error message.
./kill_session_generate.sql: line 5: spool: command not found
./kill_session_generate.sql: line 6: syntax error near unexpected token `||'
./kill_session_generate.sql: line 6: `select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';''Odd.
Look at the script kill_session_generate.sql very carefully, especially the lines before and after the SPOOL command as well as the spool command itself. Consider deleting and retyping the line with the SPOOL command in case invisible special characters are causing problems
Good luck! -
How to generate text file using spool command
How can I use a SPOOL command with DBMS_OUTPUT.PUT_LINE with PL/SQL to produce text file on oracle client machine.
You could try using a REF CURSOR as an alternative. Bare bones example listed below:
--- SQL Script
SET FEEDBACK OFF
COLUMN first_name FORMAT A25
COLUMN last_name FORMAT A25
VARIABLE example_data REFCURSOR
BEGIN
example.get_data(:example_data);
END;
SPOOL example_data.txt
PRINT example_data
SPOOL OFF
-----Output in example_data.txt
FIRST_NAME LAST_NAME
First Name 1 Last Name 1
First Name 2 Last Name 2
First Name 3 Last Name 3
First Name 4 Last Name 4
First Name 5 Last Name 5
First Name 6 Last Name 6
First Name 7 Last Name 7
First Name 8 Last Name 8
First Name 9 Last Name 9
First Name 10 Last Name 10
-----Example package used in SQL Script
CREATE OR REPLACE PACKAGE example
IS
TYPE result_set IS REF CURSOR;
PROCEDURE get_data
p_result_set OUT result_set
END;
SHOW ERRORS
CREATE OR REPLACE PACKAGE BODY example
IS
PROCEDURE get_data
p_result_set OUT result_set
IS
BEGIN
-- replace this with your query
OPEN p_result_set FOR
WITH fake_data AS (
SELECT
'First Name ' || level first_name,
'Last Name ' || level last_name
FROM DUAL
CONNECT BY LEVEL <= 10
SELECT *
FROM fake_data
END;
END;
SHOW ERRORS
SPOOL OFF -
Hi,
How do I run the oracle spool command through odbc?
If this is not possible, how do I export oracle data to a flat flie through odbc?
thanks
-bgcI'm not aware of a way to call the spool command directly. I assume that you can call spool from a stored procedure. If so, you could create a stored procedure that calls spool, then execute the stored procedure via ODBC.
Exporting data to a flat file isn't something ODBC was designed to do. Assuming you managed to spool a file, you'd still have to get it from the database machine to the client. If you wanted to do this via ODBC, you'd have to convert the file to a B/CLOB in the database and fetch that B/CLOB via the appropriate SQL statement. The client application could then write the data back out to a file...
I suspect that you're trying to do something that ODBC isn't particularly suited for. You may want to double-check your design.
Justin
Maybe you are looking for
-
Crashing on Macbook Pro 2011!
I have been crashing around 5 times a day whenever my Macbook pro is not plugged in, which means i cannot actually use it as a laptop. more like a desktop. Heres a crash report. EtreCheck version: 1.9.15 (52) Report generated 26 August 2014 17:54:27
-
Balance trasnfer from old spl G/L account to New spl G/L account
Hi, We need to transfer the balance from old spl G/L to new spl G/L, please note these spl G/L are mapped to Reconciliation accounts. What is best way or practice for doing this activity? we need to transfer balances of only spl G/L and not the recon
-
How do i create a revolving pic in PSE8 for mac?
I want to have a small gif of 3 pics that revolve every 1-2seconds. it would be 150x100 so pretty small. is there a way to do this in pse8 for mac? thanks in advance.
-
I wanted to change my password for logging in to my work email address. The site was not prompting me to change it automatically, so I manually removed it from the list in the TOOLS-SECURITY-OPTIONS page. Now this site won't retain any kind of entere
-
my client requirement in Stock transfer order same company code and plant to plant .wanted commercial invoice instead of proforma invoice .I have done all the settings but not able to find out the solution .systems says this document for billing.Plea