Knowledgebase: TroubleShooting
[QODBC ALL] Discovering Required and Available Fields for QODBC Table INSERTs
Posted by William - QODBC Support on 01 October 2026 12:26 PM

[QODBC ALL] Discovering Required and Available Fields for QODBC Table INSERTs

Problem Description:

You are writing SQL INSERT statements against QODBC tables (such as Customer, Invoice, SalesOrder, etc.) and receiving errors about missing required fields or invalid column names. You need a reliable way to discover which columns are available for any given table and which of them are required.

Affected products: QODBC Desktop, QODBC Online, QuickBooks Desktop, QuickBooks Online
Expected outcome: You can identify all available columns for any QODBC table, know which are required for INSERT operations, and construct valid SQL statements on the first attempt.

Symptoms:

  • INSERT into a QODBC table fails with an error about a missing or invalid column.
  • The record is created but some fields appear empty because they were not included in the INSERT.
  • Attempting to INSERT without a required field (e.g., omitting the Name column for Customer) - the insert silently fails or returns an error.
  • Uncertainty about which columns are mandatory vs. optional for a given table.

Cause:

QODBC tables mirror QuickBooks data structures, and some fields (like Name in the Customer table) are always required by QuickBooks itself. When an INSERT omits a required field, the SDK call to QuickBooks fails - often with a generic parsing or validation error. QODBC does not supply default values for missing columns; whatever you omit is left null, and QuickBooks rejects the request.

Unlike relational databases that provide information_schema views, QODBC uses stored procedures to expose table schemas. You must query the schema explicitly before writing INSERT statements.

Resolution:

  1. Use SP_Columns in the QODBC Test Tool to discover all available columns for any table. This is the most reliable way to see exactly which columns a QODBC table supports and their data types.

    Open the QODBC Test Tool and run:
    SP_Columns TableName

    For example, to see all columns available on the Customer table:
    SP_Columns Customer

    This returns a result set listing every column name, data type, nullability, and whether it is required.
  2. Check the online table documentation as a supplementary reference. QODBC maintains documentation pages for each table:

    https://doc.qodbc.com/qodbc/usa/TableDetails.php?tableName=<TableName>

    Replace <TableName> with the actual table name (e.g., Invoice, SalesOrder, Item). The page lists all columns, descriptions, and any required-field notes.
  3. For a full list of available tables in your edition:

    https://doc.qodbc.com/qodbc/usa/TableList.php?categoryName=
  4. Apply the findings to your INSERT statement. Ensure all required columns are included with valid values.

    For example, the Customer table always requires the Name column. An insert like this will fail:
    INSERT INTO Customer (FirstName, LastName, CompanyName) VALUES ('John', 'Doe', 'Acme Corp')

    The corrected version includes Name:
    INSERT INTO Customer (Name, FirstName, LastName, CompanyName) VALUES ('John Doe', 'John', 'Doe', 'Acme Corp')

SQL Examples:

Finding columns for any QODBC table:

-- Available columns for Customer table
SP_Columns Customer

-- Available columns for Invoice table
SP_Columns Invoice

-- Available columns for SalesOrder table
SP_Columns SalesOrder

-- Available columns for InvoiceLine (child table)
SP_Columns InvoiceLine

Correct INSERT with all required fields (Customer example):

INSERT INTO Customer
(Name, FirstName, LastName, BillAddressAddr1, BillAddressCity,
 BillAddressState, BillAddressPostalCode, Phone, Email)
VALUES
('John Doe', 'John', 'Doe', '123 Main St', 'Anytown',
 'CA', '90210', '555-0100', 'john@example.com')

Example Scenarios:

Scenario 1 - Missing required Name field on Customer insert:

A customer wrote an INSERT into the Customer table including FirstName, LastName, and CompanyName but omitted the required Name column. The QODBC log showed "error when parsing the provided XML." William identified that Name is mandatory for every Customer record in QuickBooks. Adding Name to the INSERT resolved the issue. The customer confirmed: "Thanks for getting back so quickly, we'll have them try supplying the company name and try again."

Scenario 2 - Building an ETL integration from scratch:

A developer setting up a new data pipeline uses SP_Columns on each target table before writing any INSERT statements. This avoids trial-and-error with column names and ensures all required fields are included from the start.

Additional Notes:

  • SP_Columns works for both QODBC Desktop and QODBC Online editions - just make sure your DSN is connected before running it.
  • A column marked as "non-nullable" in SP_Columns output means QuickBooks always requires it. Omitting such a column will cause the SDK call to fail every time.
  • Different QODBC editions may expose different tables. QODBC Online has a different set of available tables than QODBC Desktop (e.g., no SalesOrder in online, but Invoice is available in both).
  • Always include Name for Customer-type tables. Whether Customer, Vendor, or Employee, the Name field is universally required across all QuickBooks entity types.

QODBC Support Wizard and Unoptimized Tables QODBC SDK Data Access Limitations

Keywords:

SP_Columns Required Fields Table Schema INSERT Error Customer Table Name Field QODBC Test Tool Column Discovery Missing Column TableDetails QuickBooks SDK
(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).