How to import data from CSV file into a table by using oracle forms
Hi,
I have a CSV file and i want to insert in oracle database in a table by using a button in oracle forms.
the user can select CSV file by using open dialog .
can any one help me to find method to make import and select file from the client machine ?
thx.
1. create table blob
CREATE TABLE IB_LOVE
DOC BLOB,
CONTRACT_NO VARCHAR2(20 BYTE) NOT NULL
)2. use the code below to insert:
INSERT INTO ordmgmt.ib_love
(contract_no, doc
VALUES (:control.contract_no_input, NULL
lb$result :=
webutil_file_transfer.client_to_db (:b2.file_name, v_file_blob_name, v_col_blob_name,
'CONTRACT_NO = ' || :control.contract_no_input);
:SYSTEM.message_level := 25;
COMMIT;
:SYSTEM.message_level := 0;3. use the code below to download
if :control.CONTRACT_NO_INPUT is not null then
vboolean := webutil_file_transfer.DB_To_Client_With_Progress(
vfilename, --filename
'IB_LOVE', ---table of Blob item
'DOC', --Blob column name
'CONTRACT_NO = ' || :CONTROL.CONTRACT_NO_INPUT, ---where clause to retrieve the record
'Downloading from Database', --Progress Bar title
'Wait to Complete'); --Progress bar subtitle client_host('cmd /c start '||vfilename);
client_host('cmd /c start '||vfilename);
else
errmsg('Please choose contract no');
end if;4. use the code below to open file dialog
x:= WEBUTIL_FILE.FILE_OPEN_DIALOG ( 'c:\', '*.gif', '|*.gif|*.gif|', 'My Open Window' ) ;
:b2.FILE_NAME:=X;
Similar Messages
-
Loading data from .csv file into existing table
Hi,
I have taken a look at several threads which talk about loading data from .csv file into existing /new table. Also checked out Vikas's application regarding the same. I am trying to explain my requirement with an example.
I have a .csv file and I want the data to be loaded into an existing table. The timesheet table columns are -
timesheet_entry_id,time_worked,timesheet_date,project_key .
The csv columns are :
project,utilization,project_key,timesheet_category,employee,timesheet_date , hours_worked etc.
What I needed to know is that before the csv data is loaded into the timesheet table is there any way of validating the project key ( which is the primary key of the projects table) with the projects table . I need to perform similar validations with other columns like customer_id from customers table. Basically the loading should be done after validating if the data exists in the parent table. Has anyone done this kind of loading through the APEX utility-data load.Or is there another method of accomplishing the same.
Does Vikas's application do what the utility does ( i am assuming that the code being from 2005 the utility was not incorporated in APEX at that time). Any helpful advise is greatly appreciated.
Thanks,
AnjaliHi Anjali,
Take a look at these threads which might outline different ways to do it -
File Browse, File Upload
Loading CSV file using external table
Loading a CSV file into a table
you can create hidden items in the page to validate previous records before insert data.
Hope this helps,
M Tajuddin
http://tajuddin.whitepagesbd.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 import data from CSV file with columns separated by semicolon?
I migrate database from MS SQL 2008 to ORACLE 11g
I export data to CSV file from MS SQL
then I try to import it to Oracle
several tables goes fine using Import data option in the SQL Developer
Standard CSV files with data separated by comma were imported.
chars, date (with format string), and integer data are imported via import wizard without problems
the problems were when I try to import table with noninteger numbers with modal part separated by comma not by dot
comma is the standard separator for columns in CSV file
so I must change the standard separator to semicolon
then the import wizard have problem to correct recognize the columns data because it use only standard CSV comma separator :-/
In SQL Developer 1.5.3 Tools -> Preferences -> Migration -> Data Move Options
I change "End of Column Delimiter" to ; but it doens't work
Is this possible to change the standard column separator for import data wizzard in SQL Developer 1.5.3?
Or maybe someone know how to import data in SQL Developer 1.5.3 from CSV when CSV colunn separator is set to semicolon?A new preference has been added to customize the import delimiter in main code line. This should be available as part of future release.
-
How to import data from CSV files to OIM?
Hello,
We have to import some of the files which are in csv format and are placed in a specific folder hierarchy. Please help as i am not able to proceed further.
Thanks a lot!To write custom scheduler tasks you need to write a class which extends SchedulerBaseTask class.
See this link. Re: Custom reconcilation
Also GTC flat file retrieves data from file and creates identity/account in OIM. You can use either ways to meet your requirements. -
How to import data from CSV to TCode COR6N
Hi friends,
Please help me. I don't know how to import data from CSV file to TCode COR6N. (time ticket for production order)
I used function: BAPI_PRODORDCONF_CREATE_TT to fill information into TCode COR6n, but it thrown error: "Orders of the order type ZP01 cannot be confirmed". ZP01 is my Order Type.
Thanks in advance.
Nguyen Phuoc Toan.You can use the LSMW tool to do this.
The details of LSMW BAPI method is as follows :-
Business Object:- BUS2116
Method:-CREATEPREDEFTIMETICKETMULTIPLE
Message Type:- PPCC2PRETTICKET
Basic Type:- PPCC2PRETTICKET01
Regards
Dhirendra -
How to import data from CSV to TCode COR1?
Hi SAP PP guru,
How to import data from CSV file to TCode COR1?
Thanks in advance,
Nguyen Phuoc Toan.Nguyen,
You have not yet confirmed what your requirement is?
You can take the help of ABAP person to understand what BDC or LSMW is about, basically this is a tool provided by SAP that would enable you to record a transaction process and you can use the code to perform the transaction in mass. [Help on LSMW|http://help.sap.com/erp2005_ehp_04/helpdata/EN/ad/2d54a41d7011d2b42e006094b944c8/content.htm]
Regards,
Prasobh -
Help Me... How to get Data from CSV File...?
Hi Everyone..!
This is yajiv and am working in CS3 Photoshop platform. I know about Java Script. Is it possible to get the data from CSV files. Actually our client use to send us the CSV files which contains a lot of swatch name and reference files in one particular image name.
Actually how we work on that CSV file is, first we copy file name to search that CSV file. then get the result to paste into layer name. This process continue till the end of swatch.
Thank in Advance
-yajiv> Is it possible to get the data from CSV files.
Have you tried searching this forum? -
Loading data from .csv file into Oracle Table
Hi,
I have a requirement where I need to populate data from .csv file into oracle table.
Is there any mechanism so that i can follow the same?
Any help will be fruitful.
Thanks and regardsYou can use Sql Loader or External tables for your requirement
Missed Karthick's post ...alredy there :)
Edited by: Rajneesh Kumar on Dec 4, 2008 10:54 AM -
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,
SachinDeclare
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. -
Import data from a file into oracle db
Hello!
The problem is the following: data within a file must be placed
into several tables in a oracle server. For that a program has
to be written. It4s not done with executing a program cause the
data in the file can vary and depending on different flags the
import into oracle must be done. Now we tried the classes of
oo4o to access the db, but this only works for integer values,
the samples from oracle also only work for integer. We don4t
need to use oo40, is there a better / other way to write the
programm ? Has anybody a free sample ?
Thanxur problem is to import the data from file with different conditions which needs to be taken care programitically
Pls mail me your file and ur logic
my id is [email protected] -
Script to import contacts from CSV file into Address Book
Hi,
I am wondering if it would be possible to import contacts from a CSV file into a group in Address Book using applescript, and if so, if anyone is aware of a script that does this or something similar.
I have a CSV file with three columns 'First Name', 'Last Name' and 'Email Address'. I would like these to correspond with 'First', 'Last' and (Work) 'Email' in Address Book.
Ideally the script would also check to see if entries already exist for the people being imported, but this is less crucial.
Thanks in advance for any assistance,
NickHi,
Test this on a very small csv file (four or five contacts) to see if it works for you. It will not de-duplicate. You don't give the name of the group, so you'll need to replace Name of group in the second line with your group name, enclosed in double quotes.
--begin script
set the_people to read (choose file with prompt "Choose your CSV file")
set the_group to "Name of group"
set old_tids to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set par_count to (count paragraphs in the_people)
repeat with x from 1 to par_count
set next_par to paragraph x of the_people
set first_name to text item 1 of next_par
set last_name to text item 2 of next_par
set e_mail to text item 3 of next_par
tell application "Address Book"
set nu_person to make new person with properties {first name:first_name, last name:last_name}
make new email at end of emails of nu_person with properties {label:"Work", value:e_mail}
add nu_person to group the_group
save
end tell
end repeat
set AppleScript's text item delimiters to old_tids
--end script
Watch out for bad line breaks in the lines beginning "set nu_person..." and "make new email..." -
Upload data from flat file into internal table
Hi friends,
I want to upload the data from a flat file into internal table , but the problem is that all the columns in that flat file are seperated by "|" character instead of tabs.
Plz help me out.........HEllo,
DO like this.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X' " Check here
* HEADER_LENGTH = '1'
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = IT_COJRNL
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
VAsanth -
Import data from text file to a table using t-sql
Hi,
I am trying to import data from a text file to a table using the below query but it is returning an error.
SELECT *, 2 FROM OPENROWSET(BULK 'W:\file.txt',
FORMATFILE = 'W:\format_file.xml', FIRSTROW = 1, LASTROW = 1) as f
The error is:
Bulk load data conversion error (truncation) for row 1, column 1 (COPYRIGHT_DETAIL_CODE).<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="3" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="4" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="5" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="6" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="7" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="8" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="9" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="10" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="11" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="12" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="13" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="14" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="2" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="15" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="3" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="16" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="4" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="17" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="43" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="Name1" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="2" NAME="Name2" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="3" NAME="Name3" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="4" NAME="Name4" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="5" NAME="Name5" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="6" NAME="Name6" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="7" NAME="Name7" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="8" NAME="Name8" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="9" NAME="Name9" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="10" NAME="Name10" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="11" NAME="Name11" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="12" NAME="Name12" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="13" NAME="Name13" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="14" NAME="Name14" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="15" NAME="Name15" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="16" NAME="Name16" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="17" NAME="Name17" xsi:type="SQLVARYCHAR"/>
</ROW>
</BCPFORMAT>
The format file that I am using is just like the same one above.
-
How to extract data from text file to database table
Hi ,
I am trying to upload data in text file to database table using GUI_UPLOAD function .what would be the program for that.
thanks in advance.Hi,
I don't think you have a standard sap program to upload data from file to database table...
Instead you can create a custom program like this..
DATA: T_FILEDATA(1000) OCCURS 0 WITH HEADER LINE.
DATA: T_ZTABLE LIKE ZTABLE OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\TEST.TXT'
tables
data_tab = T_FILEDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT T_FILEDATA.
T_ZTABLE = T_FILEDATA.
APPEND T_ZTABLE.
ENDLOOP.
MODIFY ZTABLE FROM TABLE T_ZTABLE.
COMMIT WORK..
Thanks,
Naren
Maybe you are looking for
-
hi guys I created purchase order and after that i am creating migo. In Migo i entered PO number but message coming that PO has no items.. reply please.
-
Exporting to flash with embedded video HELP
I am working on a presentation that includes a video I shot and edited on FCP. I used compressor to resize and reformat to a mpeg4, which I thought would be a very universal format. However, while it does play nicely in my Keynote presentation, it re
-
I have an architecture question for the labview 8.2 community... I have two indicators that I'll be passing data to and I would like to create a single picture (png, jpg, ect) of both indicators. The key aspects is that the data to these indicators w
-
How to disable attachment icon in the below code
Session session = null; Properties props = new Properties(); props.put("mail.smtp.host", mailHost); session = Session.getDefaultInstance(props, null); log.info("STEP 1"); try { Calendar
-
AE CS5 not opening with 'installizing media core'
I just updated my mac pro laptop to an 0SX 10.9 and installed my adobe suite cs5. Aftereffects gets stuck when opening with the text 'installziing media core'. I have no 3rd party apps on my computer as it's brand new. I have quicktime pro 7. Please