Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Multiple submit buttons in a jsp form?

843840Oct 4 2007 — edited Mar 28 2008
I've been doing some research and found out that multiple buttons in a JSP form are possible by two ways:

- We can obtain the value of the submit button to know which one was clicked in the parameters of the request using the name of the buttons (which should be the same for all the submit buttons).

- We can change the submit destination using Javascript (Horrible solution since I want my web site to be safe to be used even if Javascript isn't active in clients browsers. I will use it of course since we can do amazing things with it but I want my website to be able to work without it also)

WHAT annoys me is the fact that the value of a submit button is also his text, so if I change the text of the submit button, I will always have to check the servlet to do the corresponding change.

Is there a third choice to be able to use multiple buttons?

Olivier Voutat

Comments

Saubhik
Suggestion is DBMS_LOB
ianf
You can't use CLOB columns in this type of query.
If you really need to do the set operation, then consider using a select doesn't reference the CLOB columns.
802709
if these columns doesnt have more than 4000 char, probably you can use like that (i am not sure):
  select To_Char(ename) from emp1
  MINUS
  select To_Char(ename) from emp2
if fields exceeds 4000 char you must use dbms_lob package.
user13393409
Hi ,

thanks for responding , i used dbms_lob.substr function its working fine
Solomon Yakobson
user13393409 wrote:

thanks for responding , i used dbms_lob.substr function its working fine
Not sure why dbms_lob.substr and not dbms_lob.compare. Anyway, SQL does not support LOB ordering/comparing. You could use PL/SQL. If you want to do in in SQL, you could:
SQL> create table emp1 as select to_clob(ename) ename,deptno from emp
  2  /

Table created.

SQL> create table emp2 as select to_clob(ename) ename,deptno from emp where deptno = 20
  2  /

Table created.

SQL> select * from emp1
  2  minus
  3  select * from emp2
  4  /
select * from emp1
       *
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected - got CLOB


with t1 as (
            select  emp1.*,
                    rownum rn
              from  emp1
           ),
     t2 as (
            select  rn
              from  t1,
                    emp2
              where dbms_lob.compare(t1.ename,emp2.ename) = 0
           ),
     t3 as (
            select  *
              from  t1
              where rn not in (select rn from t2)
           ),
     t4 as (
            select  ename,
                    deptno,
                    rownum rn
              from  t3
           ),
     t5 as (
            select  t41.rn
              from  t4 t41,
                    t4 t42
              where dbms_lob.compare(t41.ename,t42.ename) = 0
                and t41.rn != t42.rn
           )
select  ename,
        deptno
  from  t4
  where rn not in (select rn from t5)
/

ENAME                                                                                DEPTNO
-------------------------------------------------------------------------------- ----------
ALLEN                                                                                    30
WARD                                                                                     30
MARTIN                                                                                   30
BLAKE                                                                                    30
CLARK                                                                                    10
KING                                                                                     10
TURNER                                                                                   30
JAMES                                                                                    30
MILLER                                                                                   10

9 rows selected.
SY.
Herald ten Dam
Hi,

another option to check clobs is to use a HASH function. Take the hash of both clobs. If the hash_value is equal then the clobs are equal, otherwise not. Hash function are provided: DBMS_UTILITY.GET_HASH_VALUE, ORA_HASH (as from 10g) or dbms_crypto.hash.

Herald ten Dam
http://htendam.wordpress.com
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 25 2008
Added on Oct 4 2007
9 comments
2,332 views