Hi, I am trying to pass a variable to a PL/SQL block like this
$dbh->func( 1000000, 'dbms_output_enable' ); $user_location = "NYC"; $sth = $dbh->prepare(q{ DECLARE name VARCHAR2(50); address1 VARCHAR2(50); address2 VARCHAR2(50); address3 VARCHAR2(50); phone VARCHAR2(50); fax VARCHAR2(50); fax1 VARCHAR2(50); BEGIN select name, address1, address2, address3 || ' ' || state || ' ' || zip_cnty, 'PHONE: ' || telephone, 'FAX: ' || +fax, fax || '.' into name, address1, address2, address3, phone, fax, fax1 from custdata2 where custdata2.code = $user_location; dbms_output.put_line('The value is '||name); END; }); $sth->execute; $dbh->func( $date_string, 'dbms_output_put' ); $values = $dbh->func('dbms_output_get' ); $sth->finish; print "Returned $values \n";
------------------------------- but its giving me the error
DBD::Oracle::st execute failed: ORA-06550: line 43, column 33: PL/SQL: ORA-00911: invalid character
Please suggest

In reply to Problem in passing value to a PL/SQL block by denzil_cactus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.