What I wanted is:

  my $sth = $dbh->prepare(q{
    BEGIN select vtr_id into :1 from t_vertraege
      where vtr_nr='$vbb_ver_nr'; 
    END;
  });
  my $vtr_id;
  $sth->bind_param_inout(1, \$vtr_id, 10);
  $sth->execute;

Thanks for your help,
Peter

        -----Urspr�ngliche Nachricht-----
        Von:    Ronald J Kimball [mailto:[EMAIL PROTECTED]]
        Gesendet am:    Mittwoch, 23. Mai 2001 16:01
        An:     Bruhn Peter
        Cc:     [EMAIL PROTECTED]
        Betreff:        Re: Too stupid to bind a variable... :-(

        On Wed, May 23, 2001 at 03:49:02PM +0200, [EMAIL PROTECTED] wrote:
        > Hmmm.... Actually I wanted to use the PL/SQL select into statement
to get
        > the resulting value into a variable... Probably have to use
something like
        > "BEGIN...END" to indicate it is PL/SQL....

        You're trying to get the value into an SQL variable?  I suspect
that's not
        what you really want.  If you want to get the value into a Perl
variable,
        try this:

        my $sth = $dbh->prepare("select vtr_id from t_vertraege where vtr_nr
= ?");
        my $vtr_id = $dbh->selectrow_array($sth, {}, $vbb_ver_nr);

        Ronald

Reply via email to