Home » SQL & PL/SQL » SQL & PL/SQL » passing values to the object
passing values to the object [message #203394] Wed, 15 November 2006 00:38 Go to next message
guru_karnam
Messages: 142
Registered: May 2005
Senior Member
create or replace type servSession as object
(
cpCode varchar2(Cool,
sCode varchar2(Cool,
opDate date,
sessionNr integer,
recurSessID integer,
descr varchar2(200),
ipAddrSuffStart integer,
portStart integer,
ProtectionprotocolEnum varchar2(Cool,
ipSecAuthSeed varchar2(32),
ipSecEncryptionSeed varchar2(32),
ipeMgmtStatus varchar2(Cool,
ipeMgmtIds varchar2(500),
NOfIPERetries number,-- 3.1 release
sessionProfileCode number,
castingTime integer,
castingDuration integer,
bitRate integer,
totalPrice number(16,6),
schValStatus varchar2(Cool,
schValInfo varchar2(200),
nofRecvPackMin integer,
nofRecvPackAvg integer,
nofRecvPackMax integer,
nofSentPackMin integer,
nofSentPackAvg integer,
nofSentPackMax integer,
ERRORCORRECTIONPERCENTAGE NUMBER(2),
PriorityNumber NUMBER(2),
isDeleted char(1),
modifDate date,
modifUser varchar2(20)
)



create or replace procedure insertServiceSession (
i_addSession in servSession
) as

begin

insert into ServiceSession
(contentProviderCode,
serviceCode,
operationalDate,
sessionNumber,
recurringSessionId,
Description,
ipAddressSuffixStart,
portRangeStart,
protectionprotocolenum,
ipsecauthenticationseed,
ipsecencryptionSeed,
sessionprofileId,
castingTime,
castingDuration,
bitRate,
totalPrice,
scheduleValidationStatusEnum,
scheduleValidationInfo,
ErrorCorrectionPercentage,
PriorityNumber,
isDeleted)
select i_addSession.cpCode,
i_addSession.sCode,
i_addSession.opDate,
i_addSession.sessionNr,
i_addSession.recurSessID,
i_addSession.descr,
i_addSession.ipAddrSuffStart,
i_addSession.portStart,
i_addSession.protectionprotocolenum,
i_addSession.ipsecauthseed, --for release 3.1.1
i_addSession.ipSecEncryptionSeed,
i_addSession.sessionprofilecode,
i_addSession.castingTime,
i_addSession.castingDuration,
i_addSession.bitRate,
i_addSession.totalPrice,
i_addSession.schValStatus,
i_addSession.schValInfo,
i_addSession.ErrorCorrectionPercentage,
case
when sign(i_addSession.Prioritynumber) = -1 then
null
else
i_addSession.Prioritynumber
end ,
i_addSession.isDeleted
from dual;
commit;
end;




Execute the proc insertServiceSession in sqlplus.

How do i pass values to the object i_addsession???
































Re: passing values to the object [message #203399 is a reply to message #203394] Wed, 15 November 2006 00:47 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Hi.

Try following:


DECLARE
testParm servSession;
BEGIN

testParm.cpCode := 'X';
testParm.sCode := 'X';
testParm.opDate := SYSDATE;
testParm.sessionNr := 99;
testParm.recurSessID := 99;
testParm.descr := 'Test';
testParm.ipAddrSuffStart := 99;
...
insertServiceSession (testParm );

END;

HTH.


Re: passing values to the object [message #203456 is a reply to message #203399] Wed, 15 November 2006 03:26 Go to previous message
guru_karnam
Messages: 142
Registered: May 2005
Senior Member
Is it not possible through a single stmt

through exec procedure?

exec insertservicesession( );


?
Previous Topic: Transaction Management in Stored Procedures....
Next Topic: Select non-existing combinations
Goto Forum:
  


Current Time: Sun Dec 11 04:38:09 CST 2016

Total time taken to generate the page: 0.08659 seconds