I have a view below
create or replace view Slm_caritoplam2 as
Select Clcard.Parentclref,
Clcard2.Code,
Clcard2.Definition_,
Sum(Gntotcl.Debit - Gntotcl.Credit) As Toplam
From Lg_001_Clcard Clcard,
Lg_001_Clcard Clcard2,
Lg_001_01_Gntotcl Gntotcl
Where Gntotcl.Cardref = Clcard.Logicalref
And Gntotcl.Tottyp = 1
And Gntotcl.Debit - Gntotcl.Credit != 0
And Clcard.Parentclref = Clcard2.Logicalref
And Clcard.Parentclref != 0
and clcard.active = 0
Group By Clcard.Parentclref, Clcard2.Code, Clcard2.Definition_
Order By Clcard.Parentclref;
Lg_001 references the main company. There are 20+ companies in the system, all having tables Lg_002, Lg_003 etc.
Is there a way to create a dynamic view inorder not to create a separate one for each company ?
Thanks for the help