Hi Guys I am new at oracle(SQLPlus ,as well) I am trying to run a sql file which contains more than 500 alter statement which is suppose to alter all of my tables.After running the @alterTab.sql in sqlplus the result display at cmd command but I can's navigate to previous pages to to see what table didn't alterd, so I tried to add a spool command at the top of my sql file like

SPOOL C:\_Result.txt
alter table TMN add( mpk varchar2(30), mfk varchar2(30) );
alter table TWE add( mpk varchar2(30), mfk varchar2(30) );
.
.
.
SPOOL OFF

But this just create an empty txt file(_Result.txt) at C drive. Can you guys please let me know how I can spool all the cmd (SQLPlus) output on a file to see what is the result

Member Avatar for hfx642

First of all, NEVER start a filename with the "_" (underscore) character.
Some people can/do, but is really shouldn't be done.

Second, I always end ALL of my commands with the ";" (semicolon).
It's just proper syntax.

Third, I always end a sequence of commands with a "commit;", however redundant it may be. (Just like initializing a variable in the declaration, and then reinitializing the variable before using it. Just for "piece of mind".)

Thanks man,
I got the point and it is working fine now.

Member Avatar for hfx642

No problem.
Good programming habits, like good manners, always works for the best.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.