--- Procedure Name 'GetCashAccountByUserNumber'
--------------------------------------------------------------
CREATE OR REPLACE PROCEDURE GetCashAccountByUserNumber
(p_CREATEDBY IN NUMBER := NULL,
p_CREATEDDATE IN DATE := NULL,
p_UPDATEDBY IN NUMBER := NULL,
p_UPDATEDDATE IN DATE := NULL,
p_IPADDRESS VARCHAR2 := NULL,
p_FORMID IN NUMBER := NULL,
p_UserNumber IN NUMBER DEFAULT NULL,
p_BankKey IN NUMBER DEFAULT NULL,
cur_OUT IN OUT SYS_REFCURSOR)
AS
BEGIN
OPEN cur_OUT FOR
SELECT UserAccounts.UserKey,
UserAccounts.AccountTypeKey,
UserAccounts.UserNumber,
SysAcct.SystemAccountID,
SysAcctRefUsAcct.SystemAccountRefID,
SysAcctRefUsAcct.UserCurrentBalance,
SysAcctRefUsAcct.BlockedAmount,
SysAcctRefUsAcct.IsVAT,
SysAcctRefUsAcct.IsCOM,
SysAcctRefUsAcct.IsActive,
SysAcctRefUsAcct.ParentCode,
SysAcct.AccountNumber,
SysAcct.AccountDescription,
UserAccounts.UserNumber ParentUserNumber
FROM SysAcct
JOIN SysAcctRefUsAcct
ON SysAcct.SystemAccountID = SysAcctRefUsAcct.SystemAccountID
JOIN UserAccounts
ON SysAcctRefUsAcct.UserKey = UserAccounts.UserKey
JOIN Bank
ON SysAcctRefUsAcct.BankKey = Bank.BankKey
AND UserAccounts.BankKey = Bank.BankKey
WHERE UserAccounts.UserNumber = p_UserNumber
AND SysAcct.AccountNumber = '5008'
AND UserAccounts.BankKey = p_BankKey
ORDER BY UserAccounts.UserKey;
END;
/
--------------------------------------------------------------
To Run Open Editor
Write following code
BEGIN
E_GetCashAccountByUserNumber
(
:p_CREATEDBY,
:p_CREATEDDATE,
:p_UPDATEDBY,
:p_UPDATEDDATE,
:p_IPADDRESS,
:p_FORMID,
:p_UserNumber,
:p_BankKey,
:cur_OUT
);
END;
--------------------------------------------------------------
Then Ctrl+A for select all code
Click on 'Excecute statement' Button
Give all Value type and Value
Press OK
--------------------------------------------------------------
CREATE OR REPLACE PROCEDURE GetCashAccountByUserNumber
(p_CREATEDBY IN NUMBER := NULL,
p_CREATEDDATE IN DATE := NULL,
p_UPDATEDBY IN NUMBER := NULL,
p_UPDATEDDATE IN DATE := NULL,
p_IPADDRESS VARCHAR2 := NULL,
p_FORMID IN NUMBER := NULL,
p_UserNumber IN NUMBER DEFAULT NULL,
p_BankKey IN NUMBER DEFAULT NULL,
cur_OUT IN OUT SYS_REFCURSOR)
AS
BEGIN
OPEN cur_OUT FOR
SELECT UserAccounts.UserKey,
UserAccounts.AccountTypeKey,
UserAccounts.UserNumber,
SysAcct.SystemAccountID,
SysAcctRefUsAcct.SystemAccountRefID,
SysAcctRefUsAcct.UserCurrentBalance,
SysAcctRefUsAcct.BlockedAmount,
SysAcctRefUsAcct.IsVAT,
SysAcctRefUsAcct.IsCOM,
SysAcctRefUsAcct.IsActive,
SysAcctRefUsAcct.ParentCode,
SysAcct.AccountNumber,
SysAcct.AccountDescription,
UserAccounts.UserNumber ParentUserNumber
FROM SysAcct
JOIN SysAcctRefUsAcct
ON SysAcct.SystemAccountID = SysAcctRefUsAcct.SystemAccountID
JOIN UserAccounts
ON SysAcctRefUsAcct.UserKey = UserAccounts.UserKey
JOIN Bank
ON SysAcctRefUsAcct.BankKey = Bank.BankKey
AND UserAccounts.BankKey = Bank.BankKey
WHERE UserAccounts.UserNumber = p_UserNumber
AND SysAcct.AccountNumber = '5008'
AND UserAccounts.BankKey = p_BankKey
ORDER BY UserAccounts.UserKey;
END;
/
--------------------------------------------------------------
To Run Open Editor
Write following code
BEGIN
E_GetCashAccountByUserNumber
(
:p_CREATEDBY,
:p_CREATEDDATE,
:p_UPDATEDBY,
:p_UPDATEDDATE,
:p_IPADDRESS,
:p_FORMID,
:p_UserNumber,
:p_BankKey,
:cur_OUT
);
END;
--------------------------------------------------------------
Then Ctrl+A for select all code
Click on 'Excecute statement' Button
Give all Value type and Value
Press OK