' skapa din tabell
drop table COMMAND_TEST
/
CREATE TABLE COMMAND_TEST
(
aKey_Value Varchar(10) not null,
aInteger_Value Number(10),
aCurrency_Value Number(15,8),
aString_Value Varchar2(255)
)
PCTFREE 30
PCTUSED 60
TABLESPACE (your work tablespace name - you must have create table and procedure priviledges for this tablespace)
STORAGE (
INITIAL 20k NEXT 40k
);
' skapa din procedur
CREATE OR REPLACE PROCEDURE Oracle_Procedure(pInteger_Value in Number, pCurrency_Value in Number, pString_Value in Varchar2,pKey_Value in Varchar2, sCommand in Varchar2) IS
BEGIN
if sCommand = 'Insert' then
insert into Command_Test
(
aInteger_Value,
aCurrency_Value,
aString_Value,
aKey_Value
)
values
(
pInteger_Value,
pCurrency_Value,
pString_Value,
pKey_Value
);
end if;
if sCommand = 'Update' then
Update Command_Test
set
aInteger_Value=pInteger_Value,
aCurrency_Value=pCurrency_Value,
aString_Value=pString_Value
where
aKey_Value=pKey_Value;
end if;
if sCommand = 'Delete' then
delete from Command_Test
where
aKey_Value=pKey_Value;
end if;
commit;
END Oracle_Procedure;
/