On Tue, Apr 16, 2002 at 02:24:23PM +0530, Rahul R M Desai wrote:

> I have some procedures and functions in a .sql file. What I need to do
> is 
> 1. create the procedures and functions.
> 2. Execute them.
> 3. Drop the procedures and functions.
>  
> All this I have to do in a perl script.
> I was trying to find a way to create the procedures in the file.
> I tried :
> eval {
>     my $func = $dbh->prepare(  <mailto:'@C:\MyProject\file.sql'>
> '@C:\MyProject\file.sql');

This is sqlplus syntax.  To use this in perl you'll need to read the
sql from the file, then prepare.  Or, you could send it to dbish

>     $func->bind_param(":parameter1", $timestamp); 
>     $func->execute;
>     $dbh->commit;
> };
> which is not working :-)
>  
> Is there any way that I can achieve this.

This also works:
dbish --batch < c:\myproject\file.sql

file.sql:
select * from table_name where column_name = ?
/
1
end file.sql

Tom

-- 
Thomas A. Lowery
See DBI/FAQ http://xmlproj.dyndns.org/cgi-bin/fom

Reply via email to