Christian Stalp [mailto:[EMAIL PROTECTED] wrote:
> >
> > 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);
> >
> This looks very tricky and cryptic. What does it mean? I mean you should
> 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