Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Someone help me,rewrite the SP using PL/SQL

565217Mar 5 2007 — edited Mar 5 2007
the 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 2 2007
Added on Mar 5 2007
9 comments
413 views