RE: Calling a PostgreSQL function via DBI
- From: rjk-dbi@xxxxxxxxxxx (Ronald J Kimball)
- Date: Thu, 23 Feb 2006 18:13:26 -0500
Christian Stalp [mailto:christian.stalp@xxxxxx] wrote:
This looks very tricky and cryptic. What does it mean? I mean you should
my $sth = $dbh->prepare(<<"EndOfSQL");
SELECT neue_auktion ( ?, ?::text, ?::text,
?::timestamp, ?::timestamp,
?, ?, ? )
EndOfSQL
$sth->execute($cookieValue, $ueberschrift, $beschreibung,
$system_zeit, "2001-11-11 11:11:11",
$startpreis, $startpreis, $kategorie_nummer);
insert the statement "SELECT neue_auktion ( ?, ?::text, ?::text,
?::timestamp, ?::timestamp, ?, ?, ? )" into any perl-function or what is
the
meaning of "<<"EndOfSQL"" ? Never seen this.
It's just a way of creating a string, called a here-document. It allows me
to format the SQL statement nicely. It's documented in perldata if you want
to know more about it.
Here's another way of doing the same thing:
my $sth = $dbh->prepare("SELECT neue_auktion ( ?, ?::text, ?::text,
?::timestamp, ?::timestamp, ?, ?, ? )");
$sth->execute($cookieValue, $ueberschrift, $beschreibung,
$system_zeit, "2001-11-11 11:11:11",
$startpreis, $startpreis, $kategorie_nummer);
Ronald
.
- References:
- RE: Calling a PostgreSQL function via DBI
- From: Christian Stalp
- RE: Calling a PostgreSQL function via DBI
- Prev by Date: RE: Calling a PostgreSQL function via DBI
- Next by Date: RE: Calling a PostgreSQL function via DBI
- Previous by thread: RE: Calling a PostgreSQL function via DBI
- Next by thread: RE: Calling a PostgreSQL function via DBI
- Index(es):
Relevant Pages
|