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 -> like clause('%..%') in dbms_sql..

like clause('%..%') in dbms_sql..

From: <umagri_at_my-dejanews.com>
Date: Fri, 11 Dec 1998 00:22:54 GMT
Message-ID: <74poks$brr$1@nnrp1.dejanews.com>


hi,
i am trying to locate a string(that i pass in as a parameter in the procedure) ie; select col1 from sometable where col2 like '%param_in%'; i know there are many records, but my procedure is getting me nowhere. what am i doing wrong?
is something wrong with the way iam doing the bind? thanks in advance,
--uma

create or replace procedure someproc(param_in varchar2) as

--variables and cursor declaration

begin
tablecur:=dbms_sql.open_cursor;
open c1;
loop
fetch c1 into tname;
exit when c1%notfound;

	begin
	stmt:='select col1 from '||tname||' where col2 like :theoldname';
	dbms_sql.parse(tablecur, stmt, dbms_sql.v7);
	dbms_sql.bind_variable(tablecur, ':theoldname', '%param_in%');
	retval:=dbms_sql.execute(tablecur);

.
.
.

end loop;
close c1;
end;

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Dec 10 1998 - 18:22:54 CST

Original text of this message

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