Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Delete with pameters

Re: Delete with pameters

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 29 Nov 2001 08:03:27 -0800
Message-ID: <9u5m8f01b66@drn.newsguy.com>


In article <ac1562ed.0111290031.595437f4_at_posting.google.com>, ramirez134_at_hotmail.com says...
>
>I Have A Form where you can select which names you want to delete:
>CREATE OR REPLACE procedure REMOVE1
>AS
>AS
>CURSOR csr IS
> SELECT NAME,ID
> FROM TABLE
>BEGIN
>htp.formOpen('remove2');
>
>FOR trec IN csr LOOP
>htp.p(trec.name);
>htp.p(trec.id);
>htp.p('<input type="checkbox" name="remove_value" value="'||trec.name||'">');
>htp.br;
>END LOOP;
>htp.formSubmit();
>htp.formClose;
>
>AND I have procedure that will remove selected items
>
>
>
>CREATE OR REPLACE procedure REMOVE2
>(
>remove_value owa_text.vc_arr,
>)
>BEGIN
>FOR i IN 1 .. remove_value.count LOOP
>DELETE FROM TABLE WHERE NAME = remove_value(i);
>END LOOP;
>
>Now I send only name field to the procedure, but what I have to do that I can
>send also ID field and delete compination match?
>
>I have try these without success:
>FORM
>htp.p('<input type="checkbox" name="remove_value"
>value="'||trec.name||' AND ID = ||trec.id">');

make the value be:

  value="' || htf.escape_sc( to_char(trec.id,'0000000009') || trec.name ) '">

>
>PROCEDURE
>DELETE FROM TABLE WHERE NAME = remove_value(i);

  delete from table
   where name = substr( remove_value(i), 12 )      and id = to_number( substr( remove_value(i), 1, 11 ) )

>
>Problem with this is that it try find NAME = "name_value and ID = id_value"
>match
>
>
>
>Hope You Understand what I Mean
>Rami Huhtala

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Thu Nov 29 2001 - 10:03:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US