Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Web Application Server 3.0.1 - Enabling Transactions - Help needed
What exactly is not working? the insert? or something else.
One thing I see that might be a problem is aiAge is declare as integer.
When you pass the age from a
form, it's pass as a varchar.
BTW: You should use more of the HTP and HTF packages, it's much cleaner. i.e. Your displayTable could be like this:
procedure displayTable
is
cursor vuTable is select * from TEST_TX; begin htp.tableOpen; for vrTable in vuTable loop htp.tableRowOpen; htp.tableData( vrTable.NOM); htp.tableData(vrTable.AGE); htp.tableRowClose; end loop; htp.tableClose;
Minh
Yves Bolognini wrote:
> Hi,
>
> We've installed the Web Application Server (advanced version)
> and now we would like to enable the transactions. We have done
> everything as explained in the doc
> (see http://www.olab.com/doc/books/plsql/pl_trans.htm), but
> we can not make it work.
>
> Here is our package (spec and body) with
> ...startTest defined as transaction's Begin procedure
> ...commitTX defined as transaction's Commit procedure
> ...rollbackTX defined as transaction's Rollback procedure
>
> Do we miss something ?
>
> Thanks a lot for your help,
>
> Yves Bolognini
> Bolo's Computer Museum - http://www.bolo.ch
>
> ---------------------
> package TEST_TX
> is
> viCount integer := 0;
> procedure startTest;
> procedure displayForm (
> avMessage in varchar2 );
> procedure insertRecord (
> avNom in varchar2,
> aiAge in integer );
> procedure displayTable;
> procedure commitTX;
> procedure rollbackTX;
> end;
> ---------------------
> package body TEST_TX
> is
>
> procedure startTest
> is
> begin
> displayForm('Welcome');
> end;
>
> procedure displayForm (
> avMessage in varchar2 )
> is
> begin
> htp.print(avMessage);
> htp.print('<FORM ACTION="' ||
> owa_util.get_owa_service_path || 'TEST_TX.insertRecord">');
> htp.print('Nom : <INPUT TYPE="TEXT" NAME="avNom"
> SIZE="20"><BR>');
> htp.print('Age : <INPUT TYPE="TEXT" NAME="aiAge" SIZE="3"><P>');
>
> htp.print('<INPUT TYPE="SUBMIT" VALUE="Add">');
> htp.print('<INPUT TYPE="BUTTON" VALUE="Commit"
> onClick="top.location=''' ||
> owa_util.get_owa_service_path || 'TEST_TX.commitTX'';">');
> htp.print('<INPUT TYPE="BUTTON" VALUE="Rollback"
> onClick="top.location=''' ||
> owa_util.get_owa_service_path || 'TEST_TX.rollbackTX'';">');
>
> htp.print('</FORM>');
> displayTable;
> end;
>
> procedure insertRecord (
> avNom in varchar2,
> aiAge in integer )
> is
> begin
> insert into
> TEST_TX
> values (
> avNom,
> aiAge );
> viCount := viCount + 1;
> displayForm('Inserted (' || avNom || ',' || aiAge || ')');
> end;
>
> procedure displayTable
> is
> cursor vuTable is
> select
> *
> from
> TEST_TX;
> begin
> htp.print('<TABLE>');
> for vrTable in vuTable loop
> htp.print('<TR>');
> htp.print('<TD>' || vrTable.NOM || '</TD>');
> htp.print('<TD>' || vrTable.AGE || '</TD>');
> htp.print('</TR>');
> end loop;
> htp.print('</TABLE>');
> end;
>
> procedure commitTX
> is
> begin
> htp.print('Commited ' || viCount || ' rows<P>');
> htp.print('<A HREF="' || owa_util.get_owa_service_path ||
> 'TEST_TX.startTest">Restart</A>');
> viCount := 0 ;
> end;
>
> procedure rollbackTX
> is
> begin
> htp.print('Rolled back ' || viCount || ' rows<P>');
> htp.print('<A HREF="' || owa_util.get_owa_service_path ||
> 'TEST_TX.startTest">Restart</A>');
> viCount := 0 ;
> end;
>
> end;
> ---------------------
Received on Sat Oct 17 1998 - 00:00:00 CDT