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 -> (?) bind variables not helping at all..

(?) bind variables not helping at all..

From: tone <dmclaude_at_yahoo.com>
Date: 26 Aug 2002 14:00:45 -0700
Message-ID: <5fff533a.0208261300.61bfbc76@posting.google.com>


im just learning oracle.. (newbie pretty much).. and i was told about the great and awesome wonders of bind variables.. then how come im getting this result (from trace file)

----------------->

SELECT ACNO,CHKNO,IPPRECDATE,CUSTID,ASOFDATE,PAIDDATE,AMT,HASDECISION,   ADDITIONALINFO,CPCS,BELOWTHRESH,DECISIONTN FROM
 PNI WHERE HASDECISION LIKE :b1 AND ACNO LIKE :b2 AND CHKNO LIKE :b3   AND IPPRECDATE BETWEEN :b4 AND :b5 ORDER BY IPPRECDATE,ACNO,CHKNO,   HASDEC call count cpu elapsed disk query current rows
------- ------ ----- -------- ------- ------- -------- ----------

Parse        4   0.00     0.01       0       0        0           0
Execute      4   0.00     0.00       0       0        0           0
Fetch      486   0.46     0.51     117     463       18        4835

------- ------ ----- -------- ------- ------- -------- ----------
total 494 0.46 0.52 117 463 18 4835

Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 84 (recursive depth: 1)

Rows Row Source Operation
------- ---------------------------------------------------

     87  SORT ORDER BY 
     87   TABLE ACCESS FULL PNI 

---------------->

am i doing something drastically wrong? i mean i have been using bind variables.. but im still getting a parse/execute ratio of 1 (which i am told, is pretty dam' horrendous)..

the actual stored procedure follows..

help me out somebody...
-tone

-------------store procedure --------------------->

CREATE OR REPLACE PACKAGE BODY testSearch AS

procedure Search (	p_in_acno		IN	NUMBER,
			p_in_chkno		IN	NUMBER,
			p_in_fromdate		IN	DATE,
			p_in_todate		IN	DATE,
			p_in_hasdec	        IN	VARCHAR,
			p_out_returncode	OUT 	NUMBER,
			p_out_returncursor 	OUT 	RETURNCURSOR	) AS

v_hasdec        varchar2(1);
v_acno		varchar(13);
v_chkno		varchar(10);
v_startdate	date;
v_enddate	date;

		

		BEGIN
		
			if (p_in_hasdec IS NOT NULL) then 
				v_hasdec := p_in_hasdec;
				else
				v_hasdec := '%';
			end if;


			if (p_in_acno IS NOT NULL) then
				v_acno := p_in_acno;
				else 
					v_acno := '%';
			end if;


			if (p_in_chkno IS NOT NULL) then
				v_chkno := p_in_chkno;
				else
					v_chkno := '%';
			end if;


			if (p_in_fromdate IS NOT NULL) then
				v_startdate := p_in_fromdate;
				else
					v_startdate := TO_DATE('January 15, 2000',    'Month dd, YYYY');
			end if;

		
			if (p_in_todate IS NOT NULL) then
				v_enddate := p_in_todate;
				else
					v_enddate := SYSDATE+1;
			end if;


			p_out_returncode := 0;

			open p_out_returncursor for SELECT	  
			  acno			,
			  chkno			,
			  ipprecdate		,
			  custid		,
			  asofdate		,
			  paiddate		,
			  amt			,
			  hasdec		,
			  additionalinfo	,
			  cpcs			,
			  belowthresh		,
			  decisiontn	
			FROM 	test
			WHERE	
				hasdec  	like v_hasdec
			AND	acno 		like v_acno
			AND	chkno		like v_chkno
			AND	ipprecdate 	between
							TRUNC(v_startdate)
						and
							TRUNC(v_enddate)
			order by ipprecdate, acno, chkno, hasdec;


		exception
			WHEN OTHERS THEN p_out_returncode := 8;	
		
		END Search;

END testSearch;
/
-----------------end stored proc------------->
Received on Mon Aug 26 2002 - 16:00:45 CDT

Original text of this message

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