Thursday, July 23, 2009

DB2

Well today it's DB2.

I haven't dealt with DB2 in oh ... ever so I found myself searching the web for information and came across Michael Thomas' site "DB2 Survival Guide" and can't tell you home much that web site has helped me.

http://www.michael-thomas.com/tech/db2/db2_survival_guide.htm

I also needed to find all of the columns inside of a table and what type they were.


SELECT ColName, TypeName, Length, Default, NULLS FROM syscat.columns WHERE tabname = 'MYTable'

I found all of the column names inside Syscat.Columns by using the following lines of code in my Tester Jobber



IBM.Data.DB2.DB2DataReader dr = dB2Command1.ExecuteReader();

while (dr.Read())
{
if (dr.HasRows)
{
sb = new StringBuilder();
for (int i = 0; i <>
{
if (columnNames.Length != 0)
columnNames.Append(" ");
.
.
.


I was also under the impression that DB2 could only be run on Unix/Linux but to my surprise they have a free Express version that can be run on Windows :-)

http://www-01.ibm.com/software/data/db2/express/download.html?S_TACT=&S_CMP=

No comments:

Post a Comment