path variable

Last Post 06 Jun 2006 11:18 AM by nosepicker. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
roma
New Member
New Member

--
06 Jun 2006 05:49 AM
Hi ,
I have select statement:
Select custNmae, case_id from tbl1 where custID <> 'OLD'
and custName IN
('A*','B*')

And I have SP

create procedure DEL_CAST @case_id varchr20
as
begin
delete from tbl2 where par1=@case_id
delete from tbl3 where pa2r=@case_id

Is there any way to insert select into Sp and add a loop?

Thank you
nosepicker
New Member
New Member

--
06 Jun 2006 06:43 AM
Well, the short answer to your question is "yes". You need to give us more specific information if you want a better answer than that (like exactly what you are trying to accomplish). And what does this have to do with a path variable?
roma
New Member
New Member

--
06 Jun 2006 07:22 AM
This select statement has to find records and path case_id to SP.
SP has to delete data from different tables in DB.
nosepicker
New Member
New Member

--
06 Jun 2006 11:18 AM
Oh come on. You've been posting here long enough to know that you need to give more information than that. If you want us to just guess at what you want, then fine:

delete tbl2
from tbl2 join tbl1
on tbl2.par1 = tbl1.caseid
where tbl1.custID <> 'OLD'
and tbl1.custName IN ('A*', 'B*')

This combines your select statement with your delete statement. I have no idea what you want to use a loop for.
You are not authorized to post a reply.

Acceptable Use Policy