Jump to content

Working on a POC right now... db2/sql help


allaripidugu

Recommended Posts

I am working on POC for a data refresh job. I need to write a job which finds structural differences between tables from one environment to another environment and changes in strored procedures from one environment to another environment. I am working on db2 database please help me out on how to do this.

Link to comment
Share on other sites

SELECT colname, colno, typeschema, typename FROM syscat.columns WHERE tabname = 'tab1' AND tabschema = 'schema'
  EXCEPT
  SELECT colname, colno, typeschema, typename FROM syscat.columns WHERE tabname = 'tab2' AND tabschema = 'schema'

this will give u columns frm tabl1 tht are not in table2

Link to comment
Share on other sites

21 hours ago, 150bryant said:

structural differences antey enti?

ey type of data? health finance etc? wat is a POC?

Finance bhayya.

 

21 hours ago, 150bryant said:

SELECT colname, colno, typeschema, typename FROM syscat.columns WHERE tabname = 'tab1' AND tabschema = 'schema'
  EXCEPT
  SELECT colname, colno, typeschema, typename FROM syscat.columns WHERE tabname = 'tab2' AND tabschema = 'schema'

this will give u columns frm tabl1 tht are not in table2

Thank you maaya actually ninna stack overflow lo post chesthe similar solution dorkindhi. I will query syscat.columns in server1 and export it to a file and SFTP the file to  server2, load the SFTP ed file into a temporary table in server2 and comapre to syscat,columns in the server2.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...