Need help to upload Excel Chinese data into Oracle
Hello
I am very new at internationalization. We are writing an application that
reads Chinese data from a Microsoft Excel file and writes it out into Oracle
8i. This is what we have done:
1. Use JDBC-ODBC driver to read the Excel data directly from .xls.
2. Write data into oracle database.
When we open Excel, we can view the Chinese characters. When we use SQL
PLus, we see only ????. When we write another servlet to retrieve the data,
it is displayed as ????. The few questions I have are:
1. How can I verify that the Chinese data has been accurately inserted into
the database?
2. Do I need to set anything special (environment variables, config files
etc) in BEA Weblogic 5.1 and Oracle 8i?
The environment we have are:
1. BEA Weblogic SP9 running on WIn NT.
2. Oracle 8i running on Solaris.
Thanks
Make sure that the characters are correct in the app server after you get
them out of Oracle and before you put them into the web page. This will help
you determine if the problem is in the JDBC access to Oracle or the encoding
into the web page. Make sure that you verify that the hex values of each
character from the db test case are what you expect.
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"Bernard Ong" <[email protected]> wrote in message
news:[email protected]...
Hi Kev
1. "It doesn't work" means that I still see ??? in the database. WHen I
retrieve the data, it is still displayed as ??? in a browser.
2. Codeset to use to display should be UTF-8.
3. Charset in database server is UTF8. I did a "select * from
database_parameters" to get this value.
4. I copied the Chinese characters from Excel and pasted on Notepad. Icould
see the Chinese characters with the Chinese emulator turned on. WHen Icopy
??? from SQL*Plus and paste it into notepad, I see ???.
Presume:
1. Yes, running SQL*PLUS on BEA machine.
2. BEA machine running on WIndows 200 professional. We downloaded aChinese
emulator. WIndows 2000 is the English version.
Cheers
"Kevin Lu" <[email protected]> wrote in message
news:[email protected]...
Hi Bernard,
Please first clarify:-
1) "It doesn't work" means... cannot display the chinese character as
you
desired?
2) Which codeset that you want it to display, Chinese traditional big5?UTF-8,
i would think it's still in Java/JDBC codeset.
3) What's the charset in the database server? Get help from DBA if you
not
sure
how to obtain this information.
4) Try paste the result(select via SQL*Plus) onto Win Notepad, what's
the
outcome?
Presume:
1) you're running SQL*Plus on your BEA machine?
2) BEA machine is running on Chinese O/S or hv NJStar installed andrunning?
Let me know if i could be of further help.
-Kev
"Bernard Ong" <[email protected]> wrote:
Thanks Kev.
We had changed the registry in the BEA machine to
AMERICAN_AMERICA.UTF8.
THis was done for the Oracle registry in the BEA machine.
Unfortunately,
it
still doesn't work.
Cheers,
Bernard
"Kevin Lu" <[email protected]> wrote in message
news:[email protected]...
Hi Bernard,
I take about the same approach as you while resolving codeset
problem.
So,
first
i make sure SQL*Plus could display my desired result before proceedto
application(be
it Swing, servlet, JSP console etc..). You may try set the NLS_LANGon
your client
machine(same machine as where you run SQL*Plus) to the SAME as
database
server
character set, for instance America_American.US7ASCII. You should
able
to
see
the Chinese characters.
Hope this help with your first question. I can't help for the restanyway.
good luck!
-Kev
"Bernard Ong" <[email protected]> wrote:
Hello
I am very new at internationalization. We are writing an
application
that
reads Chinese data from a Microsoft Excel file and writes it outinto
Oracle
8i. This is what we have done:
1. Use JDBC-ODBC driver to read the Excel data directly from .xls.
2. Write data into oracle database.
When we open Excel, we can view the Chinese characters. When we useSQL
PLus, we see only ????. When we write another servlet to retrievethe
data,
it is displayed as ????. The few questions I have are:
1. How can I verify that the Chinese data has been accurately
inserted
into
the database?
2. Do I need to set anything special (environment variables, configfiles
etc) in BEA Weblogic 5.1 and Oracle 8i?
The environment we have are:
1. BEA Weblogic SP9 running on WIn NT.
2. Oracle 8i running on Solaris.
Thanks
Similar Messages
-
Uploading Excel sheet data into internal table
Hi All,
I want to upload Excel file data into internal table. My problem is that my excel file having more than one sheets. I want to upload the data of particula Excel sheet..
Please suggest me how can I upload particulat Excel sheet data .
Thanks and regards
Praveencheck this link
Uploading multiple excel sheets
You can check Satish's answer in the above link
Re: uploading data from excel sheets through BDC's into sap system
<b>Award points if found helpful</b> -
Error in uploading excel sheet data into internal table
Dear all,
i am facing problem when uploading data from excel. i used KD_GET_FILENAME_ON_F4.i select the file and pass on to ALSM_EXCEL_INTO_INTERNAL_TABLE.and i get the ERROR....
Illegal type when transferring an internal table to a FORM. this is my code .
types : begin of ty_mm01,
matnr like rmmg1-matnr,
mbrsh like rmmg1-mbrsh,
mtart like rmmg1-mtart,
maktx like makt-maktx,
meins like mara-meins,
matkl like mara-matkl,
bismt like mara-bismt,
spart like mara-spart,
mtpos like mara-mtpos_mara,
end of ty_mm01.
data : tt_mm01 type standard table of ty_mm01,
wa_mm01 like TT_MM01.
data : t_bdcdata like standard table of bdcdata,
t_bdcmsgcoll like standard table of bdcmsgcoll.
constants: begcol TYPE i value 1 ,
begrow TYPE i value 1,
endcol TYPE i value 100,
endrow TYPE i value 32000.
selection-screen : begin of block bdc with frame.
parameter : tfile like rlgrap-filename obligatory.
selection-screen : end of block bdc.
at selection-screen on value-request for tfile.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = 'ZMM_MAT_MAS_BASIC_DATA'
DYNPRO_NUMBER = '1000'
FIELD_NAME = 'TFILE'
STATIC = 'X'
MASK = ',*.xls,'
CHANGING
FILE_NAME = tfile
start-of-selection.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = tfile
I_BEGIN_COL = begcol
I_BEGIN_ROW = begrow
I_END_COL = endcol
I_END_ROW = endrow
TABLES
INTERN = tt_mm01
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks in advanceHi,
Check these FM : KCD_EXCEL_OLE_TO_INT_CONVERT
Report ZPSP_TEST.
data: bdc_DATA like bdcdata occurs 0 with header line,
mess_tab like bdcmsgcoll occurs 0 with header line.
DATA: BEGIN OF ITAB OCCURS 0 ,
tcnt TYPE i, "Table Counter &H0D
WERKS LIKE T001W-WERKS,
BNFPO LIKE EBAN-BNFPO,
MATNR LIKE MARA-MATNR,
MENGE LIKE EBAN-MENGE,
END OF ITAB.
start-of-selection.
PERFORM upload_data.
loop at itab.
perform bdc_dynpro using 'SAPMM06B' '0100'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BSART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-BSART'
'NB'.
perform bdc_field using 'RM06B-LPEIN'
'T'.
perform bdc_field using 'EBAN-WERKS'
ITAB-WERKS.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-EKGRP'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM06B-BNFPO'
ITAB-BNFPO.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-MATNR(01)'
ITAB-MATNR.
perform bdc_field using 'EBAN-MENGE(01)'
ITAB-MENGE.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_010.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_011.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_012.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_013.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_014.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_015.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_016.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_017.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_018.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-BNFPO'
record-BNFPO_019.
*perform bdc_field using 'EBAN-MATNR(02)'
record-MATNR_02_020.
*perform bdc_field using 'EBAN-MENGE(02)'
record-MENGE_02_021.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'EBAN-MENGE'
ITAB-MENGE_023.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_024.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_025.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_026.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_027.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_028.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_029.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_030.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_031.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_032.
perform bdc_field using 'EBAN-TXZ01'
'BEARING 2"X2"'.
perform bdc_field using 'EBAN-MENGE'
'65'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 1,120.00'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-TXZ01'
'DRILLING PIPE 10"'.
perform bdc_field using 'EBAN-MENGE'
'75'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 0.53'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-BNFPO'
perform bdc_field using 'BDC_OKCODE'
'&H3DBU'.
*perform bdc_field using 'RM06B-BNFPO'
CALL TRANSACTION 'ME51' USING BDC_DATA MODE 'A'.
endLOOP.
FORM upload_data.
*local variable declaration
DATA : lv_index TYPE i,
l_count TYPE i.
*local constants declaration
CONSTANTS:
lc_start_col TYPE i VALUE '1' ,
lc_start_row TYPE i VALUE '2' ,
lc_end_col TYPE i VALUE '256' ,
lc_end_row TYPE i VALUE '65536'.
*local field symbol declaration
FIELD-SYMBOLS : <lf_s>.
*loacal internal table declaration
DATA : li_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
*refresh internal table for each loop
CLEAR: li_intern,
l_count .
REFRESH li_intern.
to upload the data in excel on the presentation server this function
module converts the data from excel file into an internal table
containing row no col no and value
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename &H3D 'Give file location here'
i_begin_col &H3D lc_start_col
i_begin_row &H3D lc_start_row
i_end_col &H3D lc_end_col
i_end_row &H3D lc_end_row
TABLES
intern &H3D li_intern
EXCEPTIONS
inconsistent_parameters &H3D 1
upload_ole &H3D 2.
checking for data in internal table
CHECK NOT li_intern[] IS INITIAL.
sorting internal table
SORT li_intern BY row col.
collecting data into an internal table
LOOP AT li_intern.
MOVE: li_intern-col TO lv_index.
lv_index &H3D lv_index + 1.
ASSIGN COMPONENT lv_index OF STRUCTURE itab TO <lf_s>.
MOVE : li_intern-value TO <lf_s>.
AT END OF row.
l_count &H3D l_count + 1.
itab &H3D l_count.
APPEND itab.
ENDAT. " at end of row
ENDLOOP. " loop at li_intern
Reg,
Siva
Edited by: Siva Prasad on Jun 1, 2009 8:41 AM
Edited by: Siva Prasad on Jun 1, 2009 4:25 PM -
Import Excel File Data into oracle database table.
HI,
i want to insert data into a specific table from a excel file. please help me..
for example
emp.xls file's data need to be import in emp database table.
thanks in advance...Hi,
to all knowledgable person, this would be gald for u all that i have solved the problem.
through this procedure..
PROCEDURE IMPORT_FROM_EXCEL_PROC (as_FileName VARCHAR2, exe_name varchar2) IS
appid PLS_INTEGER;
convid PLS_INTEGER;
docid PLS_INTEGER;
conv_established BOOLEAN := FALSE;
buffer VARCHAR2(100);
Emp_code VARCHAR2(100);
Emp_name VARCHAR2(100);
Emp_desig VARCHAR2(100);
Emp_Salary VARCHAR2(100);
ls_error VARCHAR2(1000);
li_row integer;
li_col integer;
li_error_count integer;
li_load_count integer;
BEGIN
--Start Excel
--This line assumes that Excel is in the specified directory
-- APPID := DDE.APP_BEGIN('D:\OFFICE11\EXCEL.EXE',DDE.APP_MODE_MINIMIZED);
APPID := DDE.APP_BEGIN(exe_name,DDE.APP_MODE_MINIMIZED);
--Establish a conversation with Excel
--The following loop will not end until a conversation with Excel
--has been established. Therefore, it can result in a endless loop,
--so use with caution.
WHILE NOT conv_established LOOP
BEGIN
convid := DDE.INITIATE('excel', 'system');
conv_established := TRUE;
EXCEPTION
WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
conv_established := FALSE;
END;
END LOOP;
--Open Excel document
--This assumes that you have an Excel spreadsheet named ddetest.xls in the root of c:
DDE.EXECUTE(convid, '[Open("'||as_FileName||'")]', 10000);
--Initiate conversation with Excel document
docid := DDE.INITIATE('excel',as_FileName);
--Begin transfer from Excel to Forms
li_load_count := 0;
li_error_count := 0;
li_col := 1;
li_row := 2;
GO_BLOCK('IMPORT_XLS');
DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);
WHILE length(buffer) > 2 LOOP
WHILE li_col < 5 LOOP
buffer := substr(buffer, 1, instr(buffer, chr(10)) - 2);
IF li_col = 1 THEN --Emp_code
Emp_code := buffer;
ELSIF li_col = 2 THEN --Emp_name
Emp_name := buffer;
ELSIF li_col = 3 THEN --Emp_desig
Emp_desig := buffer;
ELSE --Emp_salary
Emp_salary := buffer;
END IF;
IF nvl(ls_error,'N') = 'N' THEN
li_col := li_col + 1;
DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);
ELSE
li_col := 5;
END IF;
END LOOP;
IF nvl(ls_error, 'N') = 'N' THEN
li_load_count := li_load_count + 1;
IF li_load_count = 1 THEN
FIRST_RECORD;
ELSE
NEXT_RECORD;
END IF;
:IMPORT_XLS.Emp_code := Emp_code;
:IMPORT_XLS.Emp_name := Emp_name;
:IMPORT_XLS.Emp_desig := Emp_desig;
:IMPORT_XLS.Emp_salary := Emp_salary;
ELSE
li_error_count := li_error_count + 1;
DDE.POKE(docid, 'R' || TO_CHAR(li_row) || 'C5', ls_error, DDE.CF_TEXT, 10000);
END IF;
ls_error := '';
Emp_code := '';
Emp_name := '';
Emp_desig := '';
Emp_salary := '';
li_col := 1;
li_row := li_row + 1;
DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);
END LOOP;
IF li_error_count > 0 THEN
DDE.EXECUTE(convid, '[[save]]', 10000);
Message(TO_CHAR(li_load_count) || ' Record(s) Loaded. ' ||
TO_CHAR(li_error_count) || ' Invalid Record(s). See error in excel file.');
ELSE
Message(TO_CHAR(li_load_count) || ' Record(s) Successfully Loaded.');
END IF;
--End transfer to Excel
DDE.TERMINATE(docid);
DDE.TERMINATE(convid);
DDE.APP_END(appid);
--Handle exceptions
EXCEPTION
WHEN DDE.DDE_APP_FAILURE THEN
MESSAGE('WINDOWS APPLICATION CANNOT START.');
WHEN DDE.DDE_PARAM_ERR THEN
MESSAGE('A NULL VALUE WAS PASSED TO DDE');
WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');
WHEN DDE.DMLERR_NOTPROCESSED THEN
MESSAGE('A TRANSACTION FAILED');
END; -
What is the function module which uploads excel file data into tcodes
Hi,
i want to upload data in cs01 tcode.
but data is excel sheet while i am trying to use gui_upload it is not being possible for me to upload data.
can any one tell me what is the function module?
can any send me the steps how to uplaod data if it is in excelsheet?
thanks & regards
naveen
Moderator message: FAQ, please search for available information before asking.
locked by: Thomas Zloch on Aug 18, 2010 1:46 PMHi,
Try the below sample code u ll get an idea of uploading using 'TEXT_CONVERT_XLS_TO_SAP'.
REPORT zupload_excel_to_itab.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
Thanks & Regrads,
Neela. -
Need help on interface to store images into oracle database using forms 6i
i am using forms 6i and oracle 8i. i am able to store .jpg and other picture files into data base.now my problem is how show and store the CAD/CAM drawings using forms. can any one help me please. is higher version is providing any new facility for this purpose?
thank youthanks for your help.
i am using client/server based application and cad/cam software was also installed on it. helper application means, the cad/cam software should provide some controls to view the drawings in other applications? am i correct. -
Regarding loading of excel data into oracle database
hello,
Can someone help me in knowing that how can we load excel sheets data into oracle database.
I will be really thankful to you.
GursimranHi,
There is tool given by oracle "Oracle Bulk Loader "
you can use this.
But in order use this you need a control file, which specifies how data should be loaded into the database; and a data file, which specifies what data should be loaded.
Example :- this is the control file which has information how the data is processed.
LOAD DATA
INFILE test.dat
INTO TABLE test
FIELDS TERMINATED BY '|'
(i, s)
Example :- test.dat which is the data file or say your excel sheet or document
(1, 'foo')
(2, 'bar')
(3, ' baz')
example of Loading :-
sqlldr <yourName> control=<ctlFile> log=<logFile> bad=<badFile>
sqlldr testing control=test.ctl log=test.log
Thanks
Pavan Kumar N -
Uploading an excel sheet data using Oracle APEX 3.2
Hi All,
Please help me out to upload excel sheet data using oracle APEX 3.2.
Am following the steps mentioned in the below link, but even after that am getting an error saying no data found
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Please help me to proceed further.
Regards,
SakthiHi Andy,
Thank you very much for looking into my thread.
Actually i followed everything that is been mentioned in "http://avdeo.com/2008/05/21/uploading-excel-sheet- using-oracle-application-express-apex/" and i got a successful result.
But, with the above process I can only upload a .csv format excel and not a .xls format excel file.
Thats where i got stucked and unable to find any clue on how to move further to achieve in uploading .xls file.
It would be very great if you guide me through in this process.
Shiva -
Upload excel sheet data through sqlloader into oracle tables
hi everyone,
i am working with excel sheet with following records
8501 Jacob Marshall 15000 21/10/2009 Finance
8502 Chris Campell 50000 13/06/2008 R&D
8503 Simon Dough 50000 3/07/2008 Engineering
8504 Mark Haggai 75000 9/3/2006 Product Management
8505 Verica Beverley 45000 7/2/2008 HR
and i saved it in emp_details.csv
after that when i write following code to make control file
load data
infile 'C:\Documents and Settings\prashant_dabral\Desktop\a.txt'
into table tmp
field terminated by','optionally enclosed by" "
(emp_no,emp_name,salary,doj,dept_name)
after this pl\sqldev returning me error message that ORA-00900:invalid sql statement
can anybody tell me how to resolve issue
or
another method to Upload excel sheet data through sqlloader into oracle tablesA control file is a file located on the operating system, not some SQL or PL/SQL code you try and execute.
Create the control file as a file and then use that to load your data with SQL*Loader from the command line.
http://www.morganslibrary.org/reference/sqlloader.html
Or better still, create it as an external table and then you don't need a seperate control file or need to use sql loader from the command line...
http://www.morganslibrary.org/reference/externaltab.html -
Read data from Excel and write into oracle database
Hi
I want to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
Thanks and Regards
NeetaHai,
I am suggesting the solution.
I will try out and let u know soon.
Make a coma separated file from your excel file.
Assuming that your requirement allows to make a csv file.
This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
You do not want to go via sql Loader?
For reading the excel file itself do you want java? -
How to insert chinese data into MS SQL Server 2000 through JDBC
I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
can anybody help me.
thanx.I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
can anybody help me.
thanx. -
Need help in laoding flat file data, which has \r at the end of a string
Hi There,
Need help in loading flat file data, which has \r at the end of a string.
I have a flat file with three columns. In the data, at the end of second column it has \r. So because of this the control is going to the beginning of next line. And the rest of the line is loading into the next line.
Can someone pls help me to remove escape character \r from the data?
thanks,
ragHave you looked into the sed linux command? here are some details:
When working with txt files or with the shell in general it is sometimes necessary to replace certain chars in existing files. In that cases sed can come in handy:
1 sed -i 's/foo/bar/g' FILENAME
The -i option makes sure that the changes are saved in the new file – in case you are not sure that sed will work as you expect it you should use it without the option but provide an output filename. The s is for search, the foo is the pattern you are searching the file for, bar is the replacement string and the g flag makes sure that all hits on each line are replaced, not just the first one.
If you have to replace special characters like a dot or a comma, they have to be entered with a backslash to make clear that you mean the chars, not some control command:
1 sed -i 's/./,/g' *txt
Sed should be available on every standard installation of any distribution. At lesat on Fedora it is even required by core system parts like udev.
If this helps, mark as correct or helpful. -
Want to load excel data into oracle table with out changing it to CSV
Hello all,
I have a requirement in dumping excel data into oracle database table without changing it to CSV file and this has to be used in normal sql/plsql environment i.e., pkg/procedure cant be used in the forms also...
so, can u guys can help me out in this
thanks.............The link Pavan provided discusses Oracle Heterogeneous Services. This allows you (using ODBC) to create a database link from Oracle to a non-Oracle data source like Excel. This would allow you to query the Excel data source from SQL*Plus or any other client tool. But that is probably going to require that your Oracle database is running on Windows since I'm not aware of any Excel ODBC drivers for Unix.
Another potential option would be to write a Java stored procedure that parsed the file. There are a few different Java libraries that can read and write Excel data files. You could load one of those libraries into the database's JVM and then write Java code that parsed the file. You would then be able to call your Java stored procedure from PL/SQL.
Justin -
Importing excel data into oracle tables
Hello gurus,
Importing excel data into oracle tables..
I know this is the most common question on the thread ...First, i searched the forum, i found bunch of threads with loading data using sqlloader, converting excel into .Txt, tab delimited file, .csv file etc....
Finally i was totally confused in terms how to get this done....
Here is wat i have
- Excel file on local computer.
- i have laod data into dev environment tables(So no risk involved, but want to try something simple)
- Oracle version 11.1.0.7
- Sqlplus and toad (editors)
Here is wat i like to do ....i dont know if its possible
- Without going to unix server can i do everthing on local system by making use of oracle db and sqlplus or toad
SQLLOADER might be one option...but i dont want to go the unix server for placing files and logs and stuff.
Wat will be best and simplest option to do?? and wat format will best to convert from excel into csv, or txt or tab delimited etc.....
If you suggest sqlloader, any code example will be greatly appriciated.
Thank you so much!!!Hi,
user642297 wrote:
Imran,
This is increadible option in toad!!! It works absolutely sweet!! I have toad 9.7 version. IT works great. Thank you so much!!You are welcome :)
Well i have further discussion on this ....this option is great if you doing in staging or development area. What if your doing in prod?? If you automating the sqlloader then how do u do it?? I think we still need to stick with traditional approach of laoding data by making use of SQLLoader right ?? If m wrong please correct me.well, in our case, we do have access to a custom schema in prod where we create the staging table and load the data from datafiles.
try this:
load data
infile 'C:\dest.csv'
into table dest_table
fields terminated by "~" optionally enclosed by '"'
TRAILING NULLCOLS
(name,
owner_nm,
description_column,
UPDT_DT DATE 'MM/DD/YYYY')
{code}
you can get more info about sql loader and your error here:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch05.htm
http://www.allinterview.com/showanswers/53766.html
And one more quick question ...i found an example of control file , in that i see .dat format file. Is it a data file ?? can i try that option ?? But in excel i didnt see to convert the .dat format file.
Any thoughts ???
It is same as a delimiter text file.
steps to create a .dat file (from a excel file):
1. Insert a column between two columns and populate it with the delimiter (in our case, it is ~)
2. Save the file as unicode text.
3. Open the file in text editor and remove all the tabs (find an replace with blank)
4. Save the file as "DEST.dat". Select encoding as UTF-8 while saving.
5. Your .dat file is ready.
Regards
Imran
Edited by: Imran Soudagar on Apr 22, 2010 10:22 PM -
Problems with special characters uploading data into oracle database
Greetings
I have a problem uploading data into oracle tables from sybase datasource. The data that I want to upload is in Spanish, for example when I have a varchar field with the data 'Consultoría', in oracle table the data upload with interrogation symbols.
I have my source and target datastores configured as follows.
Any suggestion? Thank you for your timeChack section 10 Locales and Multi-byte Functionality in the SAP Data Services Reference Guide for an exhaustive description of NLS settings.
As a summary, following settings are required:
locales in the datastore definitions match the actual locale used in the associated databases
the locale of the DS engine allows for source to target translation
the character set in the target database supports storage of accented characters
Maybe you are looking for
-
Stuck at Logging in to MobileMe window
I made my website in iWeb and alerted my domain subscriber to make web.me my alias. Now I'm trying to publish to MobileMe. I get the "Logging in to MobileMe" window, which looks like it's trying to connect, but it never connects... or stops until I f
-
How can i get iphoto to show the albums i have so i can download just one album
I recently have gotten a macbook and i need to free up some space on my iphone. I have an album that i would like to import without importing my camera roll. How do i do that?
-
I have a lot of old (from 1988 onwards) analog Video 8 tapes. The old Panasonic stopped functioning for a long time now, but I found a company that will digitize the footage. Because I want to edit it all in Prel, the format is going to be DV-AVI. No
-
Hi, I have a Web application (SEM-BPS 3.2) with a menu and some links with several web applications. Is there a way by clicking a link to close the current application and release lock ? I tried with target = _parent but locks are not released. Thank
-
APO-DP : Change in Fiscal Year Variant for the year 2008
As per earlier Fiscal Year variant configuration, the data has been forecasted in APO system till the end of Year 2008. But recently the fiscal year variant configuration modified in R/3 which has been impacting APO-DP storage buckets which are not m