[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Importing *.csv with a default  SYS_GUID() column

Posted on 2004-11-17
1
Medium Priority
?
1,447 Views
Last Modified: 2008-01-09
How do I import data from a *.csv file into a table with a primary key of type RAW(16)  DEFAULT  SYS_GUID()?  I am wanting Oracle to generate the sys_guid().

M@
0
Comment
Question by:willcode4coffee
1 Comment
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1500 total points
ID: 12606182
Not sure what the problem is.

table def:
-------------------------
drop table tab1;
create table tab1(
      col1 raw(16) default sys_guid(),
      col2 varchar2(50),
      col3 varchar2(50)
);

sqlldr control file:
---------------------------
load data
infile 'q.dat'  
into table tab1
fields terminated by ',' optionally enclosed by '"'
(col2 char,
 col3 char)


q.dat:
---------------------------
hello,world
james,bond


Command line:
-----------------------------
sqlldr <username>/<password> control=q.ctl

results:
------------------------------
SQL> select * from tab1;
F1483D1C48D24A0EA22F4BC8C2E6565C
hello
world

D258B94FD519422EBF0D9A347D2075A6
james
bond
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question