How to load the data from excel file into temprory table in Forms 11g?
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
Sachin
Declare
v_full_filename varchar2(500);
v_server_path varchar2(2000);
v_separator VARCHAR2(1);
v_filename VARCHAR2(400);
filename VARCHAR2 (100);
v_stop_load varchar2 (2000);
v_rec_error_log varchar2(4000);
v_error_log varchar2(4000);
ctr NUMBER (12);
cols NUMBER (2);
btn number;
RES BOOLEAN;
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
cellType ole2.OBJ_TYPE;
args ole2.obj_type;
PROCEDURE olearg
IS
args ole2.obj_type;
BEGIN
args := ole2.create_arglist;
ole2.add_arg (args, ctr);
ole2.add_arg (args, cols);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
END;
BEGIN
v_full_filename := client_get_file_name(directory_name => null
,file_name => null
,file_filter => 'Excel files (*.xls)|*.xls|'
||'Excel files (*.xlsx)|*.xlsx|'
,message => 'Choose Excel file'
,dialog_type => null
,select_file => null
If v_full_filename is not null Then
v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
v_filename := v_separator||v_full_filename ;
:LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);
RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));
--Begin load data from EXCEL
BEGIN
filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
application := ole2.create_obj ('Excel.Application');
ole2.set_property (application, 'Visible', 'false');
workbooks := ole2.get_obj_property (application, 'Workbooks');
args := ole2.create_arglist;
ole2.add_arg (args, filename); -- file path and name
workbook := ole2.get_obj_property(workbooks,'Open',args);
ole2.destroy_arglist (args);
args := ole2.create_arglist;
ole2.add_arg (args, 'Sheet1');
worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
ole2.destroy_arglist (args);
ctr := 2; --row number
cols := 1; -- column number
go_block('xxx');
FIRST_RECORD;
LOOP
--Column 1 VALUE --------------------------------------------------------------------
olearg;
v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
:item1 := v_stop_load;
cols := cols + 1;
--Column 2 VALUE --------------------------------------------------------------------
olearg;
:item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
cols := cols + 1;
--<and so on>
ole2.invoke (application, 'Quit');
ole2.RELEASE_OBJ (cell);
ole2.RELEASE_OBJ (worksheet);
ole2.RELEASE_OBJ (worksheets);
ole2.RELEASE_OBJ (workbook);
ole2.RELEASE_OBJ (workbooks);
ole2.RELEASE_OBJ (application);
END;
--End load data from EXCELPlease mark it as answered if you helped.
Similar Messages
-
How to load the data from excel file into table in oracle using UTL_FI
How to load the data from excel file into table in oracle
and from table to excel file
using UTL_FILE package
Please give me some exampleThis is something i tried in oracle apex
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Regards,
CKLP -
How to Load the data from excel file(Extension is .CSV) into the temp.table
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinHello Sachin,
You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
Instead of copy values into forms you can save them in your temporary table.
Kind regards,
Alex
If someone's helpful or correct please mark it accordingly. -
How to load the data from .csv file to oracle table???
Hi,
I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
Thanks in advance981145 wrote:
Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
the command is
sqlldrType it and see if you have it installed.
Have a look also at the FAQ link posted by Marwin.
There are plenty of examples also on the web.
Regards.
Al -
pls send ans for this
1b5595eb-fcfc-48cc-90d2-43ba913ea79f wrote:
pls send ans for this
use any text editor to eliminate the dot before loading -
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com -
How to transfer data from excel files into z-tables
Please help me with a code which transfers data from excel file to z-table.
Thanks in advance
ShuvirHi Daniel,
Export Data
Purpose
Use this procedure to export SAP data to a local file such as Microsoft Excel.
Menu Path
Use the following menu path to begin this process:
· SystemèListèSaveèLocal File
Helpful Hints
When reviewing fields, R = Required, O = Optional and C = Conditional.
Procedure
1. Start the transaction using the menu path or transaction code.
Whatever Data You Want to Export
2. Select SystemèListèSaveèLocal File. This works well for any data in SAP. This is the only option for the top-level (first page) of a report.
In a drill-down view within a report the Local File button on the toolbar may be used and has the same options.
Choose File Format
3. Click .
4. Click to continue. If prompted for a format after choosing Spreadsheet, select Excel Table to get an Excel file that can be modified more easily.
Choose File Save Location Step 1
5. Click to the right of the Directory field to choose a different location.
Choose File Save Location Step 2
6. Click or browse your computer to locate the directory where you want to save your file.
7. Complete the following field:
· File name:
You must add the proper file extension to the name of your file (.xls for Excel, .rtf for Rich Text, .html for HTML). The file extension tells your computer what program to open the file with. If you do not have the file extension at the end, you may not be able to open it.
8. Click to continue.
Generate File in Location and Format Selected
9. Click to create the file in the location and format selected. In this example the file was named "example.xls" and saved on the desktop.
Result
You have completed the export process.
thanks
karthik -
How to Display the content of Excel file into Webdynpro Table
Hi Experts
I am following the Blog to upload a file in to the webdynpro context,but my problem is after uploading a excel file i need to extract the content from that Excel file and that content should be displayed in the webdynpro table.Can any body please guide me how to read the content from excel and to Display in the Table.
Thanks and Regards
KalyanHI,
Take for example, if Excel file contains 4 fields,
Add jxl.jar to JavaBuild path and Use this snippet
File f=new File("sample.xls");
Workbook w=Workbook.getWorkbook(f);
Sheet sh=w.getSheet(0);
int cols=sh.getColumns();
int rows=sh.getRows();
Cell c=null;
String s1=null;
String s2=null;
String s3=null;
String s4=null;
ArrayList al=new ArrayList();
int j=0;
for(int i=1;i<rows;i++)
ITableElement table=wdContext.createTableElementz
s1=sh.getCell(0,i).getContents();
s2=sh.getCell(1,i).getContents();
s3=sh.getCell(2,i).getContents();
s4=sh.getCell(3,i).getContents();
table.setName(s1);
table.setAddress(s2);
table.setDesignation(s3);
table.setDummy(s4);
al.add(j,table);
j++;
wdContext.nodeTable().bind(al);
Regards
LakshmiNarayana -
How to load the data from flat file ( ex excel ) to Planning area directly
Hi all ,
How can i load thedata fro m flat file directly to Planning area .
PLease help me in this.
Regards,
Chandu .download one key figure data from planning book ( interactive damand plan) and made some changes and need to upload the data back to same planning book
But, may I know why you are thinking of downloading, changing and uploading for just changing the figures for a particular key figure. You can do it in the planning book itself.
However, not all the key-figures can be changed. But, what type of key-figure you are speaking here? Is it like 'Forecast' for which the value is based on other key-figures, or is like a key-figure where some manual adjustments are to be done--so that it can be manually edited? However, in both the cases, the data can be changed in the planning book only. In first case, you can change the values of dependant key-figures and in the second case, you can change the key-figures directly.
And please note that you can change the values of the key-figures only at the detailed level. So, after loading the data in the book, use drill-down option, maintain the data at the detailed level, change the figures, and automatically, this gets reflected at the higher level.
In case you are unable to change the values, go to the 'Design' mode of the book, right-click your key-figure, under "Selected Rows", uncheck "Output Only" option. In case you are unable to see that option, then you are not authorised to change that. See if you can change the authorisations by going to the "Data View" tab in planning book configuration (/n/sapapo/sdp8b), and change the value of Status to 3.
Hope your query is answered with different solutions offered by many of the sdn colleagues here.
Regards,
Guru Charan. -
How to read the data from excel file and store into the table?
Hi All,
I have table with BLOB datatype contains a excel file. I have to read that data from excel and store into one table with all the fields in excel.
All the excel fields and my table columns are same.
Can you share with me how can acheive this using LOB's?
ThanksHi OraSuirya,
you can try with external tables .
syntax as follows
create table ext_table_csv (
i Number,
n Varchar2(20),
m Varchar2(20)
organization external (
type oracle_loader
default directory ext_dir
access parameters (
records delimited by newline
fields terminated by ','
missing field values are null
location ('file.csv')
reject limit unlimited;
For this you need to create directory
Directory Creation syntax:
create or replace directory ext_dir as 'D:\oracle\user_dir\ext_dir';
grant read, write on directory ext_dir to <User>;
please paste the excel file in the particular directory .
I hope this will help you.
Please correct me if I am wrong anywhere .
Thanks,
Tippu. -
Load XML-data from large file into plain table
We have to load data from an XML file to a relational table row by row.
The structure of the data is very simple:
<ROOT>
<repReport>
<KNZ>XY</KNZ>
<LA>test123</LA>
<Ident>AA20</Ident>
</repReport>
<repReport>
</repReport>
</ROOT>.
The table econtains the fields KNZ, LA, Ident, ...
If the file is small the following PL/SQL-code works fine:
CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
fil BFILE ;
len INTEGER;
insrow INTEGER;
ctxHdl NUMBER;
buffer_c CLOB ;
amt NUMBER := dbms_lob.lobmaxsize;
src_offset NUMBER := 1 ;
dst_offset NUMBER := 1 ;
lang_ctx NUMBER := dbms_lob.default_lang_ctx;
warning NUMBER;
errNo NUMBER;
errMsg VARCHAR2(1999);
BEGIN
fil := BFILENAME('XML_DIR','200412MKBReport.xml');
DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
len := DBMS_LOB.GETLENGTH(fil);
INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
RETURNING init INTO buffer_c;
dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
dbms_xmlsave.SetBatchSize(ctxHdl , 1);
insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLCODE);
errMsg := SQLERRM;
DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
END;
But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
Does anybody have an example how to load this data that is as simple as our problem?We have to load data from an XML file to a relational table row by row.
The structure of the data is very simple:
<ROOT>
<repReport>
<KNZ>XY</KNZ>
<LA>test123</LA>
<Ident>AA20</Ident>
</repReport>
<repReport>
</repReport>
</ROOT>.
The table econtains the fields KNZ, LA, Ident, ...
If the file is small the following PL/SQL-code works fine:
CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
fil BFILE ;
len INTEGER;
insrow INTEGER;
ctxHdl NUMBER;
buffer_c CLOB ;
amt NUMBER := dbms_lob.lobmaxsize;
src_offset NUMBER := 1 ;
dst_offset NUMBER := 1 ;
lang_ctx NUMBER := dbms_lob.default_lang_ctx;
warning NUMBER;
errNo NUMBER;
errMsg VARCHAR2(1999);
BEGIN
fil := BFILENAME('XML_DIR','200412MKBReport.xml');
DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
len := DBMS_LOB.GETLENGTH(fil);
INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
RETURNING init INTO buffer_c;
dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
dbms_xmlsave.SetBatchSize(ctxHdl , 1);
insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLCODE);
errMsg := SQLERRM;
DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
END;
But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
Does anybody have an example how to load this data that is as simple as our problem? -
How to get the data from multiple tabes into single table
hi all,
here i am having 10 data base tables,how to get the data into a single table.
regards,
subba reddyhi,
non XI/PI related
Regards,
Michal Krawczyk -
How to pass parameters to the Control file while loading the data from flat file to staging table
Thanks in advance
Hi ,
LOADDATA statement is required at the beginning of the control file.
INFILE: INFILE keyword is used to specify location of the datafile or datafiles.
INFILE* specifies that the data is found in the control file and not in an external file. INFILE ‘$FILE’, can be used to send the filepath and filename as a parameter when registered as a concurrent program.
INFILE ‘/home/vision/kap/import2.csv’ specifies the filepath and the filename.
Hope this will help you...... -
How to load the data from flat file
Hi ,
Im new to Oracle 10g . I have to upload a flat flle(notepad with , as a seperator) to the table in the database,
can you please tell me how to do it ?
Thanks
viviHi vivi,
Sure, read about the wonderful SQL*LOADER. This tool's purpose is exactly that.
Here's a link: Tahiti start page. Just type in sql*loader and off you go.
Since you did not mention your database version, I could not put a better one.
Regards,
Guido -
How to upload the data from excel(3 tabs) file to sap environment
Hi all,
This is Mahesh.
how to upload the data from excel(3 tabs) file to sap environment (internal tables) while doing bdc.Hi,
The FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' makes it possible to load a worksheet into an internal table in ABAP.
However, if you want to get the data from several worksheets, I think you are stuck with OLE access to your Excel Workbook...
You can find a solution for 2 worksheets in this post :
TO UPLOAD DATA FROM 2 EXCEL SHEETS INTO TWO INTERNAL TABLES
I think you can easily modify it to handle any number of worksheets.
Hope it helps !
Best regards,
Guillaume
Maybe you are looking for
-
Can you set up an iTunes account w/out a credit card?
Ok, here's the deal... I'm buying a 10 year old an iPod Touch for Christmas. She needs to have her own iTunes account for purchasing stuff (apps, music, etc.) Is it possible to set up an iTunes account WITHOUT adding a credit card? I need her to ope
-
Disable Read-Only. How???
I called an Excel file from the File Browser. After making some modifications, when I tried to save it, it prompts me that my file is a 'READ-ONLY' and I must save-as under a different file name. How do i turn off the 'read-only'? I tried changing th
-
What sequence preset is the best for me?
Hey, i don't know what squence preset with is the best for me to get the best quality. I using "Fraps" to record stuff from my computer. I'm using a 42" LED Tv with the resolution: 1920x1080 . Also, i tried to use the DV - PAL sequence preset but the
-
July 2010 MacBook Screen Failure?
So, I know this is a hardware issue because sometimes if I hit the screen this transparent white bar goes away. It seems now that my hit workaround isn't working so hot anymore.. So is it the lcd itself, inverter board, logic board, etc?
-
Hello everyone! It's been i while since my last post, I wish I could be more active in this forums, but Flash it's just my sparetime activity, much like crosswords and since I'm bored here on vacation I decided to start a new simple project. I want t