Focal Point
[CLOSED] Best way to dump an sql table to a DB2 file

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

November 02, 2009, 01:42 PM
smoss
[CLOSED] Best way to dump an sql table to a DB2 file
Does anyone know a way to dump an SQL file to a DB2 file. I am new, so there is probably a 1000 way right?

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


WebFOCUS 7.7.03M
OS/400 and the client is Win7
November 02, 2009, 01:48 PM
dhagen
Use "Data Migrator" ... very easy.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
November 02, 2009, 01:58 PM
Darin Lee
very easy - if you already have Data Migrator with a read/write adapter for DB2 AND for SQL. If not, it's also very expensive.

Are you looking for a WebFOCUS solution? Are you already licensed for both adapters?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
November 02, 2009, 03:36 PM
smoss
we do not have data migrator Frowner


WebFOCUS 7.7.03M
OS/400 and the client is Win7
November 02, 2009, 03:42 PM
Francis Mariani
quote:
SQL file to a DB2 file


What do you mean by a "SQL file" and a "DB2 file"?

If you want to load a DB2 table from a flat file or another DB2 table, have you tried using a DB2 client from IBM, or AQT or Toad or something similar? You can also use the WebFOCUS MODIFY command. This is as long as you have a user ID with update access.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 02, 2009, 03:51 PM
smoss
I would like to dump the data from an SQl table to a DB2 file. Off the SQL server and on to the iseries. Or if I can just get the table off the SQL server and on to the IFS that would be fine also. Just not too fimiliar with the IBI tool set.


WebFOCUS 7.7.03M
OS/400 and the client is Win7
November 02, 2009, 04:03 PM
Francis Mariani
If you have WebFOCUS adapters for the MS SQL Server database and the IBM DB2 database, you can easily use WebFOCUS to transfer data between the two platforms.

This is the general, overly simplified code:
TABLE FILE MS_SQL_SERVER_TABLE
PRINT *
ON TABLE HOLD AS H001
END

MODIFY FILE IBM_DB2_TABLE
FIXFORM FROM H001
DATA ON H001
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 03, 2009, 12:31 PM
Hua
You might be able to export the sql table directly to db2 file inside your sql server if you have somekind of odbc driver. We have the iSeries client access installed in the sql server pc to make it work.

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
February 12, 2010, 06:30 AM
PL v/d Berg
quote:
Please Wait. Your request is being processed...
Logout: Focal Point
Update LiveCloud Account Reply

I have Client Access ODBC adapter installed - how do you dump a file onto the AS/400 via this driver? Does nything have to be done on the AS/400


Webfocus 7.1, Microsoft
Output: HTML
February 12, 2010, 08:48 AM
Maintain Wizard
You can do this with Maintain in 4 lines of code:

MAINTAIN FILE fileA and fileB
For all next FileA.fields into stk
For all include FileB.fields from stk
END

Where fields represent the key field(s).

Mark
February 15, 2010, 06:00 AM
PL v/d Berg
Can anyone tell me why this does not work?
THE DEFAULT CONNECTION IS TO AN AS/400 DATASOURCE. THE TABLE SDTSPLT IS AN AS/400 PHYSICAL FILE. I do not have a DB2 adapter - I am trying to write to an AS/400 file.



ENGINE SQLODBC SET DEFAULT_CONNECTION QGPL
SQL SQLODBC
DROP TABLE SDTSPLT;
END

DEFINE FILE ACTUAL1
DOC/A6='123456';
VALN/A6='N10A';
END
TABLE FILE ACTUAL1
PRINT DOC AS 'DOC'
BY VALN AS 'VALN'
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS SDTS1 FORMAT ALPHA
END
-RUN

TABLE FILE SDTS1
SUM DOC AS 'DOC'
BY VALN AS 'VALN'
ON TABLE HOLD AS SDTSPLT FORMAT SQLODBC
END


Webfocus 7.1, Microsoft
Output: HTML
February 15, 2010, 07:45 AM
GamP
PL,
Two things:
1. please let us know if there is any error somewhere along the line that might be pointing to the source of the problem.
2. make sure that the odbc connector you're using supports writing to the file - not all odbc's do that.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 16, 2010, 04:01 AM
PL v/d Berg
quote:
let us know if there is any error somewhere along the line that might be pointing to the source of the problem

The error message received as follows;
0 NUMBER OF RECORDS IN TABLE= 634 LINES= 82
0 NUMBER OF RECORDS IN TABLE= 82 LINES= 6
0 HOLDING SQLODBC FILE...
(FOC1400) SQLCODE IS -601 (HEX: FFFFFDA7) XOPEN: 42S01
: [S0001] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQ
: L0601 - SDTSPLT in QGPL type *FILE already exists.
(FOC1414) EXECUTE IMMEDIATE ERROR.


Webfocus 7.1, Microsoft
Output: HTML
February 16, 2010, 04:08 AM
PL v/d Berg
Using Client Acess ODBC Diver 32 bit


Webfocus 7.1, Microsoft
Output: HTML