Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: Creating sql files taking data from oracle tables

    hi,

    I want to create .sql files taking data from oracle tables through VB.

    Any ideas...

    Regards

  2. #2
    Join Date
    Sep 2003
    Location
    Virginia, USA
    Posts
    246

    Re: Creating sql files taking data from oracle tables

    You should specify what a .sql file is, since we can use that extension for files containing a single command, a series of commands, or environment variable SET instructions in SQL*Plus.

    Supposing you want a file that has commands in it, you can do something like this ...

    SET TRIMSPOOL ON FEEDBACK OFF VERIFY OFF;
    SPOOL c:\temp\test.sql;
    SELECT col1 [|| separator text || colN] FROM tab1 [, tabN];
    SPOOL OFF;
    @c:\temp\test.sql;

    for example,
    ...
    SELECT 'ALTER TABLESPACE ' || tablespace_name || ' BEGIN BACKUP;'
    FROM DBA_TABLESPACES
    WHERE TABLESPACE_NAME LIKE 'MYAPP%';
    ...

    -Mark

  3. #3
    Join Date
    Oct 2003
    Posts
    3
    hi Mark,

    Actually, i want to copy data of some oracle tables into text files each of a particular size.

    I have to write code in vb6.0... ..

    After that i've to convert data from those text files into or say copy them to MySql tables.

    For all this, the first step is to convert data from say 2-3 tables into text files. Now, how should i go about it. Any code samples.

    Regards

Posting Permissions

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