Focal Point
[CLOSED] Appending data to a MSSQL database table

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3127051276

August 12, 2014, 09:50 AM
Tim P.
[CLOSED] Appending data to a MSSQL database table
I have a fex that we run every quarter that I would like to append the data into a table in MSSQL at the end of every quarter. I've created tables in MSSQL using a permanent hold file but never tried appending data in an already existing table. Anyone know the correct syntax to do this?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
August 12, 2014, 10:19 AM
J
If you use sql passthru, you just insert the new records using the insert command. If that doesn't work for your situation, could you provide more details?

-EDIT: If the users are entering data on a form, it will be easy to use those variables in a sql passthru statement. If you are running a report and expect that output to be inserted, you could read the results into variables and then call a sql passthru statement, but there may be a better way to do that.

Thanks
J

This message has been edited. Last edited by: J,


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 12, 2014, 10:23 AM
Tim P.
Yes, I had planned on using either a SQL passthru or a modify command to append the data.

So, for example, if I have a focus table with 100 rows in it, can I just use a SQL passthru with a standard SQL insert command to append those 100 rows into the MSSQL table?


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
August 12, 2014, 10:28 AM
J
quote:
Originally posted by J:
-EDIT: If the users are entering data on a form, it will be easy to use those variables in a sql passthru statement. If you are running a report and expect that output to be inserted, you could read the results into variables and then call a sql passthru statement, but there may be a better way to do that.
You responded too quickly Wink


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs