SQL queries with adapter
-
Hi, I found that there are two practices for writing queries for adapter. 1. one adapter queries for one table in the database e.g. select * from customer 2. one adapter queries for joinned table in the database e.g. select * from customer c1, country c2 where c1.country = c2.country Are the update/insert/delete command of an adapter work only for one table only? Which practice is encouraged? If the two tables are filled into the dataset, are there any SQL queries method to do the "join" operation to the two tables? anymore operations can be done? Thanks
-
Hi, I found that there are two practices for writing queries for adapter. 1. one adapter queries for one table in the database e.g. select * from customer 2. one adapter queries for joinned table in the database e.g. select * from customer c1, country c2 where c1.country = c2.country Are the update/insert/delete command of an adapter work only for one table only? Which practice is encouraged? If the two tables are filled into the dataset, are there any SQL queries method to do the "join" operation to the two tables? anymore operations can be done? Thanks
scchan1984 wrote: Are the update/insert/delete command of an adapter work only for one table only? Personally, I would never rely on the auto generated code for the INSERT/UPDATE/DELETE commands in an Adapter - because it cannot assume anything about the database it creates some awful SQL to ensure that it works. scchan1984 wrote: Which practice is encouraged? I would encourage you not to use any Wizard generated adapters. Also, never do a
SELECT *
if the underlying table changes then the results back to your application may be different and your application may not expect that.
My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More