Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL queries with adapter

SQL queries with adapter

Scheduled Pinned Locked Moved Database
databasesalesquestionannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    scchan1984
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • S scchan1984

      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

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups