Home>Question Details



-- Thanks for the question regarding "SQLPLUS", version 9.2

Submitted on 25-Nov-2006 12:53 Central time zone
Last updated 25-Nov-2006 17:12

You Asked

Hello Sir,

1. How to reset/Delete value of && variable defined in sqlplus.

Say I do this

select * from &&table ;

and I put value of &&table = emp

Now after I am done with it. I want to delete the value of emp.

So that I can put some new value.I dont want to use &table as this will ask me to put the 
value again and again.
I am using && so that after few statements I need to change its value.

I a single SQLPLUS window I am connecting to various Schemas.

2. How to run an anonymous block in SQlplus script.

If I have a script like  x.sql :
-- start script
delete from emp where empno = 1 ;


begin
-- Test Anonymous block
Delete from dept where empno = 2 ;
end ;
/
--end script

Script fails at the anonymous block.

But if I have 
Script y.sql as
-- start script
begin
-- Test Anonymous block
Delete from dept where empno = 2 ;
end ;
/
--end script

I have the script x.sql as

-- start script
delete from emp where empno = 1 ;

@y.sql ;

--end script
 Then all is fine.

Thanx
 

and we said...

1) for define, the opposite is "undefine"

SQL> undefine table

2) probably because your script in the first case referenced DEPT, not EMP, and DEPT does 
not have a column named empno.

 

Reviews    
3 stars Sir   January 19, 2007 - 3am Central time zone
Reviewer: Raghwendra Mishra from INDIA

Dear Sir,
i want to konw that where does it store sql.script in orcle database

i am waiting for your valuabel guidance

Regards
Raghwendra Mishra




All information and materials provided here are provided "as-is"; Oracle disclaims all express and implied warranties, including, the implied warranties of merchantability or fitness for a particular use. Oracle shall not be liable for any damages, including, direct, indirect, incidental, special or consequential damages for loss of profits, revenue, data or data use, incurred by you or any third party in connection with the use of this information or these materials.

About Oracle | Legal Notices and Terms of Use | Privacy Statement