Method Community

 

SQL Override table name

Last post 02-21-2014 6:14 PM by MikeH. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-19-2014 6:17 PM

    • MikeH
    • Top 200 Contributor
    • Joined on 10-02-2013
    • Posts 24

    SQL Override table name

    I was having a problem with the SQL Override in a grid and found the solution, however, I don't understand why it works and hope someone can help clarify the naming convention.
    I have a grid based on a table called "ProductFamily". I was getting a record count in another table called "Item" with the following:
    "SELECT Count(viewaccItem.RecordID) FROM viewaccItem WHERE viewaccItem.ProductFamily_RecordID = viewaccProductFamily.RecordID"
    There was an error generating the grid and I found that the problem was due to how I was referencing the ProductFamily table (the table the grid is based on). I removed "acc" from the table name and everything worked perfect (viewProductFamily instead of viewaccProductFamily).
    Does anyone know why the "acc" is dropped from a table name reference when it is the table for the grid (use view[table name] instead of viewacc[table name])? The only thing I could think is that "acc" tells the system to look for an external table but if that is the case, why would you need to put "view"?

    Thanks!
  • 02-21-2014 3:35 PM In reply to

    Re: SQL Override table name

    Hello Mike,

         I'm not sure the techincalities of the database structure.  My thoughts were that the 'view' prefix is for a temporary table holding the fields for the view and the 'acc' prefix denotes the actual tables.

    - Greg

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
  • 02-21-2014 4:54 PM In reply to

    Re: SQL Override table name

    Hello Mike,

         I have been told I was wrong.  'view' tables are ones that store information that is not for QuickBooks, but for Method.  'viewacc' tables store accounting information from QuickBooks. You can ignore my previous post.

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
  • 02-21-2014 6:14 PM In reply to

    • MikeH
    • Top 200 Contributor
    • Joined on 10-02-2013
    • Posts 24

    Re: SQL Override table name

    So if it is a Method-only table I should use 'view' and if it is a QuickBooks table I should use 'viewacc'. I'll keep that in mind.

    Thanks for the help!

Page 1 of 1 (4 items)