Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Plus: How can I write each record to a separate file

Re: SQL*Plus: How can I write each record to a separate file

From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 09 Sep 2006 01:50:32 -0700
Message-ID: <1157791833.261695@bubbleator.drizzle.com>


zrwcvhsosoik001_at_sneakemail.com wrote:
> DA Morgan wrote:

>> Sybrand Bakker wrote:
>>> On 8 Sep 2006 12:24:16 -0700, zrwcvhsosoik001_at_sneakemail.com wrote:
>>>
>>>> Well, that was my point about being platform independent. The script
>>>> needs to run on Linux, unix and windows. Database versions 9.2 and 10
>>> exp records=n
>>>
>>> --
>>> Sybrand Bakker, Senior Oracle DBA
>> Amazing how simple things get when people tell you what they are
>> actually trying to do.
>>
>> Far too many times it seems we try to help someone only to find out that
>> their requirement is nothing like their "simplified" example.
>> --
>> Puget Sound Oracle Users Group

>
> Hmm, yes well the simplified solution doesn't however meet the
> requirement:
> I require one script per table, for purposes of version control. The
> name of the file will
> reflect the table name.
> Just a bit more background: We want to store the data model in a source
> control system. It needs to be human-readable/editable (it is source
> code, after all). And having one file per object makes traceability of
> changes much easier. The version control system (subversion in our
> case) will tell you which file changed when.
> Ok, now why generate the source from the database (which seems
> backward). The reality is that our developers do make changes in their
> development database. They then need to move these changes back into
> the source files. I think that using DBMS_METADATA is an elegant way of
> doing this.
> A SQL*Plus script to do this shouldn't be too hard. The thread started
> out with my problem: how can I write to multiple files in one script.
>
> Thanks for everybodys input do far. Much appreciated.

I think you are unnecessarily complicating a remarkably simple thing.

You have yet to enunciate the actual business requirement. Why do you require a separate script per table rather than one script per application or one script per schema? How about objects that are not tables. And if it is a DBA requirement why can't it write to the server.

While I don't know what you are being asked to do your requests are all over the map and have yet to correspond with any legitimate business requirement I have ever seen.

But to answer your final question I don't know how you can write it. I wouldn't. And I don't believe you should either.

-- 
Daniel Morgan
Puget Sound Oracle Users Group
Received on Sat Sep 09 2006 - 03:50:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US