JDBC Connection

 2 Replies
 0 Subscribed to this topic
 14 Subscribed to this forum
Sort:
Author
Messages
Ken Ptak
Basic Member
Posts: 20
Basic Member
    I just started working with SN's last week (please forgive if this question should not be posted). I have a query built in Access 2003 that runs fine, but when I copy the SQL over to the JDBC connection, I keep receiving an error. I believe it's because the SQL syntax is different between the two, but I don't know what those differences are.

    My main objective is to create a SN that will return all Employees who appear in the GMDISTRIB table but do not appear in the GMEFFORT table. Any ideas are much appreciated.

    My Access 2003 SQL is:
    SELECT LAWSON_GMDISTRIB.EMPLOYEE, LAWSON_GMDISTRIB.COMPANY, LAWSON_GMEFFORT.EMPLOYEE, LAWSON_EMPLOYEE.LAST_NAME, LAWSON_EMPLOYEE.FIRST_NAME

    FROM (LAWSON_GMDISTRIB LEFT JOIN LAWSON_GMEFFORT ON LAWSON_GMDISTRIB.EMPLOYEE=LAWSON_GMEFFORT.EMPLOYEE) LEFT JOIN LAWSON_EMPLOYEE ON LAWSON_GMEFFORT.EMPLOYEE=LAWSON_EMPLOYEE.EMPLOYEE

    GROUP BY LAWSON_GMDISTRIB.EMPLOYEE, LAWSON_GMDISTRIB.COMPANY, LAWSON_GMEFFORT.EMPLOYEE, LAWSON_EMPLOYEE.LAST_NAME, LAWSON_EMPLOYEE.FIRST_NAME;

    Thanks!
    Ken
    John Henley
    Posts: 3353
      Hi Ken, what database vendor is your Lawson database (i.e. Oracle, MSSQL, DB2, etc.). Typically, the table syntax would be schemaowner.tablename, i.e. LAWSON.EMPLOYEE. So the key is to find out what the schema owner's name is, which can vary dramatically depending on how your system is set up. For example, some people put all databases (i.e. PROD, TEST, LOGAN, etc) within the same database, and use the schema to differentiate (i.e. lawprod, lawtest, lawlogan); others put each set of tables in a unique database, and keep the schema owner generic, like 'lawson'.
      Thanks for using the LawsonGuru.com forums!
      John
      Ken Ptak
      Basic Member
      Posts: 20
      Basic Member
        John - We use Oracle. After thinking about what you said, I was able to get it to work by removing all instances of "Lawson_" from my original posted query.

        Thanks for your help!!!
        Ken