Обсуждение: SPI using perl
Hi
I was wondering if its necessary to download DBI::PgSPI package from CPAN to use spi_exec_query in perl
or it can be used without downloading the above mentioned package. I've tried using spi_exec_query without that package
but doesn't work.
Thanks,
Jas
I was wondering if its necessary to download DBI::PgSPI package from CPAN to use spi_exec_query in perl
or it can be used without downloading the above mentioned package. I've tried using spi_exec_query without that package
but doesn't work.
Thanks,
Jas
Jasbinder Singh Bali wrote: > Hi > I was wondering if its necessary to download DBI::PgSPI package from > CPAN to use spi_exec_query in perl No. Using plperl is the way to go. See the docs there are examples under plperl. Joshua D. Drake > or it can be used without downloading the above mentioned package. I've > tried using spi_exec_query without that package > but doesn't work. > > Thanks, > Jas -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/
my $query = "SELECT sp_insert(" . $a . "," . $b . "," . $c . ")";
my $exec_query = spi_exec_query($query);
here i'm calling a function sp_insert and passing parameters a,b,c to it.
Is this the right usage to spi_exec_query?
Thanks,
~Jas
my $exec_query = spi_exec_query($query);
here i'm calling a function sp_insert and passing parameters a,b,c to it.
Is this the right usage to spi_exec_query?
Thanks,
~Jas
On 6/22/07, Joshua D. Drake <jd@commandprompt.com > wrote:
Jasbinder Singh Bali wrote:
> Hi
> I was wondering if its necessary to download DBI::PgSPI package from
> CPAN to use spi_exec_query in perl
No. Using plperl is the way to go. See the docs there are examples under
plperl.
Joshua D. Drake
> or it can be used without downloading the above mentioned package. I've
> tried using spi_exec_query without that package
> but doesn't work.
>
> Thanks,
> Jas
--
=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/
Jasbinder Singh Bali wrote: > my $query = "SELECT sp_insert(" . $a . "," . $b . "," . $c . ")"; > my $exec_query = spi_exec_query($query); > > here i'm calling a function sp_insert and passing parameters a,b,c to it. > > Is this the right usage to spi_exec_query? http://www.postgresql.org/docs/8.2/static/plperl-database.html Joshua D. Drake > Thanks, > ~Jas > > > On 6/22/07, *Joshua D. Drake* <jd@commandprompt.com > <mailto:jd@commandprompt.com>> wrote: > > Jasbinder Singh Bali wrote: > > Hi > > I was wondering if its necessary to download DBI::PgSPI package from > > CPAN to use spi_exec_query in perl > > No. Using plperl is the way to go. See the docs there are examples under > plperl. > > Joshua D. Drake > > > or it can be used without downloading the above mentioned > package. I've > > tried using spi_exec_query without that package > > but doesn't work. > > > > Thanks, > > Jas > > > -- > > === The PostgreSQL Company: Command Prompt, Inc. === > Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 > Providing the most comprehensive PostgreSQL solutions since 1997 > http://www.commandprompt.com/ > > Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate > PostgreSQL Replication: http://www.commandprompt.com/products/ > > -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/