Rollback Unload Command !
Posted in 1999
Topics: Server Administration, Migration, Import/Export & Data Conversion
Hi All,
I have a problem here...
I gave
begin work;
unload to file1 select * from table1;rollbak work;
It doesnt rollback ? but writes in that file !!! )-;
It also overwrites if there is any file1 existing without prompting u.
Is there any way to rollback anything written on a flat file from unload
command.
"OR"
Is there any way to ask that command tom atleast prompt me once that he is
overwriting an existing file ?
"OR"
Atleast appending the result to that file rather than overwriting.
Another problm...a small one..
In DBACCESS u can write it this way...
dbaccess <Server> -qcrc file1.sql
what this does is...open dbaccess in query mode...choose a file
(file1.sql) run that file and then again come back to "choose" prompt.
Now is there any way to pass file2.sql as a second file.
i tried giving ...
dbaccess <Server> -qcrc file1.sql file2.sql
but it wudnt take...
I can cat all the .sqls in one file and pass it...but i have separate
files which i wudnt like to merge...
Also i dont want to run this whole thing from UNIX PROPMPT. but with
dbaccess...so that i can see if there is any error ...and stop there for
any action...
I guess i have made my problems clear...
TIA,
Nayan Jain
(Perpetual Student !)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It's not true that married men live longer than single men. It only
seems longer."
-- Anonymous
Nayan Jain wrote:
> Hi All,
>
> I have a problem here...
>
> I gave
>
> begin work;
> unload to file1 select * from table1;> rollbak work;
>
> It doesnt rollback ? but writes in that file !!! )-;
The ability to ROLLBACK deals with changes made to the database. You have
not changes anything in the database. You have created a flat file in the O/S.
>
>
> It also overwrites if there is any file1 existing without prompting u.
>
> Is there any way to rollback anything written on a flat file from unload
> command.
Yes, it's called a back up.
>
>
> "OR"
>
> Is there any way to ask that command tom atleast prompt me once that he is
> overwriting an existing file ?
Yes, imbed your "unload to...." in a shell script that first check for the
existence
of the output file.
>
>
> "OR"
>
> Atleast appending the result to that file rather than overwriting.
>
Once again, imbed this into a shell script that creates a temp file,
renames the
original file and then cat the two to the original file name.
>
> Another problm...a small one..
>
> In DBACCESS u can write it this way...
>
> dbaccess <Server> -qcrc file1.sql
>
> what this does is...open dbaccess in query mode...choose a file
> (file1.sql) run that file and then again come back to "choose" prompt.
> Now is there any way to pass file2.sql as a second file.
>
> i tried giving ...
>
> dbaccess <Server> -qcrc file1.sql file2.sql
> but it wudnt take...
>
> I can cat all the .sqls in one file and pass it...but i have separate
> files which i wudnt like to merge...
>
> Also i dont want to run this whole thing from UNIX PROPMPT. but with
> dbaccess...so that i can see if there is any error ...and stop there for
> any action...
I would say test each of your .sql scipts within dbaccess and then run them
from
a script. You are testing, aren't you?
Terry Hillick
CSCS, Inc.
>
>
> I guess i have made my problems clear...
>
> TIA,
> Nayan Jain
> (Perpetual Student !)
>
>
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> "It's not true that married men live longer than single men. It only
> seems longer."
> -- Anonymous