Import a text file into database
If anybody could help me with this, i would GREATLY appreciate it! I need to write a procedure to import a text file into an oracle database table. -Thanks!
See my response in Re: import a text file into database.
Cheers, APC
Similar Messages
-
How to import a excel file into database?
hi all,
How can I import a excel file into database?
What I need to do first?
Thanks,
Amy1. Create a conrtol file in your disc(with notepad) ex
test_loader.ctl
LOAD DATA
INFILE='C:\Testcsv.csv'
into table test_table
FIELDS TERMINATED BY ','
TRAILING NULL COLS
(ID,COL1,COL2,COL3)
The table descrption is
scott@ORCL> desc test_table;
Name Null? Type
ID NUMBER
COL1 VARCHAR2(10)
COL2 VARCHAR2(10)
COL3 VARCHAR2(10)
scott@ORCL>
2 .Create a file testcsv.csv from your excel file you want to load with " save as" csv comma seperated value
in your hard disc c:\
3. in dos command mode write
C:\>sqlldr scott/tiger control=c:\testcsv.ctl log=c:\testcsv.log
Thats it! -
Import xml zip file into database
Should it be possible to zip the xml file and insert the that zip file into database?
Hello,
You can refer to <p>this article to see how store/edit files with the Webutil library<p><br><br>
Francois -
Importing text file into database
Hi again,
Could anyone give me any pointers on how to take a text file or csv file (or any other delimeted text file) and read the contents into java and then use the read in data to then insert the delimeted data into the table.
i assume i have to read the delimeted data into a variable then parse the complete string with the delimeter and split the data up maybe in an array. Maybe this is completely wrong, im really unsure.
any help would be greatly appreciated even a point in the right direction would be great :)
kind regards.Well, atleast i dont know of a single method, which does this kind of nonhomogenous task!! Its not hard to impliment what you want-->
//open the text file using FileInputStream & get the contents in a String variable
//Tokenise it
StringTokenizer st=new StringTokenizer(your_string_retrieved_from_file,delimiter);
int i=0;
while(st.hasMoreTokens())
i++;
//SQL Statement that inserts a string into database table(integer, varchar2)
insert into test_table values(i,st.nextToken());
Unless you are talking about putting the tokens as coloums in a single row, i dont find why this is a problem & if you are actually doing the above case, then you might wanna rethink your design -
Importing a Text File to Database
Hi There,
Years ago with limited Coldfusion experience I created a Cold fusion process (below) that deletes the contents of a database table and inserts the contents of a 7mb text file which is passed via FTP down to our web server at regular intervals. Admittingly the code below is probably clunky to the more experienced, however i have found this process to work for the last 4 years without a problem. Recently my web server (shared hosted environment) has been throwing this error when this page runs,
"Request aborted due to heavy system load.",
I asked my host if there has been any changes, extra sites recently added to the server that may be causing this congestion which they naturally replied "no". I even tried reducing the text file size to about 3mb but still got the same issue. Is there any other more efficient coldfusion code options I can try that may be quicker and prevent the error from being thrown?
Im on Coldfusion 7 and using MS SQL server, database and coldfusion are on differnt boxes in a shared environment.The text file can contain null values and is delimeted by a pipe character "|"
Any help appreciated
<cfsetting requesttimeout="600">
<cftransaction>
<cfquery name="delete" datasource="#client.dsn#" username="#client.username#" passWord="#client.password#">
delete from xxxxxx
</cfquery>
<cfhttp method="get" textqualifier=" " username="xxxxx" password="xxxxxx" firstrowasheaders="no" delimiter="|" name="test" url="http://xxxxxxxxxxxxxx/br_orders.txt">
Records Read <cfoutput>#test.recordcount#</cfoutput>
<cfloop query="test">
<cfquery name="insert" datasource="#client.dsn#" username="#client.username#" passWord="#client.password#">
INSERT INTO xxxxx
(OrderNo, Line, AccountNo, AccountNoShip, Shipment, PurchaseOrder, Completed, OrderDate, ShipmentDate, Product, QtyOrdered, QtyShipped, Price, Carrier, Connote, Delivery1, Delivery2, Delivery3, Delivery4, Delivery5, Delivery6, Delivery7, Delivery8, expected)
VALUES (
<cfqueryparam value='#test.column_1#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_2#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_3#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_4#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_5#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_6#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_7#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_8#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_9#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_10#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_11#' cfsqltype="cf_sql_float">,
<cfqueryparam value='#test.column_12#' cfsqltype="cf_sql_float">,
<cfqueryparam value='#test.column_13#' cfsqltype="cf_sql_float">,
<cfqueryparam value='#test.column_14#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_15#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_16#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_17#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_18#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_19#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_20#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_21#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_22#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_23#' cfsqltype="cf_sql_varchar">,
<cfqueryparam value='#test.column_24#' cfsqltype="cf_sql_varchar">
</cfquery>
</cfloop>
<cfparam name="OZ" default=""><cfset OZ=#dateAdd("h",18,now())#>
<cfset OZ=#CreateODBCDateTime(OZ)#>
<cfquery datasource="#client.dsn#" username="#client.username#" password="#client.password#">
UPDATE
UpdateTimes
SET
time=#OZ#
WHERE
id=<cfqueryparam value="1" cfsqltype="cf_sql_integer">
</cfquery>
</cftransaction>Girish Sharma wrote:
"I would be really grateful."
But now OP will not really grateful to you; because;
1.You are not going to perform/import the data at his machine.
2.You have not given him the required control file.... (even without knowning anything)
3.You have given only SQL Loader word; so now "oaf... i have to read Doc.."
Regards
Girish SharmaHahahaha . Supper.. ROFL! :) -
Importing a text file into a variable
I have a text file that I would like to import as a variable in javascript. I would like to do some editing to the text in the script before I place it into the page. I have the script splitting text into an array and the different parts need to go to different places... I have everything working for me except for importing the text from a file into a variable (right now I'm defining the variable from within the script).
Any help would be appreciated!
-ShaneIn Javascript you could use this:
var f = File ('/d/books/mytextfile.txt');
if (f.exists)
f.open ('r', undefined, undefined);
var textfile_contents = f.read();
f.close ();
Peter -
How to load data in plain-text file into database by using EJB?
Hi,
We need to develop an on-line application which requires us to load input data
from a selected plain-text file on the Web server (iplanet server) into the backend
oracle database. How could I use EJB to make it happen? it seems like using Entity
EJB is not feasible.
Really appreciate your help!
CoronaHi Corona,
"Corona Fang" <[email protected]> wrote in message
news:3f3b0ea3$[email protected]..
We need to develop an on-line application which requires us to load inputdata
from a selected plain-text file on the Web server (iplanet server) intothe backend
oracle database. How could I use EJB to make it happen? it seems likeusing Entity
EJB is not feasible.If you are talking about loading thousands of records,
the preferable way is using plain JDBC calls utilizing
batch methods.
Regards,
Slava Imeshev -
Skip a column when importing a text file into Excel 2010
Hi,
I have a formatted Excel 2010 spreadsheet that I want to import data from a .txt file located on my local drive. The third column of the spreadsheet is a concantenate formula that converts the second column from a Hex formatted value to a Dec formatted value.
I want the first two columns of the text file to import into the first two columns of the spreadsheet and skip the third column then import the remaining columns from the text file to the spreadsheet. Is there an easy way to do this or do I need a VBA code
and if so can you provide that to me?
Thank you,
JenniferHi Tony,
I am sorry if I didn't express my issue more clearly. Where I need to skip a column is in the Excel spreadsheet. I want to import all the columns from the text file. I want the first two columns from the text to import to the first two columns in the Excel
sheet A and B, skip the third column C in the spreadsheet, where I have a formula to convert the second column B values from a Hex format (imported data) to a Dec format, then continue to import columns 3, 4, and 5 from the text to spreadsheet columns D, E,
and F. I would think the function would be in the Excel spreadsheet maybe some type of protection setting or something similar, if it can even be done.
Thank you for taking the time to help me out with this.
Jennifer -
Import external text file into table in database using web form
I whant to import data from text delimited file located in os
into oracle table using web form.
I am using ORACLE DATABASE 8i, APPLICATION SERVER 9i
and ORACLE FORMS DEVELOPER AND FORMS SERVER 6i (Patch 2)
Is there anybody who know how can i do this?
Thank you!WebUtil uploads the files as Binary - so yes you could have some issues if you have a Unix host - however, that would only mean that there is an extra character to trim off of the end of the line read by Text_io.
-
, Trouble importing from text file into PDF Acrobat 9.0
Hey all!
I'm trying to use the JavaScript found on this Adobe page to insert text into my PDF:
http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/common/h tml/wwhelp.htm?context=Acrobat9_HTMLHelp&file=JS_API_AcroJS.88.502.html
this.importTextData("/c/data/myData.txt", 0);
Replacing the path with my own path, of course. However, I can't get it to work at all, it just crashes my JavaScript. I was thinking it might have something to do with the privilege stuff which, admittedly, confuses me a bit. But my understanding is that if you use the function without arguments, that shouldn't matter, and it will prompt the user for a path?
this.importTextData();
However, that still crashes the JavaScript. I'm not sure what exactly I am doing wrong here?
NOTE: I have tried running the JavaScript both in a checkbox and on page load.Well I was having trouble getting it to work without a path, though that kind of mysteriously started working now despite the fact that I didn't really change anything. I also assumed that part didn't apply to me because we are on 9, not 8, but maybe it means 8 and on?
I'm having a bit of trouble wrapping my mind around privileged and non-privileged contexts.
These methods can be executed only in a privileged context, which includes console, batch and application initialization events.
What would be the simplest way to execute in a privileged context? "Application initialization" sounds promising, does this mean when the application is first opened? If so, how would you execute JavaScript this way?! -
How to import data from a text file into a table
Hello,
I need help with importing data from a .csv file with comma delimiter into a table.
I've been struggling to figure out how to use the "Import from Files" wizard in Oracle 10g web-base Enterprise Manager.
I have not been able to find a simple instruction on how to use the Wizard.
I have looked at the Oracle Database Utilities - Overview of Oracle Data Pump and the Help on the "Import: Files" page.
Neither one gave me enough instruction to be able to do the import successfully.
Using the "Import from file" wizard, I created a Directory Object using the Create Directory Object button. I Copied the file from which i needed to import the data into the Operating System Directory i had defined in the Create Directory Object page. I chose "Entire files" for the Import type.
Step 1 of 4 is the "Import:Re-Mapping" page, I have no idea what i need to do on this page. All i know i am not tying to import data that was in one schema into a different schema and I am not importing data that was in one tablespace into a different tablespace and i am not R-Mapping datafiles either. I am importing data from a csv file.
For step 2 of 4, "Import:Options" page, I selected the same directory object i had created.
For step 3 of 4, I entered a job name and a description and selected Start Immediately option.
What i noticed going through the wizard, the wizard never asked into which table do i want to import the data.
I submitted the job and I got ORA-31619 invalid dump file error.
I was sure that the wizard was going to fail when it never asked me into which table do i want to import the data.
I tried to use the "imp" utility in command-line window.
After I entered (imp), i was prompted for the username and the password and then the buffer size as soon as i entered the min buffer size I got the following error and the import was terminated:
C:\>imp
Import: Release 10.1.0.2.0 - Production on Fri Jul 9 12:56:11 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Username: user1
Password:
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Import file: EXPDAT.DMP > c:\securParms\securParms.csv
Enter insert buffer size (minimum is 8192) 30720> 8192
IMP-00037: Character set marker unknown
IMP-00000: Import terminated unsuccessfully
Please show me the easiest way to import a text file into a table. How complex could it be to do a simple import into a table using a text file?
We are testing our application against both an Oracle database and a MSSQLServer 2000 database.
I was able to import the data into a table in MSSQLServer database and I can say that anybody with no experience could easily do an export/import in MSSQLServer 2000.
I appreciate if someone could show me how to the import from a file into a table!
Thanks,
Mitra>
I can say that anybody with
no experience could easily do an export/import in
MSSQLServer 2000.
Anybody with no experience should not mess up my Oracle Databases ! -
Error importing text file into SQL Server when last column is null
Hello all. Happy holidays!
I'm trying to import a text file into a SQL Server table, and I get the error below when it gets to a row (row 264) that has null in the last column. I'm guessing the null jumbles up the delimiters somehow. The nulls are not errors, and I need to import
them into the table with the rest of the rows. Any idea how I can do that?
Thanks!
[Flat File Source [1]] Error: Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
[Flat File Source [1]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "XYZ" (178)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "XYZ"
(178)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
[Flat File Source [1]] Error: An error occurred while processing file "ABC.txt" on data row 264.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Flat File Source" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput().
The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
WeeLassHi WeeLass,
The error that” Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".” is generally error message, and the error indicates
that there is data type mismatch issue between the input columns and the output columns.
Based on your description, the issue is that you trying to convert a column contains empty value from string to integer data type for the output column "XYZ" in Flat File Source [1]. Please note that we cannot type an empty value as integer data
type column value, so the error occurs.
To fix this issue, just as you did, we should convert the data type for the output column "XYZ" in Flat File Source [1] back to DT_WSTR or DT_STR, then use a derived column task to replace the current column (UBPKE542). But the expression should
be like below:
LEN(TRIM(UBPKE542)) > 0 ? (DT_I8)UBPKE542 : NULL(DT_I8)
In this way, the data type of the column in SQL table would be int, and the empty value would be replaced with NULL.
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
I have an InDesign tagged text file I've translated from .xml. I need to automate the following steps:
1 - access specific InDesign template (eg. ABC_template.ind)
2 - import tagged text file into InDesign
3 - autoflow text to END of document (normally around 3-5 pages)
4 - save document as either .ps or .pdf file
5 - where the input file stub name matches the output stub name (eg., OrigName.txt outputs as OrigName.pdf).
I would like to completely automate this whole process using JavaScript (because I don't know anyone that knows AppleScript). I've automated the first part using a perl script. I've been trying to find sample snipits of JavaScript that would do one or more of the items listed above, but am having a hard time finding what I need.
Please, I'm desperate!! Can any of you InDesign scripting guru's out there help me??
Thanks in advance!!
LindaDHi Linda,
I might be able to help you out. You can contact me by email (click on my user name for the address), or if you post your email here. -
Help needed in reading text file to database table
Hello experts,
i have to insert the values from the column of this text file and insert them in my database table.
I have done a few file to table insertions but i'm having some trouble with this one.
Any suggestions plz
thanks
liab_report 1.00 Page: 1
CDC:00537 / Mon Jun-21-2010 LIABILITY REPORT Mon Jun-21-2010 22:06:26
DRAW 1; SET 1; November 7, 2009
TOTAL PAID ON TOTAL EXPIRED ON TOTAL FRAC OUTSTANDING
WINNERS 06/21/10 PAID 06/21/10 EXPIRED ROUND
DIVISION AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT
Div1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Div2 701040.00 0.00 660146.00 0.00 40894.00 0.00 0.00
Div3 1444128.00 0.00 1330056.00 0.00 114072.00 0.00 0.00
Div4 4711900.00 0.00 3889700.00 0.00 822200.00 0.00 0.00
6857068.00 0.00 5879902.00 0.00 977166.00 0.00 0.00
DRAW 2; SET 1; November 14, 2009
TOTAL PAID ON TOTAL EXPIRED ON TOTAL FRAC OUTSTANDING
WINNERS 06/21/10 PAID 06/21/10 EXPIRED ROUND
DIVISION AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT
Div1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Div2 817817.00 0.00 817817.00 0.00 0.00 0.00 0.00
Div3 1687405.00 0.00 1611742.00 0.00 75663.00 0.00 0.00
Div4 3402100.00 0.00 3034200.00 0.00 367900.00 0.00 0.00
5907322.00 0.00 5463759.00 0.00 443563.00 0.00 0.00
DRAW 3; SET 1; November 21, 2009
TOTAL PAID ON TOTAL EXPIRED ON TOTAL FRAC OUTSTANDING
WINNERS 06/21/10 PAID 06/21/10 EXPIRED ROUND
DIVISION AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT AMOUNT
Div1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Div2 779933.00 0.00 769804.00 0.00 10129.00 0.00 0.00
Div3 1605548.00 0.00 1525104.00 0.00 80444.00 0.00 0.00
Div4 4891700.00 0.00 4256800.00 0.00 634000.00 0.00 900.00
7277181.00 0.00 6551708.00 0.00 724573.00 0.00 900.00Plz clarify whether u want to load text file as a file into database or value of this text file into database. If values are to be loaded from this text file, U can better format the text file and use SQL loader to load the file into database. By formatting the database, i mean remove the unnecessary headings and characters, kee only the values to be loaded idelimited by ' '(space) or ','(comma). Create a control file and load it into the target table.
-
USING WEBUTIL TO READ TEXT FILE INTO TABLE HANGS AFTER CERTAIN NUMBER OF RE
Dear
when we use webutil to retrieve data from text file into database table
(using text_io) it hangs after certain number of records ( approx. 1300
records) while the total number of records to be inserted in the table exceeds
12000 records while it works properly on forms6i with the normal text_io any
help please...?
thanks and regardsWebUtil uploads the files as Binary - so yes you could have some issues if you have a Unix host - however, that would only mean that there is an extra character to trim off of the end of the line read by Text_io.
Maybe you are looking for
-
Making Customer Pricing procedure mandatory in BP Role-CRM 5.0
Hi Our requirement is to make Customer Pricing procedure mandatory in BP Role "Sold to Party"-CRM 5.0. I have configured for the same in IMG Field Grouping. Now when a end user goes for BP creation & goes to Sales area maintenance then an error messa
-
Can I buy laptop with free ipod touch for family member in school?
I bought a macbook pro for my sister-in-law who is in college on the online store using the education discount. We figured she'd take the ipod touch as well. After purchasing, I noticed that only Parents are eligible for the discount. How is this goi
-
Completion Status Sent Two Times
I am having a problem with my completion status being sent twice to an LMS. I have 5 questions that are multiple choice (I give users two attempts at answering each question). Prior to the Results page, the results are sent to the LMS and the record
-
I am trying to add a hosts entry (like old school /etc/hosts) on my iMac intel (10.4.5). I followed the apple instructions and used the netinfo utility to add the host under the machines branch. Everything LOOKS fine, but it doesn't work. For example
-
Hi I'm designing a relatively large wireless deployment and it has been sized for approx 4K users. The network is to be layer3 with the intent of using AP groups to reduce the size of the broadcast domain. Are these assumptions then correct: 1. Durin