[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::dbintegrator_public_public

Title:DB Integrator Public Conference
Notice:Database Integration - today! Kit/Doc info see note 36
Moderator:BROKE::ABUGOV
Created:Mon Sep 21 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1171
Total number of notes:5187

1063.0. "DBIGW for DB2 and DB2 V3.1 problem" by ORAREP::GIDDAY::REINHOLD (Skippy) Fri Jun 07 1996 02:27

    Gidday,
    
    
    	I have a problem with DBIGW for DB2 server and DB2 V3.1. 
    
    	My customer has just upgraded the Version of DB2 from V2.3 to V3.1 
    and now they can't delete data written to the database by DB2 V3.1 from 
    their application (on the AXP cluster) via DBI GW for DB2, even though 
    they could before and the access is open to the database.
    
    	If they write entries to the Database from DBI GW, they can
    delete them fine.
    
    	If they write entries from DB2 V2.3 they can delete them via
    DBI fine.
    
    	If they write entries from DB2 V3.1 they can use dynamic SQL
    to delete them fine.
    
    	Though it fails when they use their application via DBI GW, with 
    debugging turned on, the database transaction returns a success code
    of "0" even though the entries are still in the DB.
    
    	Does anyone know if DBIGW for DB2 server V3.0 will coexist with
    DB2 V3.1? Is there a newer version of DBIGW for DB2 server available?
    Should I raise an IPMT case?
    
    	I am getting the customer to log the failing sessions, with
    debugging turned on, and supply the logs and code sample.
    
    					Cheers,
    						Dave
    	
    
    Following is their configuration,
    
    
                     AXP CLUSTER
    Sybase <-> DBI <-> DBI GW for DB2 <-> DECNET <-> SNA <-+ SNA Peer-Peer
                                                           | Server (OSF/1)
                              DB2 <-> CICS <->token ring <-+
                                    IBM MAINFRAME
    
       Client:      Alpha 2000-300 OpenVMS V6.1
                    DBI DB2 client 3.1A
                    DECnet SNA/APPC LU6.2 V2.2-14
                    Twisted Pair Ethernet connection to Peer Server
    
       SNA Peer Server:
                    Alpha 3000-600
                    DEC OSF/1 V2.1
                    SNA Peer Server V1.1A
                    DECnet/OSI V2.0
                    Token Ring DETRA (TRNController 700)
    
       FEP 3745     TIC2 16Mbps
    
       IBM 9121-311 MVS V5 Rel 2 Mod 0
                    CICS V3.0 Rel 3 Mod 0
                    DB2  was V2 Rel 3 Mod 0
    			 is V3 Rel 1 Mod 0
       DB2 Server V3.1
    
    
    
    
                      
T.RTitleUserPersonal
Name
DateLines
1063.1ORAREP::EDSCLU::WHITEFri Jun 07 1996 13:2623
First off, the DB2 Server runs fine with DB2 V3.1.  There has never been a
problem reported with the server and this DB2 Version.

In your base note you said it worked from dynamic SQL but failed with a zero
return code from a program.  This is almost certainly due to some datatype
incompatibility.  The answer will be something like dynamic SQL will work
because the whole WHERE clause on the DELETE gets pushed to DB2 and the rows
get deleted.  But with the program there is a datatype mismatch in one of the
parameters and DBI won't push the mismatched datatype to DB2, therefore a SELECT
is performed by DBI (with the intention of DELETEing the returned rows) but
some aspect of datatype incompatibility (for instance, FLOAT representations)
causes the SELECT to return no rows, therefore the DELETE works because no rows
matched the WHERE clause.

I'm sure if you look in here you'll find a very similar note that turned out to
be DBI not pushing DATE compares to DB2 because the program used some COBOL
datatype which was incompatible with DB2.  When the customer tried it with
dynamic SQL it worked fine (since DBI pushed the whole WHERE clause down).

The way to debug this is to run the dynamic SQL and the program with DB2_REQ_SQL
tracing turned on and find how the programs predicates in the WHERE clause
are being turned parameter markers.  Then investigate if you can change the
programs representation of the offending datatype.
1063.2Customer is unclearORAREP::GIDDAY::VASSILMon Jun 10 1996 04:3926
    Hi,
    
    Thanks for the reply.
    
    The customer is curios to know why he could delete data written to the 
    database when using DB2 V2.3 and why he cannot do it now using DB2 V3.1.
    Has anything changed between these two versions, has he missed something.
    He claims to be doing nothing different now, to what he was doing before
    the upgrade.
    
    The customer has faxed me, saying that rows entered in the DB2 database
    from the IBM side cannot be deleted by the DBI-DB2 Server/Gateway under
    program control, yet rows entered from the VMS side by DBI-DB2 Server/
    Gateway (via interactive SQL on the VMS system) can be deleted under
    program control.
    
    The customer is unclear as to how a data-type mismatch problem would
    exhibit this behaviour.
    
    I will post the tracing as soon as the customer supplies it to me.
    
    Thanks,
    Mario. (on behalf of Dave)
    
    
    
1063.3ORAREP::EDSCLU::WHITEMon Jun 10 1996 13:2418
>    The customer is curios to know why he could delete data written to the 
>    database when using DB2 V2.3 and why he cannot do it now using DB2 V3.1.
>    Has anything changed between these two versions, has he missed something.
>    He claims to be doing nothing different now, to what he was doing before
>    the upgrade.
    
I can't think of anything in DB2 V3.1 to cause this change, but I've been wrong
before.  Still, if I had to bet, I'd bet something else changed too and the
customer doesn't think that it's relevent (Oh, you mean it matters that I also
changed the scale on the packed decimal field?)

That "something" is almost certainly related to the handling of the datatypes.
I'm sure because in order to get a Success indicator on that DELETE statement
it must mean no rows matched the WHERE clause, and that is a very common
datatype mismatch symptom when DBI uses parameter markers to perform
the statement.

I guess tracing is the only way to figure this one out.
1063.4Customer's replyORAREP::GIDDAY::VASSILThu Jun 13 1996 23:4442
    Hi,
    
    I recieved the following reply from the customer:-
    
    I think you were right about the datatype mismatch, but i'm still
    puzzled as to why?
    
    The trace flag DB2_REQ_SQL didn't generate a lot of useful information
    other than the actual SQL statements. However, when I looked at results
    from a trace using the trace flag DB2_CXT_REQ (among others) I noticed
    that a timestamp - that we were using as part of a DBKEY - was being
    passed across as a 26 character entity. I removed the timestamp field
    from the DBKEY_MODE grouping for the problem table in my configuration
    file and the deletes worked.
    
    This is rather annoying as the data was initially retrieved from the
    DB2 database in VMS *BINARY* timestamp format which means - in my mind,
    anyway - that there is provision for the extra precision which seems to
    be displayed on the DB2 side. It appears that the client/server may be
    devolving the date/timestamp into a VMS *ASCII* string the length of
    which is only 23 characters which would imply that the extra 3
    characters in the fractions of second are lost.
    According to table 10-4, p 10-14 of the DEC DB Integrator Product
    Family Users Guide the magnitude for Date conversion is N/A which
    implies to me that the Server and Gateway should maintain the
    precision.
    
    I would be very interested in knowing whether any form of truncation
    occurs in DATE VMS datatypes when transferring to-and-fro via the
    DBI/DB2 Server and the client. I dont see why there should be, but my
    actions - removing the timestamp from the DBKEY list - have produced a
    different result which is more acceptable and implies that something
    screwy is going on.
    
    I had user-defined DBKEY assignments in the client DB2 attach
    configuration file because we had no indexes on the table we wished to
    delete from; now we know what to avoid we are looking at changing the
    table definition to allow a unique key of some sort so we can use
    /DBKEY_MODE=PRIMARY for the particular table.
    
    Thanks for the help so far. I'd be interested to know whether the
    above assertions are correct or otherwise.
1063.5RdbSQL datatype definition for date/timeBROKE::KIPNESFri Jun 14 1996 14:5812
the short answer is yes, there is truncation when converting from DB2
timestamp to DBI DATE VMS. although the vms date datatype allows for
sufficient precision, RdbSQL defines date/time datatypes with from 0 to 2
digits of fractional seconds, so the last 4 or 5 digits of the fractional
seconds from DB2 get lost in the conversion. 

in general it should be more efficient to use primary_key as a dbkey, so your
proposed change is the right way to go.

sorry about the problem,
linda kipnes
    
1063.6ThanksORAREP::GIDDAY::VASSILMon Jun 17 1996 02:206
    Hi Linda,
    
    Thanks for the info, I'll let my customer know.
    
    Cheers,
    Mario