1 Reply Latest reply: Jun 3, 2012 8:27 AM by vansul RSS

    ORA-01008: not all variables bound

    936731
      select Board_Prefix into bp from boards where board_id=BoardId;

      stmt:='select t.subject_id, t.Subject_name,s.Class_Id from '|| bp ||'_subject t,modi_class_Subject s where t.subject_id=s.subject_id and s.class_id=:cid and s.b_Id=:BoardId and s.s_id=:sid';
      open getBoardSubject for stmt ;
      Loop
      Fetch getBoardSubject into subId,subName,ClassId;
           exit when getBoardSubject%NOTFOUND;
      htp.p('
      <tr bgcolor=#FFCC99>
      <td align=center>
      <a href="' || OracleBasicPath || 'SchoolLog.ShowSyllabus?cid='||ClassId||'&sid='||sid ||'&subid='||subId||'&BoardId='||BoardId||'">
      <b><font size=2 face=Verdana color=#FF3333>' || subName || '</font></b>
      </a>
      </td>
      </tr>
      ');
      end loop;
      close getBoardSubject;

      during compilation it show no error but on page it show ORA-01008: not all variables bound
        • 1. Re: ORA-01008: not all variables bound
          vansul
          stmt:='select t.subject_id, t.Subject_name,s.Class_Id from '|| bp ||'_subject t,modi_class_Subject s where t.subject_id=s.subject_id and s.class_id=:cid and s.b_Id=:BoardId and s.s_id=:sid';

          open getBoardSubject for stmt using var_cid,var_boardid,var_id ;//////// where var_cid and var_id are the bound variable going
          to use :cid, :boardid and :sid

          if you will not use the using var...... then the error will say that your :cid, :boardid, :sid are not bounded by using statement.