Constructor Functions Constructor functions are used to create values of structured types E.g. create function Name(firstname varchar(20),lastname varchar(20)) returns Name begin set self.firstname firstname; set self.lastname lastname; end To create a value of type Name,we use new Name('John',Smith') Normally used in insert statements insert into Person values (new Name('John',Smith), new Address('20 Main St','New York','11001) date‘1960-8-22); Database System Concepts-6th Edition 22.11 ©Silberschat乜,Korth and SudarshanDatabase System Concepts - 6 22.11 ©Silberschatz, Korth and Sudarshan th Edition Constructor Functions Constructor functions are used to create values of structured types E.g. create function Name(firstname varchar(20), lastname varchar(20)) returns Name begin set self.firstname = firstname; set self.lastname = lastname; end To create a value of type Name, we use new Name(‘John’, ‘Smith’) Normally used in insert statements insert into Person values (new Name(‘John’, ‘Smith), new Address(’20 Main St’, ‘New York’, ‘11001’), date ‘1960-8-22’);