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: Beginning

Re: Beginning

From: Tim Cross <tcross_at_nospam.une.edu.au>
Date: 31 Oct 2002 09:05:58 +1100
Message-ID: <87adkvk2ex.fsf@blind-bat.une.edu.au>


"tou" <tou_at_tou.tou> writes:

> Hi,
>
> 1 - I used TOAD for exporting some rows with fields separated by ; very
> easy... Now I woul perform an automatic exporta of o table but I can't find
> information about how to do it with SQL Plus console...
>
> I know that with spool command I can 'export' to file, but how can I export
> with fields separated by :, or tab or anything else ?
>
> 2 - Can I call external programs with triggers ? In fact I want to export a
> table each time a change is made on it...
>

  1. You need to concatenate the fields together with whatever character you want to separate them. Use || for this e.g.

select field1 ||';'||field2||';'||....
from table.

Personally, I prefer to use a character to separate fields which is unlikely to be any any of the fields. for example, you can use a tab by using the chr() function e.g. chr(9).

2. Eeek! What your suggesting is possible but sounds very

   scarey. Impact on performance might be extremely high. Plus, I    think you need to consider the impact of commits and    rollbacks. Also, what happens if two changes are made to the table    at almost the same time with respect to your dump file?

   I would really try to think of an alternative approach. Maybe you    don't need to export as soon as a change is made - maybe your    trigger could set a flag in some table to indicate a change has    occured and another process could run periodically which checks    this flag and does an export when necessary?

Tim Received on Wed Oct 30 2002 - 16:05:58 CST

Original text of this message

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