Is there any way to export a file with SQL scripts of IBM DB2 objects.
I have done this in MS-SQL by following the below link. I am not sure how to do this in DB2.
Is there any way to export a file with SQL scripts of IBM DB2 objects.
I have done this in MS-SQL by following the below link. I am not sure how to do this in DB2.
I've never used iSeries Navigator to do this, however, a pretty good once over just now didn't yield anything similar to what you're looking for from SSMS.
What I recommend is DBeaver Community Edition or Toad as others have mentioned. DBeaver CE is a free resource which leans me towards that option.
Create a connection to your DB2 instance (the software will download the drivers for you after prompting), and then use the program to create your SQL insert statements.
Once you add your connection in, expand the library/schema, go to Tables or Views, and right click the object you'd like to export and click Export Data:
Select SQL and click next:
There will be a few more options to select, but this should get you where you want to go. Let me know if you need any more help.
For some reasons we are not supposed to use the third party tool in our old server.
For generating the DML statements, I used the SQL query:
SELECT 'Insert into Table (DIV,SA,KEY1,KEY2,VALUE1,VALUE) values('''||DIV||''','''||SA||''','''|| KEY1 ||''','''|| KEY2 ||''','''|| VALUE1 ||''','''|| VALUE ||''');' from Table
For generating the DDL statements, I used the below command:
db2look -i DBUser -w DBpassword -d DBSchema -a -e -x -o FIlE_OUT.txt