Application Note for QuNect ODBC for QuickBase

Copying File Attachments from one QuickBase Table to another QuickBase Table

A single SQL statement will allow you to copy file attachments from one QuickBase table to another.

First configure your DSN to represent file attachment fields as a Text field with URL to file attachment in QuickBase. Then write and execute a SQL statement like this:

SQL Server Syntax

INSERT INTO QUICKBASE."ACME_Pipeline".."QuickBase_Destination_Table_bbsd23jlm" ("Destination Key Field Name", "Destination File Attachment Field") SELECT "Source Key Field Name", "Source File Attachment Field" FROM QUICKBASE."ACME_Pipeline".."QuickBase_Source_Table_bbsd23kvh"

ODBC SQL Syntax

INSERT INTO "QuickBase_Destination_Table_bbsd23jlm" ("Destination Key Field Name", "Destination File Attachment Field") SELECT "Source Key Field Name", "Source File Attachment Field" FROM "QuickBase_Source_Table_bbsd23kvh"

You can add a WHERE clause to the end of either of the above SQL statements to restrict which record's files are copied. Including the key field will cause existing records to be updated. If the key field in the destination table is the built-in Record ID# field then you should not include the key field unless there is a strict one to one correspondence between the key values in both tables.