Run a file using @

Scripts Diversos para o Oracle SQL*Plus. (Relacionado a ferramenta Oracle SQL*Plus, para questões de SQL, usar o forum SQL)
Post Reply
RJG
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 79
Joined: Tue, 16 May 2006 11:40 am
Location: Patos de Minas - MG

Oracle 11g
Windows

I want to abilect the packages below automatically on all client bank!

How to run a file (using @) within an PL / SQL block?

My code was like this:

Select all

declare 
  a varchar2(500); 
BEGIN 
   SELECT SUBSTR(FILE_SPEC, 1, INSTR(FILE_SPEC, '\', -1, 2) -1) into a 
   FROM DBA_LIBRARIES 
   WHERE LIBRARY_NAME = 'DBMS_SUMADV_LIB' 
     and rownum = 1; 
   EXECUTE IMMEDIATE('''@'||a||'\RDBMS\ADMIN\utlmail.sql'''); 
   EXECUTE IMMEDIATE('''@'||a||'\RDBMS\ADMIN\prvtmail.plb'''); 
end;
RJG
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 79
Joined: Tue, 16 May 2006 11:40 am
Location: Patos de Minas - MG

Complementing the above topic!

Select the path of Oracle_Home game within the variable and
I do the @ command!
So you're giving mistake !!
Is there anything like to do ??
This is why Oracle_Home sites can be different, so I use Select!
Thanks
diegolenhardt
Moderador
Moderador
Posts: 1177
Joined: Thu, 15 Oct 2009 10:28 am
Location: Recife

I did not know that the Immediate execute supported this ...

if it's to send email because it does not use UTL_SMTP?

Because if I'm not mistaken the UTL_Mail you will have to set a bank parameter with the SMTP server address.

Then I do not know if you can do dynamically ... already the UTL_SMTP does not need to take anything,
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Have you tried using the scape?

'\ @'
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests