Not sure I follow exactly what you're after?

You could $dbh->do a create or replace function step at the beginning of
your perl script to ensure that the function exists (I guess you could
select from the dictionary to check before bothering), or you could
re-write your oracle function as a perl function and select the actual
bytestring to pass to this function instead.

Ken.


-----Original Message-----
From: Riccardo Bonuccelli [mailto:[EMAIL PROTECTED]
Sent: 06 September 2006 10:40
To: Steve Baldwin
Cc: [email protected]
Subject: Re: DBI custom functions

Thanks Steve,

I agree, you can call the function this way, but then you have to be
sure
that the function is already defined in Oracle. I was wondering if there
is
a way to define the function with DBI..


2006/9/6, Steve Baldwin <[EMAIL PROTECTED]>:
>
> You should be able to simply use the function in the SQL within your
Perl
> script.  For example :
>
> my $sth = $dbh->prepare(q(
>     SELECT  my_func(raw_data)
>     FROM    my_table
> ));
>
> etc
>
> If you can use the function in SQL*Plus, you can use it with Perl/DBI.
>
> HTH,
>
> Steve
>
> > -----Original Message-----
> > From: Riccardo Bonuccelli [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, 6 September 2006 6:37 PM
> > To: [email protected]
> > Subject: DBI custom functions
> >
> > Hello there,
> >
> > I must retrieve a particular field from an Oracle DB with perl/DBI.
This
> > field is actually formatted as a kind of bytestring and I developed
an
> > oracle function to retrieve that field in a correct way, but as I
told I
> > have to connect through DBI.
> >
> > So the question is:
> > Is there a way to define custom functions to be used in a dbi
session?
> >
> > Thanks in advance.
> >
> > --
> > Riccardo
> > http://www.flickr.com/photos/askthepixel
>
>
>


--
Riccardo
http://www.flickr.com/photos/askthepixel


****************************************************************************************************************************************************
This e-mail and any accompanying documents contain confidential information 
intended for a specific individual which is private and protected by law.
If you are not the intended recipient, any disclosure, copying, distribution or 
other use of this information is strictly prohibited.
You are also requested to advise us immediately if you receive information 
which is not addressed to you.
beCogent is Authorised and Regulated by the Financial Services Authority.
*****************************************************************************************************************************************************

Reply via email to