Below is the Syntactical Code which is used to insert the data into table
Insert() Method program
InventoryProducts IP;
IP.Category="Candy";
IP.ProductCode="NWTCA-48";
IP.ProductName="Northwind Traders Chocolate";
IP.StandardCost=9.5625;
IP.ListPrice=12.75;
IP.QuantityPerUnit="10 pkgs";
IP.insert();
doInsert() Method program
InventoryProducts IP;
IP.Category="Candy";
IP.ProductCode="NWTCA-48";
IP.ProductName="Northwind Traders Chocolate";
IP.StandardCost=9.5625;
IP.ListPrice=12.75;
IP.QuantityPerUnit="10 pkgs";
doinsert();
If you see the Above code it is similar in both programs except last lines insert() & doinsert() .
But the main difference is when insert() method get triggers then it calls super() method which take care's to insert the values in table.
Also , the insert() method is used to insert values in table based on condition (true or false)
DoInsert() method , performs it's operation directly on the tables without-calling super() method.And here it bypass the super() method
It is desirably used only if there are no validations to take place while inserting values into tables
Insert() Method program
InventoryProducts IP;
IP.Category="Candy";
IP.ProductCode="NWTCA-48";
IP.ProductName="Northwind Traders Chocolate";
IP.StandardCost=9.5625;
IP.ListPrice=12.75;
IP.QuantityPerUnit="10 pkgs";
IP.insert();
doInsert() Method program
InventoryProducts IP;
IP.Category="Candy";
IP.ProductCode="NWTCA-48";
IP.ProductName="Northwind Traders Chocolate";
IP.StandardCost=9.5625;
IP.ListPrice=12.75;
IP.QuantityPerUnit="10 pkgs";
doinsert();
If you see the Above code it is similar in both programs except last lines insert() & doinsert() .
But the main difference is when insert() method get triggers then it calls super() method which take care's to insert the values in table.
Also , the insert() method is used to insert values in table based on condition (true or false)
DoInsert() method , performs it's operation directly on the tables without-calling super() method.And here it bypass the super() method
It is desirably used only if there are no validations to take place while inserting values into tables
Comments
Post a Comment