DB2 7.2

Posts   
 
    
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 01-May-2007 18:09:52   

I am trying to connect to DB2 UDB 7.2 running on AIX. I installed the DB2 Run-Time Client Lite Version 8 fixpack 14 and was finally able to connect. Then, I was getting an error as soon as I clicked create... "Error: [IBM][CLI Driver][DB2 Platform] SQL0805N Package "NULLID.SYSSH200" was not found. SQLSTATE=51002, Connector 'db2', Method -Catalog[Metadata]- (-805 )" I found help article at http://www-1.ibm.com/support/docview.wss?uid=swg21163994 and doing that fixed the issue.

Now, I get this error...

Message

Index #0 Message: [IBM][DB2/6000] SQL0351N An unsupported SQLTYPE was encountered in position "16" of the output SQLDA (select list). SQLSTATE=56084

NativeError: -351 Source: IBM.Data.DB2

ERROR [56084] [IBM][DB2/6000] SQL0351N An unsupported SQLTYPE was encountered in position "16" of the output SQLDA (select list). SQLSTATE=56084

Stack Trace

-----[Core exception]-------------------- at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.WrapAndThrowDB2Exception(DB2Exception ex) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.RetrieveAllSequences(DB2Connection openDB2Connection) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.RetrieveSchema(String connectionString, IDBSchema schemaToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2CatalogRetriever.RetrieveSchemas(String connectionString, IDBCatalog catalogToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2DBDriver.PopulateSelectedCatalogs(Hashtable callBacks, Hashtable connectionElements, SchemaFetchFlags fetchFlags, Hashtable properties) at SD.LLBLGen.Pro.Gui.Forms.NewProjectWizard.CreateNewProject() -----[InnerException]-------------------- at IBM.Data.DB2.DB2Connection.b(IntPtr A_0, m A_1, x A_2) at IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1) at IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior) at IBM.Data.DB2.DB2Command.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

Source

SD.LLBLGen.Pro.DBDrivers.DB2DBDriver IBM.Data.DB2

Am I spinning my wheels trying to connect to 7.2? Should I just give up? rage

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 02-May-2007 09:21:54   

Please post the LLBLGen Pro Designer release date (Help -> About -> release date)?

dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 02-May-2007 16:46:47   

2.0.0.0 Final March 21st, 2007

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 02-May-2007 18:15:42   

This is the query I execute in that routine, very simple: SELECT * FROM SYSIBM.SYSSEQUENCES WHERE SEQSCHEMA='" + _currentSchema.SchemaOwner + "'

so if your schema is called 'Foo' you get the query: SELECT * FROM SYSIBM.SYSSEQUENCES WHERE SEQSCHEMA='Foo'

That's it. That query is used to fill a datatable using DB2DataAdapter.Fill, so very simple stuff.

Could you run that query on DB2 directly (specify the right schema name of course) and see what's wrong? Please read carefully: - use the same login as you've used to create the project - use for testing ALL schemas in the database you've specified when connecting.

It seems the types returned from the query aren't convertable to a .NET type by the db2 client. clearly a bug in their code, all I do is run a query and fill a datatable.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 02-May-2007 19:20:27   

Executing this...

SELECT * FROM SYSIBM.SYSSEQUENCES WHERE SEQSCHEMA='SC'

from the db2 cli gives me a familiar looking error... SQL0351N An unsupported SQLTYPE was encountered in position "16" of the output SQLDA (select list). SQLSTATE=56084

So I did a describe on the table...

describe table SYSIBM.SYSSEQUENCES

... and noticed that the column, SEQ_DESC has a data type of BLOB (length: 65536)

So, if I execute this query, essentially all fields except the blob, I get 5 results...

SELECT SEQID, SEQSCHEMA, SEQNAME, INCREMENT, START, MAXVALUE, MINVALUE, CYCLE, CACHE, ORDER, ORIGIN, TYPE, SEQMGRFID, SEQMGRTID, DATATYPEID, REMARKS FROM SYSIBM.SYSSEQUENCES WHERE SEQSCHEMA='SC'

I am assuming the cli can't render the blob. Does this make any sense? Does it help?

Thanks -sh

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 02-May-2007 21:07:16   

That's odd, it works on 8.1 without a problem. Are you sure the client you're using (cli) is up to date or the latest version? (e.g., is it possible to connect with a 8.x client to the 7.x db? )

I could try to fetch only the fields required, so I have to manipulate the query a bit. I'll try that tomorrow (thursday). You can get up and running with a debug build of the DB2 driver using the DB2 driver sourcecode in the SDK, build your own version (remove the rest of the projects from the solution, so you're only having db2 in the solution), and update the query text in DB2SchemaRetriever.RetrieveAllSequences.

When I'm done testing tomorrow I'll attach the new build to this thread so when you start in the morning the new build is availble for you.

It's still odd the CLI can't handle a blob, as it's a normal type supported by the DB2 .NET provider and there's no documentation that it can't handle binary strings (blobs) in given versions of DB2.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 02-May-2007 23:01:29   

Well, I may be SOL. I upgraded (uninstalled old, installed new) from the DB2 7.2 runtime client to the 8.x client lite that is linked to from this site before I started on this post.

I just checked with my colleague who is still running the 7.2 client and he doesn't get the error executing the query from the CLI.

I found known errors and workarounds on IBM's site regarding connecting to a 7.x database from an 8.x client. Applying those workarounds got me this far. I just wonder if I am at the end of the road disappointed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 03-May-2007 10:49:36   

dazedorconfused wrote:

Well, I may be SOL. I upgraded (uninstalled old, installed new) from the DB2 7.2 runtime client to the 8.x client lite that is linked to from this site before I started on this post.

I just checked with my colleague who is still running the 7.2 client and he doesn't get the error executing the query from the CLI.

Hmm...

I found known errors and workarounds on IBM's site regarding connecting to a 7.x database from an 8.x client. Applying those workarounds got me this far. I just wonder if I am at the end of the road disappointed

If you have blob fields in your database and you need them in your application, then yes I can't help you further. If not, I can update the driver for you to exclude the blob field. Though as you have an AIX machine there, it's likely you have a support contract with IBM as well. Could you ask IBM about this? The 8.x client should work, as you need .NET support.

(edit) I've updated the driver so it will only obtain the field it needs from the sequences table. Please let me know if this gets you any further. The debug build is attached to this message.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 03-May-2007 15:10:38   

If you have blob fields in your database and you need them in your application, then yes I can't help you further.

No, we don't use blobs for anything. Thanks for the updated driver. I am getting closer...

Though as you have an AIX machine there, it's likely you have a support contract with IBM as well. Could you ask IBM about this?

I'll go talk to the grumpy old admin and see if we still have support. You know the drill, Implement mission critical system. Never upgrade database for fear of messing up system. Oops, now we don't have support anymore.

Regardless, I am getting a new error that indicates no such table, "SYSIBM.COLUMNS" However, I verified that there is a table, "SYSIBM.SYSCOLUMNS" Did this change from 7.x to 8.x of DB2? Anyhow, here is the describe of SYSIBM.SYSCOLUMNS...

C:\Documents and Settings\e0134>db2 describe table SYSIBM.SYSCOLUMNS

Column                       Type     Type
name                           schema   name               Length   Scale Nulls
------------------------------ --------- ------------------ -------- ----- ------
NAME                           SYSIBM   VARCHAR              128     0 No
TBNAME                       SYSIBM VARCHAR              128     0 No
TBCREATOR                     SYSIBM    VARCHAR              128     0 No
REMARKS                     SYSIBM  VARCHAR              254     0 Yes
COLTYPE                     SYSIBM  CHARACTER                8   0 No
NULLS                         SYSIBM    CHARACTER                1   0 No
CODEPAGE                       SYSIBM   SMALLINT                  2  0 No
DBCSCODEPG                   SYSIBM SMALLINT                  2  0 No
LENGTH                       SYSIBM SMALLINT                  2  0 No
SCALE                         SYSIBM    SMALLINT                  2  0 No
COLNO                         SYSIBM    SMALLINT                  2  0 No
COLCARD                     SYSIBM  BIGINT                  8    0 No
HIGH2KEY                       SYSIBM   VARCHAR              254     0 Yes
LOW2KEY                     SYSIBM  VARCHAR              254     0 Yes
AVGCOLLEN                     SYSIBM    INTEGER                4     0 No
KEYSEQ                       SYSIBM SMALLINT                  2  0 Yes
TYPENAME                       SYSIBM   VARCHAR               18     0 No
TYPESCHEMA                   SYSIBM VARCHAR              128     0 No
DEFAULT                     SYSIBM  VARCHAR              254     0 Yes
LONGLENGTH                   SYSIBM INTEGER                4     0 No
LOGGED                       SYSIBM CHARACTER                1   0 No
COMPACT                     SYSIBM  CHARACTER                1   0 No
NQUANTILES                   SYSIBM SMALLINT                  2  0 No
NMOSTFREQ                     SYSIBM    SMALLINT                  2  0 No
COMPOSITE_CODEPAGE           SYSIBM SMALLINT                  2  0 No
PARTKEYSEQ                   SYSIBM SMALLINT                  2  0 Yes
SOURCE_TABSCHEMA               SYSIBM   VARCHAR              128     0 Yes
SOURCE_TABNAME               SYSIBM VARCHAR              128     0 Yes
HIDDEN                       SYSIBM CHARACTER                1   0 No
GENERATED                     SYSIBM    CHARACTER                1   0 No
INLINE_LENGTH                 SYSIBM    INTEGER                4     0 No
NUMNULLS                       SYSIBM   BIGINT                  8    0 No
DATAMODEL                     SYSIBM    INTEGER                4     0 No
SUB_COUNT                     SYSIBM    SMALLINT                  2  0 No
SUB_DELIM_LENGTH               SYSIBM   SMALLINT                  2  0 No
IDENTITY                       SYSIBM   CHARACTER                1   0 No

Also, querying the SYSIBM.SYSTABLES as follows shows that there are 2 views named COLUMNS, both in different schemas.

db2 select name, creator, type from sysibm.systables where name like '%COLUMN%'

NAME                             CREATOR   TYPE
-----------------------      -----------    ----
SYSCOLUMNS              SYSIBM     T
TRIL_COLUMN_CACHE  SC             T
SC_QUTCOLUMN           SC             T
SCQUOTEUICOLUMN  SC           T
COLUMNS                   SYSCAT      V
COLUMNS                   SYSSTAT    V

  6 record(s) selected.

Message

Index #0 Message: [IBM][DB2/6000] SQL0204N "SYSIBM.COLUMNS" is an undefined name. SQLSTATE=42704

NativeError: -204 Source: IBM.Data.DB2

ERROR [42704] [IBM][DB2/6000] SQL0204N "SYSIBM.COLUMNS" is an undefined name. SQLSTATE=42704

StackTrace

-----[Core exception]-------------------- at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.WrapAndThrowDB2Exception(DB2Exception ex) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.PopulateAllTableFields(DB2Connection openDB2Connection) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.RetrieveSchema(String connectionString, IDBSchema schemaToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2CatalogRetriever.RetrieveSchemas(String connectionString, IDBCatalog catalogToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2DBDriver.PopulateSelectedCatalogs(Hashtable callBacks, Hashtable connectionElements, SchemaFetchFlags fetchFlags, Hashtable properties) at SD.LLBLGen.Pro.Gui.Forms.NewProjectWizard.CreateNewProject() -----[InnerException]-------------------- at IBM.Data.DB2.DB2Connection.b(IntPtr A_0, m A_1, x A_2) at IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1) at IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior) at IBM.Data.DB2.DB2Command.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.PopulateAllTableFields(DB2Connection openDB2Connection)

Source

SD.LLBLGen.Pro.DBDrivers.DB2DBDriver IBM.Data.DB2

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 04-May-2007 10:25:31   

I have the feeling the user you're logging on with doesn't have enough privileges. The SYSIBM.COLUMNS schema is necessary as there the columns for the user tables are defined. In SYSCOLUMNS only the columns of the sys views / schemas are defined, so these aren't interesting.

Can the collegue who's using CLI v7 access SYSIBM.COLUMNS ? If so, can you try with your login/pwd on his system as well ?

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 04-May-2007 15:35:35   

What if I were to drastically change direction and try to write a db2 driver that worked with the 7.1 client. Would that be possible? Unfortunately, we have no support for 7.1 and apparently no plans of upgrading rage

I currently use oledb to connect to db2.


Dim objConn As OleDbConnection
New OleDbConnection("Provider=IBMDADB2;Database=FLPRCDEX; HOSTNAME=someserver.cooperlighting.com;PROTOCOL=TCPIP;PORT=50004;uid=someuser;pwd=apassword;")

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 04-May-2007 18:38:23   

dazedorconfused wrote:

What if I were to drastically change direction and try to write a db2 driver that worked with the 7.1 client. Would that be possible? Unfortunately, we have no support for 7.1 and apparently no plans of upgrading rage

That's not the issue. The issue is the driver using elements from the DB2 installation you can't access or which fail to work with your client code.

That system view is required to get the column meta-data and I can't find information that this view wasn't present in 7.x.

I currently use oledb to connect to db2.


Dim objConn As OleDbConnection
New OleDbConnection("Provider=IBMDADB2;Database=FLPRCDEX; HOSTNAME=someserver.cooperlighting.com;PROTOCOL=TCPIP;PORT=50004;uid=someuser;pwd=apassword;")

My idea was that it's about the user, if the userid you're using has access to SYSIBM.COLUMNS or not.

SYSIBM.COLUMNS is a view which is system wide, SYSCAT are views on the catalog level.

I re-checked and I can use these too. I'll rework the driver to use the SYSCAT schema instead. Stay tuned...

Hmm. SYSCAT.COLUMNS doesn't have all the information. Length for example is in bytes, always, also for numeric types disappointed There's only a column for SCALE, not for precision.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 04-May-2007 18:43:23   

Awesome, thanks man!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 04-May-2007 18:49:28   

Hmm... I can't get the precision info.. rage

A smallint is of length '2' in SYSCAT.COLUMNS, but has for example precision '5' in SYSIBM.COLUMNS.

Could you confirm that in your 7.x db SYSIBM.COLUMNS doesn't exist? (so it's not an access right issue) ?

(edit). Apparently, according to IBM's online docs, for for example DB2 v9, SYSCAT.COLUMNS is the way to go, not SYSIBM.COLUMNS which is nowhere to be found in the docs.

I can't find any other SYSCAT view which contains the precision info, though it should be somewhere, the SYSIBM.COLUMNS does contain the precision info

(edit) ah, I can alter SYSIBM.COLUMNS, so I can see where it gets that funky NUMERIC_PRECISION column value simple_smile

(edit) haha LOL simple_smile It's just a silly table:


CASE C.COLTYPE               WHEN 'INTEGER'  THEN 10                 WHEN 'BIGINT'        THEN 19                WHEN 'SMALLINT'        THEN 5               WHEN 'REAL'            THEN 24              WHEN 'DOUBLE'        THEN 53                WHEN 'DECIMAL'      THEN CAST(C.LENGTH AS INTEGER)              ELSE CAST(NULL AS INTEGER)           END

So 'precision' is artificial here, at least for non-DECIMAL fields. Ok, I can work with SYSCAT.COLUMNS now, and also the SYSCAT.COLIDENTATTRIBUTES.

It will be some work though, so I can't finish it today, I hope to have a better driver for you monday morning.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 04-May-2007 19:26:53   

Thanks, finally, a reason to look forward to Monday wink

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 07-May-2007 14:16:44   

Please see the attached driver dll. This should fix the problems you had. I simply reworked the code so it now always uses SYSCAT.COLUMNS.

It's a bizarre set of views and tables what DB2 has for meta-data. simple_smile It's very inconsistent, but alas, it now works. please let me know if you now run into another roadblock.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 07-May-2007 15:05:35   

One step forward and two steps back...

Message

Index #0 Message: [IBM][DB2/6000] SQL0351N An unsupported SQLTYPE was encountered in position "35" of the output SQLDA (select list). SQLSTATE=56084

NativeError: -351 Source: IBM.Data.DB2

ERROR [56084] [IBM][DB2/6000] SQL0351N An unsupported SQLTYPE was encountered in position "35" of the output SQLDA (select list). SQLSTATE=56084

Stack trace

-----[Core exception]-------------------- at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.WrapAndThrowDB2Exception(DB2Exception ex) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.PopulateAllTableFields(DB2Connection openDB2Connection) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.RetrieveSchema(String connectionString, IDBSchema schemaToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2CatalogRetriever.RetrieveSchemas(String connectionString, IDBCatalog catalogToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2DBDriver.PopulateSelectedCatalogs(Hashtable callBacks, Hashtable connectionElements, SchemaFetchFlags fetchFlags, Hashtable properties) at SD.LLBLGen.Pro.Gui.Forms.NewProjectWizard.CreateNewProject() -----[InnerException]-------------------- at IBM.Data.DB2.DB2Connection.b(IntPtr A_0, m A_1, x A_2) at IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1) at IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior) at IBM.Data.DB2.DB2Command.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.PopulateAllTableFields(DB2Connection openDB2Connection)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 07-May-2007 16:24:16   

Huh... confused

That's a simple SELECT * FROM SYSCAT.COLUMNS...

Pos 35 is the 'Text' field, I can exclude that one (it's a CLOB).

I'll re-form the query, just a sec.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 07-May-2007 16:31:58   

Ok, this should fix it. Sorry for this mess, I thought I checked it all, but overlooked the CLOB field in the view. I don't need it anyway so I limited the select list to the list of fields required for the routine.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 07-May-2007 16:36:11   

No need for you to be sorry... I am the one that is bugging you!

Message

ERROR [42704] [IBM][DB2/6000] SQL0204N "SYSIBM.SQLPRIMARYKEYS" is an undefined name. SQLSTATE=42704

StackTrace

-----[Core exception]-------------------- at IBM.Data.DB2.DB2Connection.b(IntPtr A_0, m A_1, x A_2) at IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1) at IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior) at IBM.Data.DB2.DB2Command.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.PopulateAllTableFields(DB2Connection openDB2Connection) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2SchemaRetriever.RetrieveSchema(String connectionString, IDBSchema schemaToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2CatalogRetriever.RetrieveSchemas(String connectionString, IDBCatalog catalogToRetrieve, SchemaFetchFlags fetchFlags) at SD.LLBLGen.Pro.DBDrivers.DB2.DB2DBDriver.PopulateSelectedCatalogs(Hashtable callBacks, Hashtable connectionElements, SchemaFetchFlags fetchFlags, Hashtable properties) at SD.LLBLGen.Pro.Gui.Forms.NewProjectWizard.CreateNewProject()

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 07-May-2007 18:20:02   

Hmm... that's a system view which makes it very easy to obtain PK info. disappointed There's no other way than to consult system tables and join a lot. Perhaps I can use the view's query to obtain the PK info..

It's a bit hard to determine when a given view is introduced with DB2, so that's why you run into these things. Although it's still a mistery to me why you can't use LOB fields with the .NET client.

Anyway, I'll try to pull the info from the systables using the view's query. This is still trial/error, so I hope to have a working driver tomorrow for you.

What's worse is that the FK retrieval uses a similar view: SYSIBM.SQLFOREIGNKEYS which I pressume is also not present.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 07-May-2007 18:24:36   

Indeed, you guessed correct...

SQL0204N  "SYSIBM.SQLFOREIGNKEYS" is an undefined name.  SQLSTATE=42704
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 08-May-2007 11:01:25   

OK!

I think this one should do it. The UCs are retrieved frm system tables so no fancy views there. I've ported the view queries to a query and removed the fluff we don't need so I think this should work on your system.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 10-May-2007 15:38:21   

Well, I haven't generated any code yet, but alas, I am able to catalog the entites in the designer. Thank you for all of your help with this!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 10-May-2007 15:46:33   

dazedorconfused wrote:

Well, I haven't generated any code yet, but alas, I am able to catalog the entites in the designer. Thank you for all of your help with this!

OK!

Frans Bouma | Lead developer LLBLGen Pro