how to create control files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • san1014
    New Member
    • Jul 2007
    • 37

    how to create control files

    Hi
    I am using oracle 9i
    I want to import the excel sheet data into the database.

    i have an excel sheet to import the data into the database in node table.
    SQL> desc node
    Name Type Nullable Default Comments
    ----------- ------------ -------- ------- --------
    USER_ID NUMBER(6)
    SCENARIO_ID NUMBER(9)
    STATE_ID VARCHAR2(20)
    DIST_ID VARCHAR2(20)
    NODE_ID VARCHAR2(20)
    NODE_NAME VARCHAR2(40)
    NODE_TYPE VARCHAR2(25)

    Please let me know how to create the control file?
    and how to import that control file into DB using sql loader?

    Any Help?
    Thank you
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by san1014
    Hi
    I am using oracle 9i
    I want to import the excel sheet data into the database.

    i have an excel sheet to import the data into the database in node table.
    SQL> desc node
    Name Type Nullable Default Comments
    ----------- ------------ -------- ------- --------
    USER_ID NUMBER(6)
    SCENARIO_ID NUMBER(9)
    STATE_ID VARCHAR2(20)
    DIST_ID VARCHAR2(20)
    NODE_ID VARCHAR2(20)
    NODE_NAME VARCHAR2(40)
    NODE_TYPE VARCHAR2(25)

    Please let me know how to create the control file?
    and how to import that control file into DB using sql loader?

    Any Help?
    Thank you
    Check here and here for detail

    Comment

    • subashsavji
      New Member
      • Jan 2008
      • 93

      #3
      Originally posted by san1014
      Hi
      I am using oracle 9i
      I want to import the excel sheet data into the database.

      i have an excel sheet to import the data into the database in node table.
      SQL> desc node
      Name Type Nullable Default Comments
      ----------- ------------ -------- ------- --------
      USER_ID NUMBER(6)
      SCENARIO_ID NUMBER(9)
      STATE_ID VARCHAR2(20)
      DIST_ID VARCHAR2(20)
      NODE_ID VARCHAR2(20)
      NODE_NAME VARCHAR2(40)
      NODE_TYPE VARCHAR2(25)

      Please let me know how to create the control file?
      and how to import that control file into DB using sql loader?

      Any Help?
      Thank you

      may be this will be helpful to you.

      create table clobdemo
      ( id int primary key,
      theclob clob
      );
      /

      create or replace directory my_files as 'C:\';
      /

      create or replace procedure load_file
      as
      l_clob clob;
      l_bfile bfile;
      begin
      insert into clobdemo values ( 1, empty_clob() )
      returning theclob into l_clob;
      l_bfile := bfilename( 'MY_FILES', 'yy.txt' );
      dbms_lob.fileop en( l_bfile );
      dbms_lob.loadfr omfile( l_clob, l_bfile,
      dbms_lob.getlen gth( l_bfile ) );
      dbms_lob.filecl ose( l_bfile );
      end;
      /

      EXECUTE load_file
      /
      SELECT DBMS_LOB.SUBSTR (THECLOB,4000,1 ) FROM CLOBDEMO;
      /

      or use sql loader

      Comment

      Working...