Hello All,

I have a quick question:
Can I use a 'prepare' statement to execute later a "CREATE OR REPLACE
VIEW..." with passing to it a specific param? I.e. something like that:

my $sth_CreateEquityIDsView = $dbh->prepare(q{
CREATE VIEW IDS_COUNT_VIEW AS (
        SELECT ISID.ID_CTXT_TYP, ISS_ID FROM FT_T_ISID ISID, FT_T_ISSU ISSU
                WHERE ISSU.ISS_TYP=:p1
                AND ISSU.INSTR_ID=ISID.INSTR_ID
                AND ISID.END_TMS IS NULL
                AND ISSU.END_TMS IS NULL
union
        SELECT FRIP.PREF_ID_CTXT_TYP, ISID_ISS_ID FROM FT_T_FRIP FRIP,
FT_T_ISSU ISSU
                WHERE ISSU.ISS_TYP=:p1
                AND ISSU.INSTR_ID=FRIP.INSTR_ID
                AND FRIP.PRT_PURP_TYP<>'PRICES'
                AND FRIP.END_TMS IS NULL
                AND ISSU.END_TMS IS NULL
)}) || die $dbh->errstr;

...
...
...

$sth_CreateEquityIDsView->bind_param(1, $iss_typ, {TYPE=>SQL_CHAR});  #
placeholders are numbered from 1
$sth_CreateEquityIDsView->execute(); 


I was getting this error:
DBD::Oracle::st bind_param failed: ORA-01036: illegal variable name/number
(DBD ERROR: OCIBindByName) at prd_GrdIDStatsNew.pl line 288. 
which is:
01036, 00000, "illegal variable name/number"
// *Cause: Unable to find bind context on user side
// *Action: Make sure that the variable being bound is in the sql statement.

If it cannot be done this way, what do you think is the best approach to
achive what I am trying to?

Any help is greatly appreciated,

Regards,

Daniel


____________________________________________________________________

IMPORTANT NOTICES: 
          This message is intended only for the addressee. Please notify the
sender by e-mail if you are not the intended recipient. If you are not the
intended recipient, you may not copy, disclose, or distribute this message
or its contents to any other person and any such actions may be unlawful.
 
         Banc of America Securities LLC("BAS") does not accept time
sensitive, action-oriented messages or transaction orders, including orders
to purchase or sell securities, via e-mail.

         BAS reserves the right to monitor and review the content of all
messages sent to or from this e-mail address. Messages sent to or from this
e-mail address may be stored on the BAS e-mail system.
__________________________________________________________________

Reply via email to