To load excel spreadsheet oracle table by combining the values of the columns
Hi allI need to load some data from excellent spreadsheet to a table, but on one condition.
For example: If there are four columns in my excel sheet, the three combined columns must be loaded as a single column in my table and the last column in a separate column.
for example: if my excel sheet has emp_no, emp_val, emp_id, emp_date lines and its values are 1,1,1,29 / 07 / 2011, then he must be loaded in my employee table of database like 111, 07-29-2011... What should I do? Please help me
First, export your Excel spreadsheet to CSV. It is much simpler to work with text delimited by a binary property. Place the CSV file in a directory accessible to the database.
Second, create an external table to select the data in the CSV file. Outdoor tables are very neat, once you get your head around them: basically we can execute SQL queries against the OS files. Declare the external table with four columns, i.e. its projection corresponds to the structure of your file. Learn more about the outdoor tables.
(You will need create a DIRECTORY object to do this, pointing to the OS directory where you put the CSV file).
Now its to a cinch to insert data into your target table:
insert into target_table (col1, cols)
select c1 || c2 || c3, c4
from external_table
/
Cheers, APC
Published by: APC Sep 14, 2011 14:49
Published by: APC Sep 14, 2011 14:50
Why is it so difficult to get things in shape? Grrr
Tags: Database
Similar Questions
-
I tried to open this Excel spreadsheet in Sharepoint and received the following message.
"Cannot open the window because it contains the following features that are not supported by Excel in the browser:
-Protection plate
You want to try to open the message in Excel? »
Learn more about the unsupported features.
YES NO
When I type 'Yes', I had then the second message.
"To open this workbook, your computer must have a version of Microsoft Excel is installed and your Web browser must support opening files directly from Excel in the browser".
What should I do?
Original title: sharepoint excel files
Tommy:
I have 64 bit explore. So I guess that the thought is that the error message was generated by the incoming file, as I have other files Excel I can access in Sharepoint with no problem? I sent the file Outlook e-mail and was able to open it with no problem at all. .
Thanks for the information,
Jim
-
problem loading data from oracle table excel table / oracle
Hi all
I'm working on the form of data transformation 2 different sources to a target table only oracle.
My first source - excel sheet.
2nd source - oracle table.
Creation of data servers, dsn(for excel), reversing everything done very well.
When I try to display the data there is a problem.
EXCEL - serial number column is displayed as 1.0,2.0,.3.0 etc. need 1,2,3,4,5...
Oracle tables-> after that reverse it does not display the data types for the selected columns.
I am not able to create a join and run.
Help, please.
Thank you
Chaitanya.Hello
Just a thought, why not u cast TO_NUMBER to the interface mapping for the serial number column?
Thank you
Guru -
Loading of an oracle table empty that has recursive relationship - ETL
Hi, I have an empty table, called programs. The columns are Short_Name, Long_Name, Pgm_ID (PK), PArent_Pgm_ID (FK). The parent_Pgm_ID and the Pgm_ID are recursive relationship. I have 3 lines, I am loading.
1, abc, one, 25
2, def, d, 35
3, efg, e, 12
I am struck by the constraint violation. I 25, 35, 12 Pgm_ID is loaded first inorder to charge the three lines above. My problem is that they might have different from Parent_Pgm_ID, should I continue to ride all the way, until all the records are synchronized.
Can you please suggest me any solution on how to manage this ETL?
Thanks for your time and your help.>
Hi, I have an empty table, called programs. The columns are Short_Name, Long_Name, Pgm_ID (PK), PArent_Pgm_ID (FK). The parent_Pgm_ID and the Pgm_ID are recursive relationship. I have 3 lines, I am loading.1, abc, one, 25
2, def, d, 35
3, efg, e, 12I am struck by the constraint violation. I 25, 35, 12 Pgm_ID is loaded first inorder to charge the three lines above. My problem is that they might have different from Parent_Pgm_ID, should I continue to ride all the way, until all the records are synchronized.
Can you please suggest me any solution on how to manage this ETL?
>
You cannot load a line with a 'parent' pointing 'id = 25' if there is no line in the table with 'id = 25'.Disable the constraint.
Load the data.
Select the constraint.
-
SQL Server Oracle Migration: semantics of the column
I'm testing a migration to SQL Server 2012 to Oracle 12 c using SQL Developer 4.0.0.13 migration Assistant. The problem that I am facing is that all the generated table creation scripts have CHARACTER semantics for character columns. I wish that the semantic bytes. As the generated tables and columns are several thousand it is not possible to manually change the semantics.
CREATE TABLE account_dod)
account_ID VARCHAR2 (16 CHAR) NOT NULL,
I can't find any possibility to change the semantics when generating. Anyone know of any option that I can set so that the migration wizard will generate all of the columns in the form of BYTES?
Thank you very much
Hello
If you email me, I can provide an extension changed to use unity BYTE CHAR and VARCHAR2 columns.
My email address is my [email protected]
Kind regards
Dermot ONeill
SQL development team
-
Bug: 4.1.1 as a table with all the columns of conditionals
I need to make all the columns in a tabular form conditional because in some situations the editable elements must not appear. For some reason, simply change the columns in the form of work conditional stop valves, the ApplyMRU/ApplyMRD process works but not action lines changed. I can't understand why all or of a workaround.
You can easily replicate this in 4.1.1 creating a form of table with the wizard by selecting a column in the form. Then subordinate the selector colunn line and your editable column using the expression 1 = 1 plsql. The form is displayed all the same with these real conditions but it does not work. Weird how?
Rod WestRod,
In your scenario, the tabular rendering engine may not place the hidden status columns, internal tabular form in your form, i.e. the columns that contain amounts of control, etc.. The logic that puts these columns search the last column unconditional, visible in the form of your table and includes hidden fields here. If you need at least a column that is always indicated to do so. This can be an empty column. I filed a bug (#13881803) to do this, so we can look to improve this logic.
Kind regards
Marc -
How to load data from Oracle tables into essbase?
HelloI'm fairly new to essbase. We are working on essbase 11.1.2.2.
I want to build size & load data using pre-existing data warehouse which is built on Oracle.
I try to use "Open SQL". I use OIC. It is gicing me connection error (1021001).
The following log shows:
[Sea 14 Aug 14:15:06 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Info (1021097)
EssOCI Initializes the connection to the Oracle database on the server [tmdwtst1][Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Info (1021099)
EssOCI could not connect to the Oracle database with error message [ORA-12154: TNS: could not resolve the connect identifier specified]
][Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Error (1021001)
Cannot establish a connection to the SQL database server. See the log for more information[Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Warning (1080014)
Transaction [0 x 2650001 (0x520b4392.0x69b68)] abandoned due to the State [1021001].Help, please.
Thank you
Sam
You use the correct format for the OIC:
Host: port / Oracle_service_name
See you soon
John
-
I created an excel sheet to spread and saved to my desktop but the icon that appears on the office moves and I can't open it.
Your problem looks like the one described here:
"A file Microsoft Excel, Word or PowerPoint 2010 does not open because of incorrect file associations"
<>http://support.Microsoft.com/kb/2464297 >HTH,
JW -
[8i] need to combine several values in a column
I work in 8i...
I have data as follows:
The results that I want are:CREATE TABLE item_year ( item_no CHAR(25) , year CHAR(4) ); INSERT INTO item_year VALUES ('item1','1998'); INSERT INTO item_year VALUES ('item1','2002'); INSERT INTO item_year VALUES ('item1','2003'); INSERT INTO item_year VALUES ('item1','2004'); INSERT INTO item_year VALUES ('item2','1984'); INSERT INTO item_year VALUES ('item2','1991'); INSERT INTO item_year VALUES ('item2','2006'); INSERT INTO item_year VALUES ('item2','2008'); INSERT INTO item_year VALUES ('item2','2010');
My inclination is to rotate the results, but my problem is, I don't know how many years will see room for a particular item. In theory, it could it upwards in each year between any point in the past through the current year. In practice, the year is 1997, and I can't think of any situation where an older date occur in the future, because this table is a table of history. Thus, at the present time, the years, I would need to look to be 1997-2010, but of course, would come January, it will be 1997-2011, etc.. So either way is for me to do without having to create a procedure or something?ITEM_NO YEARS ------------------------------ item1 1998, 2002, 2003, 2004 item2 1984, 1991, 2006, 2008, 2010
Hello
You can do the slightly simpler query by losing the CONNECT BY. In the example that you copied, CONNECT BY was the only way to get the items that should be grouped together. In your case, a simple query will do:
SELECT item_no , CAST ( MULTISET ( SELECT year FROM item_year WHERE item_no = all_item_nos.item_no ORDER BY year ) AS myArrayType ) AS years FROM ( SELECT DISTINCT item_no FROM item_year ) all_item_nos ;
I don't know how to get a simple string (rather than myArrayType) for results without the help of PL/SQL.
If you use the PL/SQL, you might consider this approach: write a function that takes an id (like item_no) as an argument and returns a string (the list or results). You probably want several similar functions for the different arguments, tables and columns. If Yes, you can isolate the part that actually built the chain to verify that the results are actually in the allocated space, in a generic function (such as concat_query, below) and to call this generic function to a specific function (such as all_years, below) adapted to a specific situation.
This is a package that contains the generic function:CREATE OR REPLACE PACKAGE string_agg AS TYPE concat_query_cursor_type IS REF CURSOR RETURN dual%ROWTYPE; FUNCTION concat_query ( in_cursor IN concat_query_cursor_type, in_separator_txt IN VARCHAR2 ) RETURN VARCHAR2 ; END string_agg; / SHOW ERRORS CREATE OR REPLACE PACKAGE BODY string_agg AS FUNCTION concat_query ( in_cursor IN concat_query_cursor_type, in_separator_txt IN VARCHAR2 ) RETURN VARCHAR2 IS c_txt VARCHAR2 (4000); return_txt VARCHAR2 (4000) := ''; return_max_val INTEGER := 4000; -- declared size of return_txt row_cnt INTEGER := 0; -- number of pa records found so far BEGIN LOOP FETCH in_cursor INTO c_txt; EXIT WHEN in_cursor%NOTFOUND; IF row_cnt > 0 THEN c_txt := in_separator_txt || c_txt; END IF; IF LENGTH (return_txt) + LENGTH (c_txt) > return_max_val THEN c_txt := SUBSTR ( c_txt, 1, return_max_val - LENGTH (return_txt) ); END IF; return_txt := return_txt || c_txt; IF LENGTH (return_txt) >= return_max_val THEN EXIT; END IF; row_cnt := row_cnt + 1; END LOOP; CLOSE in_cursor; RETURN (return_txt); END concat_query ; END string_agg; / SHOW ERRORS
Here is an example of a specific function using this package:
CREATE OR REPLACE FUNCTION all_years ( in_item_no IN item_year.item_no%TYPE ) RETURN VARCHAR2 IS q_cursor string_agg.concat_query_cursor_type; return_txt VARCHAR2 (4000); BEGIN OPEN q_cursor FOR SELECT year FROM item_year WHERE item_no = in_item_no ORDER BY year; return_txt := string_agg.concat_query ( q_cursor, ', ' ); RETURN (return_txt); END all_years; / SHOW ERRORS
The all_years above is a stand-alone function. You could also just have a function in a package, or string_agg, or another package, if that suits your needs.
As you can see, the specific function is quite trivial. You could probably do something with dyanamic SQL, where you write another function, with the text of a query as a string argument, and it calls concat_query and returns this value.Here is an example of using the all_years function in a query:
SELECT item_no , all_years (item_no) AS years FROM ( SELECT DISTINCT item_no FROM item_year ) ;
You could SELECT DISTINCT in the main query, but it would be less effective.
Output:ITEM_NO YEARS ------------------------- ---------------------------------------- item1 1998, 2002, 2003, 2004 item2 1984, 1991, 2006, 2008, 2010
-
Querying the oracle table that has a column with the name of "FILE".
Hi all
I need to have an oracle table that has the column with the name "FILE".
I can query all columns with the query "select * from table".
But I'm not able to use the query "select the table file.
This table is converted from ms access to oracle and I need to have this column with the name "FILE".
Any suggestions?
Thank you
Abdellaoui
Hello
FILE is a keyword from Oracle, so it's not a good name,
Use FILEDATE, or DATE_FILED, or something else that is not in V$ RESERVED_WORDS. KEYWORD as the name column.
If you need to use the FILE, then you must use quotation marks.
-
Load since excellent data to Oracle Tables
Hi all
I want to create a table with the payment year as default sysdate (to_char(sysdate,'yyyy')) and months in the form 'MM' (as default payment_month < (syadate, 'MM') >
I'm doing it in vain. Help me please, and the other is want to load data from EXCEL to ORACLE table.
I used to load the load data using SQL * LOADER. can you please let me know is possible to load data without using SQL * Loader? Please give me the solution for this.
Thank you
ORA.
-
Get the error loading file csv to oracle table
Hello
I'm tryitng to load the csv file into oracle db table.
Source:
CSV file have account_numbers, customer_names. all the fields, it took as channel.
Target: Oracle db
If I took all the fields as varchar, it loads very well. but I want to
Oracle table fields: digital account numbers or decimal (20.2)
customer_names as varchar2 format.
When I'm trying to load csv to oracle table, I am getting following error.
ODI-1228: fgh1 (integration) task fails on the target odi_user1 ORACLE connection.
Caused by: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
I tried so many times. I am still getting error.
TO_NUMBER function I also used, getting same error
Please help me,
Thank you and best regards,
A.Kavya.
Hi, String, CSV file data type have values of amount a 54,356,4657.89 format. Like this. In odi, I took number (30.2) of data types for the target table. When I traced in odi, I get error like invalid number. to do this, I changed the values in csv file format. I removed commas. for example, 543564657.89. Yet once, I traced csv to oracle in odi. executd successfully. Thanks & regards, A.kavya.
-
Help to import Excel data in tables preformattes
This is my first post here, so please be gentle!
I am a relatively new user of InDesign CS4, and I created the list price of the manufacturer 70 - pg. A very large part of each page will be of size and price information source of a large Excel spreadsheet.
I created the table format I would use for each page, but the problem comes when I import the Excel data in this table. For some reason, when I import, all this turns in a cell. It would be preferable to import into a table not formatted and then put in the form table every time, or is there a way to simply import data into my preformatted table? I've seen how the former, but the latter seems much easier (.. .Although that could be my inexperience talking).
Any advice would be greatly appreciated!
Thank you very much
Laura (V1500)
To paste a range of cells in the way you want, you have most of the steps down.
The key point is to select the CELL at the top left of the area you want to paste into. See the screenshot below. The first cell in the range of rates is selected.
You may simply move the active cursor in the cell. This puts the contents of the Clipboard into this one cell.
-
ODI error when loading data from Oracle to Essbase
Hello and happy new year to everyone!
I can't load some data from an Oracle table to an Essbase database. The Oracle table has all the members of the Essbase database, columns, and in addition, it has a column for data.
I use the IKM SQL for Hyperion Essbase (DATA) as IKM and I can't choose a LKM in the dropdown, but I imported the LKM SQL to SQL.
Error thrown is:
org.apache.bsf.BSFException: exception of Jython:
Traceback (innermost last):
"< String >" file, line 23, in there?
com.hyperion.odi.essbase.ODIEssbaseException: error reached records the maximum error threshold: 100
at com.hyperion.odi.essbase.ODIEssbaseDataWriter.loadData (unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (unknown Source)
at java.lang.reflect.Method.invoke (unknown Source)
at org.python.core.PyReflectedFunction.__call__ (PyReflectedFunction.java)
at org.python.core.PyMethod.__call__ (PyMethod.java)
at org.python.core.PyObject.__call__ (PyObject.java)
at org.python.core.PyInstance.invoke (PyInstance.java)
to org.python.pycode._pyx10.f$ 0 (< string >: 23)
to org.python.pycode._pyx10.call_function (< string >)
at org.python.core.PyTableCode.call (PyTableCode.java)
at org.python.core.PyCode.call (PyCode.java)
at org.python.core.Py.runCode (Py.java)
at org.python.core.Py.exec (Py.java)
at org.python.util.PythonInterpreter.exec (PythonInterpreter.java)
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
at com.sunopsis.dwg.codeinterpretor.k.a (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession (unknown Source)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand (unknown Source)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute (unknown Source)
at com.sunopsis.dwg.cmd.e.i (unknown Source)
at com.sunopsis.dwg.cmd.g.y (unknown Source)
at com.sunopsis.dwg.cmd.e.run (unknown Source)
at java.lang.Thread.run (unknown Source)
Caused by: com.hyperion.odi.essbase.ODIEssbaseException: error reached records the maximum error threshold: 100
at com.hyperion.odi.essbase.ODIEssbaseDataWriter.sendRecordArrayToEsbase (unknown Source)
... 32 more
com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: error reached records the maximum error threshold: 100
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.k.a (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep (unknown Source)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession (unknown Source)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand (unknown Source)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute (unknown Source)
at com.sunopsis.dwg.cmd.e.i (unknown Source)
at com.sunopsis.dwg.cmd.g.y (unknown Source)
at com.sunopsis.dwg.cmd.e.run (unknown Source)
at java.lang.Thread.run (unknown Source)
I'll wait for any help.
Thank you!First of all, I would highly recommend the upgrade because there were a few bugs with the adapters of Hyperion.
If you set MAXIMUM_ERRORS_ALLOWED to 0 it will be infinite, so it will not stop because of rejected records.Once you assign to LOG_ENABLED and LOG_ERRORS Yes
then you LOG_FILENAME together and ERROR_LOG_FILENAME, put them in a known example location c:\temp on windows.Ok?
See you soon
John
http://John-Goodwin.blogspot.com/ -
Help to download the xml of the oracle table below
Dear all,
I tried best to download the below xml to oracle table but giving the link between the tables is very difficult for me. can someone help me to import the XML below for oracle table
<? XML version = "1.0" encoding = "utf-8"? >
< Claim.Submission xmlns:tns = "http://www.haad.ae/DataDictionary/CommonTypes" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation = "http://www.haad.ae/DataDictionary/CommonTypes/ClaimSubmission.xsd" >
< header >
MF65 < SenderID > < / SenderID >
C014 < ReceiverID > < / ReceiverID >
< TransactionDate > 03/12/2012 10:40 < / TransactionDate >
< RecordCount > 1 < / RecordCount >
< DispositionFlag > PRODUCTION < / DispositionFlag >
< / header >
< claim >
< ID > 23112 / < ID >
< MemberID > 100000874 < / MemberID >
A022 < PayerID > < / PayerID >
MF65 < ProviderID > < / ProviderID >
< EmiratesIDNumber > 111-1111-1111111-1 < / EmiratesIDNumber >
< raw > 115 < / gross >
< PatientShare > 20 < / PatientShare >
< net > 95 < / Net >
< meeting >
MF65 < FacilityID > < / FacilityID >
< type > 1 < / Type >
< > 47685 PatientID < / PatientID >
< Start > 02/11/2012 12:00 < / Start >
< / meeting >
< Diagnostics >
Principal of < type > < / Type >
< code > < code > 461.9
< / Diagnosis >
< Diagnostics >
Secondary < type > < / Type >
< code > < code > 462
< / Diagnosis >
< activity >
23112_1 < ID > < /ID >
< Start > 02/11/2012 12:00 < / Start >
< type > 3 < / Type >
< code > < code > 99202
< quantity > 1 < / quantity >
< net > 95 < / Net >
D1310 < clinician > < / clinician >
< / activity >
< / claim >
< Claim.Submission >Pls tell me how I can get
Have you considered using the storage relational object for this?
Since you have patterns, you could record in the database, which will automatically create storage appropriate for your XML documents as well as validate at the time of insertion.
You can then create individual views to query the nested parts of the document and finally insert the data into relational tables final.See the documentation for an introduction to the concepts:
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/partpg2.htm#g997354You will find examples on the {forum: id = 34} forum and its FAQ: {: identifier of the thread = 410714}
Maybe you are looking for
-
Where to get the recovery for Satellite A50-522 CD?
Hello worldCan someone tell me where I can buy a recovery for my Satellite A50-522 CD? Gracias
-
Satellite 1110: cannot close the lid without insisting on the cover
Hello I have a problem with my screen before covering. Plastic, which is around the screen, separated on one side, and I cannot shut down the computer without insisting on the cover. It is difficult to describe? Y at - it the possibility to solve the
-
Pavilion s5-1015uk: the upgrade of processor
Tried to upgrade the CPU on my desk of slimline s5-1015uk Pavilion to an i7 - 2600K quad core CPU. The HP support document has stated that the Cupertino would a QuadCore i7-2xxx - but the pc gave the message that island cpu is not recognized and set
-
How to go down to the nearest multiple of Labview
I am trying round my data down to a given multiple. Is it possible to do in Labview? I use Student Edition 2009 if it's relevant. Thanks in advance.
-
The mouse works in the login screen does not work after logging in
I have Asus new laptop with touchpad mouse. First two weeks worked satisfactory mouse.The mouse works now, after booting the computer login screen (i.e. the scrolls of the mouse on the screen and can use the mouse buttons to select the user). Howev