SQL Server to Oracle

Chris Sol <[email protected]> Thu, 6 Mar 2003 11:07:18 -0000
Newsgroups gmane.comp.db.oracle.devel
Message-ID <LYRIS-1796914-900460-2003.03.06-11.02.07--gcdod-oracle#[email protected]>
Hi 

these are the 3 types of stored procedures I used to run on SQL Server - I
need the equivalent on Oracle:
********************************************************
1 Drop table:
CREATE proc drop_table
as
drop table table1
********************************************************
2 Create & alter table 'on-the-fly' based on the date within a view:
CREATE proc create_table
as
CREATE TABLE table1
	(column1 varchar(17) NOT NULL,
	 column2 nvarchar(30) NULL)
insert	table1
select	*
from	table1_view
ALTER TABLE table1 
	ADD CONSTRAINT PK_table1
	PRIMARY KEY CLUSTERED (column1) ON [PRIMARY]
********************************************************
3 Execute the refresh sp as a scheduled job (drop and re-create table):
CREATE proc table_refresh
as
select 'Start time: ' + convert(varchar(20), getdate(), 120)
exec 	drop_table
select 'DB refresh completed (drop_table) / End time: ' +
convert(varchar(20), getdate(), 120) 
exec    create_table
select 'DB refresh completed (create_table) / End time: ' +
convert(varchar(20), getdate(), 120) 
select 'End time: ' + convert(varchar(20), getdate(), 120)
********************************************************

Thanks

Chris Sol
Analyst Programmer
IT Development
Genesis Housing Group
Telephone 02085374169


****************************************************************************
The Genesis Housing Group - Email Disclaimer
--------------------------------------------
The information in this email and any attachments is strictly
confidential and may be legally privileged.
It is intended solely for the use of the addressee(s) only. Access to
this email by anyone else is unauthorised.  If you have received this
email in error please notify the sender immediately by return email or
telephone.  Please note that if you are not the intended recipient, you
must not copy, distribute or otherwise act on any part of this email or
it's attachments.
Although we have taken precautions to ensure that this email and
attachments are free from any virus, we would advise you that it is your
responsibility to ensure that this is true when reading or actioning
this email.

---
Change your mail options at http://p2p.wrox.com/manager.asp or 
to unsubscribe send a blank email to [email protected].