Hi Everyone,
Can anyone help me how do i call hash variable in to sql query in perl. Please see the script below
i have defined two Hash %lc and %tab as below
$lc{'REFF'}='V_RES_CLASS';
$lc{'CALE'}='V_CAP_CLASS';
$lc{'XRPD'}='V_XFMR_CLASS';
$tab{'V_RES_CLASS'}='V_MFR_SERS';
$tab{'V_CAP_CLASS'}='V_MFR_SERS';
$tab{'V_XFMR_CLASS'}='V_TFM_MFR_SERIES';
in the query i should use these two hash table varible
my table name is V_CAP_CLASS and attribute is v_MFR_SERIES.
$tbl=$lc{'CALE'};
$att=$tab{$lc{'CALE'}};
query is as below
$sth=$dbh->prepare("select prt.v_prt_nbr, cgy.$att from _prt_class prt, $tbl cgy where prt.obj_id=cgy.obj_id");
this query is not executing throwing below error
DBD::Oracle::db prepare failed: ORA-01747: invalid user.table.column, table.column
Can anyone pls help me.... Appreciate your help.
Thanks