Home » SQL & PL/SQL » SQL & PL/SQL » Import/Entry from txt file (SQL*Plus: Release 8.0.6.0.0 - Production)
Import/Entry from txt file [message #675557] Sat, 06 April 2019 04:13 Go to next message
Salehin
Messages: 62
Registered: March 2013
Location: Chittagong, Bangladesh
Member
Hi everyone,

When I face any difficulties in orcale every time I find solution from this forum. May God bless you.

I want to input data from Excel to my Sql. I am using Data Load for this but I think there may be an alternate/Easy way to input with Sql command. here is my table.


SQL> desc ITEM_MASTER;
 Name                            Null?    Type
 ------------------------------- -------- ----
 ITEM_CODE                                VARCHAR2(50)
 ITEM_NAME                                VARCHAR2(500)
 MASTER_CODE                              VARCHAR2(50)
 ITEM_MASTER                              VARCHAR2(100)
 GROUP_CODE                               VARCHAR2(50)
 ITEM_GROUP                               VARCHAR2(100)
 ACC_NAME                                 VARCHAR2(100)
 TYPE_CODE                                VARCHAR2(10)
 TYPE_DESC                                VARCHAR2(150)
 UNDER_CODE                               VARCHAR2(10)
 UNDER_DESC                               VARCHAR2(150)
 APP_CODE                                 VARCHAR2(10)
 APP_DESC                                 VARCHAR2(150)

I am attached my txt file.

Sorry in advance If I do any fault against COC.
*BlackSwan corrected {codetag}

[Updated on: Sat, 06 April 2019 06:07] by Moderator

Report message to a moderator

Re: Import/Entry from txt file [message #675562 is a reply to message #675557] Sat, 06 April 2019 07:07 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
If you are starting with a text file, 3 options exist.
1) SQL*Loader
2) EXTERNAL TABLE
3) UTL_FILE

Alternatively it is possible to issue SQL directly from Excel itself against Oracle database.

Which metric measures "Easy"?
IMO, easy is the one you know & can produce desired results.
Re: Import/Entry from txt file [message #675564 is a reply to message #675557] Sat, 06 April 2019 09:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Post result of
select * from v$version;

Post CREATE TABLE statement.

Before, Please read How to use [code] tags and make your code easier to read.

Re: Import/Entry from txt file [message #675572 is a reply to message #675564] Sun, 07 April 2019 04:05 Go to previous messageGo to next message
Salehin
Messages: 62
Registered: March 2013
Location: Chittagong, Bangladesh
Member

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL> 
Re: Import/Entry from txt file [message #675573 is a reply to message #675572] Sun, 07 April 2019 04:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

OK, now the second sentence.

Re: Import/Entry from txt file [message #675574 is a reply to message #675573] Sun, 07 April 2019 05:51 Go to previous messageGo to next message
Salehin
Messages: 62
Registered: March 2013
Location: Chittagong, Bangladesh
Member
Sorry I cant understand I already create a ITEM_MASTER table and also gave the desc.
Re: Import/Entry from txt file [message #675575 is a reply to message #675574] Sun, 07 April 2019 06:11 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

YOU you created the table but WE haven't and we can't with a DESC.

Previous Topic: How to split one column with dates into two with periods (from-to)
Next Topic: View my own queries
Goto Forum:
  


Current Time: Fri Mar 29 02:54:39 CDT 2024