DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: export

  1. #1
    Join Date
    May 2002
    Posts
    232
    Hiiiiiii,any one can help me how to export the single table data from the sql prompt in sunsolaris with oracle9i.
    I am using telnet.
    soon
    thanks
    kavitha
    kavitha

  2. #2
    Join Date
    Apr 2002
    Posts
    135
    hai as far as i know,

    if you want to export data from one table to another existing table of same structure then can do

    SQL > insert into table2 select * from table1

    if you want to export data from one table to another non existing table then can do

    SQL > create table table2 as select * from table1



  3. #3
    Join Date
    May 2002
    Posts
    232
    hiii,i need to export into textfile.
    thanks
    kavitha

  4. #4
    Join Date
    Apr 2002
    Posts
    135
    to a text file means,

    u got to use UTL_FILE Package.


    or else try this. I haven't

    spool
    select * from table1


  5. #5
    Join Date
    May 2002
    Posts
    232

    export

    hi give me syntax
    thanks
    kavitha

  6. #6
    Join Date
    Apr 2002
    Posts
    135
    Hope this helps you, there may be someother way also.

    declare
    v_type utl_file.file_type;
    field1 number(10);
    field2 varchar(20);
    cur c1 is select * from table1;
    begin
    v_type=utl_file.fopen('pathname','filename','a',5000);

    --a -append mode
    --5000 -- buffersize

    for curs in c2 loop
    field1:=curs.f1;-- first field
    field2:=curs.f2; -- second field
    utl_file.put_line(v_type,field1||','||field2);
    end loop;
    utl_file.fclose_all;
    end;

    hopethis helps.i know this basic thing.I tried out this long before.


    [Edited by sona on 06-18-2002 at 07:42 AM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width