dbTalk Databases Forums  

simple problem

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss simple problem in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
abdoul85
 
Posts: n/a

Default simple problem - 10-15-2007 , 11:03 AM






hello
I'd like to do sth like this:

declare
a varchar(100);
begin
select version into a from v$instance;
if (a like '10%') then
@ver10.sql
else
@oldver.sql
end if;
end;

how to write something like that in PL/SQL ?


Reply With Quote
  #2  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: simple problem - 10-15-2007 , 12:39 PM






abdoul85 wrote:
Quote:
hello
I'd like to do sth like this:

declare
a varchar(100);
begin
select version into a from v$instance;
if (a like '10%') then
@ver10.sql
else
@oldver.sql
end if;
end;

how to write something like that in PL/SQL ?

Looks good - what did you actually try? And it actually is PL/SQL.

And a question: the @ver10 thing is SQL*Plus - not PL/SQL; why
do you want this in PL/SQL when it will not work?
--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...


Reply With Quote
  #3  
Old   
abdoul85
 
Posts: n/a

Default Re: simple problem - 10-15-2007 , 01:08 PM



well, I have two scripts, one suitable for 10 oracle verison, second
for older. And I wan't the code check the oracle database version and
run ver10.sql or older.sql


Reply With Quote
  #4  
Old   
Jerome Vitalis
 
Posts: n/a

Default Re: simple problem - 10-15-2007 , 01:28 PM



On Mon, 15 Oct 2007 16:03:15 +0000, abdoul85 wrote:

Quote:
hello
I'd like to do sth like this:

declare
a varchar(100);
begin
select version into a from v$instance; if (a like '10%') then
@ver10.sql
else
@oldver.sql
end if;
end;

how to write something like that in PL/SQL ?
It should work. Post the error you get.

(And if you intend to install 11g, you'll have to update your test
condition.)


Reply With Quote
  #5  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: simple problem - 10-16-2007 , 01:17 PM



On Oct 15, 1:08 pm, abdoul85 <abdou... (AT) gmail (DOT) com> wrote:
Quote:
well, I have two scripts, one suitable for 10 oracle verison, second
for older. And I wan't the code check the oracle database version and
run ver10.sql or older.sql
Then you code the exact statements you want executed in the PL/SQL
block, as you cannot call a script from within PL/SQL.


David Fitzjarrell



Reply With Quote
  #6  
Old   
DA Morgan
 
Posts: n/a

Default Re: simple problem - 10-17-2007 , 01:10 AM



abdoul85 wrote:
Quote:
hello
I'd like to do sth like this:

declare
a varchar(100);
begin
select version into a from v$instance;
if (a like '10%') then
@ver10.sql
else
@oldver.sql
end if;
end;

how to write something like that in PL/SQL ?
Oracle is not a Microsoft product.

What you wrote is roughly inequivalent to "I'd like to do something
like something I can not code." We have no idea what it is you are
trying to do. Try writing out the business requirement in English.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.