Someone help me,rewrite the SP using PL/SQL
565217Mar 5 2007 — edited Mar 5 2007the following SP is written in T-SQL,now I want to rewrite it with PL/SQL,who can help me ? tks
CREATE PROCEDURE dbo.TEST_Proc_Jerry_OB @CountDay Char(8)
AS
Declare @UserID varchar(50)
Declare @Count int
Declare @SuccCount int
Declare @UnSuccCount int
create table tbTEST_Proc_Jerry_OB (
agentalias varchar(255),
count1 int,
count2 int,
count3 int
)
Set @UserID = 'kokuyo6'
select @Count = count(*),
@SuccCount = sum(case when DialFlag='0' then 1 else 0 end),
@UnSuccCount = sum(case when DialFlag='0' then 0 else 1 end)
from tbobcdrmast where
left(starttime,8)=@CountDay
and agentalias='kokuyo6'
group by agentalias
Order By AgentAlias
Insert Into tbTEST_Proc_Jerry_OB Values(@UserID, @Count, @SuccCount ,@UnSuccCount)
Select * From tbTEST_Proc_Jerry_OB
drop table tbTEST_Proc_Jerry_OB
GO