Skip to content

Instantly share code, notes, and snippets.

@victor-abz
Last active May 31, 2025 17:15
Show Gist options
  • Save victor-abz/7a27e79a835e69c0119250c17d6d22bc to your computer and use it in GitHub Desktop.
Save victor-abz/7a27e79a835e69c0119250c17d6d22bc to your computer and use it in GitHub Desktop.
shares
/* check accounts with complete share and verify if list match with list shared from
* business department
*/
use cbslive
select ac.CustomerNumber, am.acno, am.clearbalance, am.* from accountmaster am
join accounts ac on ac.acno= am.acno
where am.acno in (
select acno from accounts where actype=6)
and am.clearbalance >=50000
use sharenetlive
Insert into MemberMaster
(MemberType,MemberIdentity,MemberCode,LedgerCode,Name,RAdd1,RAdd2,RAdd3,RCity,RMobileno,BirthDate,Age,MembershipDate,DivPayBrCode,
DivPayBrAcno,ApplicationBr,Gender,Remarks,MeetingNo,MeetingDate,DivPayMode,IsAcTerminated,CustomerCode,CustomerBr,CreatedBy,CreationDate,
AuthorisedBy,AuthorisationDate,FirstName,MiddleName,LastName,CustomerType)
Select 1,100000000+customer.code,customer.code,null,customer.Name,ResAddress1,ResAddress2,ResAddress3,ResCityCode,cellphone,BirthDate,0,OpenDate,customer.BranchCode,
a.acno,a.BranchCode,1,'Create from CBS',1,
(select workingdate from CBSLive..bankparameters),1, 0, customer.code,customer.BranchCode,customer.Operator,
(select workingdate from CBSLive..bankparameters),customer.Supervisor,
(select workingdate from CBSLive..bankparameters),
c.FirstName,c.MiddleName,c.LastName,customer.CustomerType
from CBSLive..CustomerNames c, CBSLive..Customer
left outer join CBSLive..Accounts a on Customer.code = a.CustomerNumber and a.BaseType = 2 and a.Actype = 6 and a.Status <> 9
Where Customer.code = c.code and Customer.code in (
--customer_numbers )
-- Step 2: -- CBS DB
-- Check if Account not yet in Sharem
use cbslive
select * from ShareCapitalIssue where acno in (
1001006040265,
1001006040354)
delete from ShareCapitalIssue where acno in (
1001006040184,
1001006040205,
1001006040239,
1001006040256,
1001006040330,
1001006040427,
1001006114398)
-----
use sharenetlive
select status, SancDt, TransactionNo, * from TransDetails where
MemberIdentity = 100000070 70
Update TransDetails set Status = 9 where SancDt = '19-Jun-2023' and TransactionNo = 58 and MemberIdentity = 100000070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment