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

Conference orarep::nomahs::dbstars

Title:DBSTARS Conference
Moderator:BROKE::BASTINE
Created:Wed Feb 02 1994
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:791
Total number of notes:1521

760.0. "union views in dbi have dbkey value=0" by BROKE::BITHER () Wed Apr 09 1997 08:40

Doc error.  Write article.
     <<< NOMAHS::DISK$NOMAHS1:[NOTES$LIBRARY]DBINTEGRATOR_PUBLIC.NOTE;2 >>>
                      -< DB Integrator Public Conference >-
================================================================================
Note 1147.0           DBI and dbkey lengths greater than 0             3 replies
DIGANT::GREEN                                        22 lines   8-APR-1997 11:06
--------------------------------------------------------------------------------
Hi All,

On page 11-8 of the Rdb Distributed Option Product Family User Guide (V7) it
says that DBI always returns a dbkey value greater than 0.

I've create a union view in DBI of two Rdb tables and the dbkey length of this
view is 0.  Is this a bug or a documentation error?

In the following example the first two relations are Rdb tables, the last 
is a DBI union view.

SQL> attach 'f /type=dbi/dbname=dbi_catalog';
SQL> select rdb$relation_name, rdbdbi$dbkey_type, rdb$dbkey_length
cont> from rdb$relations
cont> where rdb$system_flag=0;
 RDB$RELATION_NAME                 RDBDBI$DBKEY_TYPE   RDB$DBKEY_LENGTH
 DG_UNION_LEFT                                     1                  8
 DG_UNION_RIGHT                                    1                  8
 DG_UNION_VIEW                                     0                  0

Thanks,
Don
================================================================================
Note 1147.1           DBI and dbkey lengths greater than 0                1 of 3
BROKE::ABUGOV                                         9 lines   8-APR-1997 13:56
                     -< Need union all view to see dbkeys >-
--------------------------------------------------------------------------------
    
    Hi Don,
    
    This assumes that it is possible to uniquely identify a row.  If you
    changed your view to a union all view (I assume you have a union view)
    then you will see dbkeys.  You can't use dbkeys in union views, you can
    in union all views.
    
    dan
================================================================================
Note 1147.2           DBI and dbkey lengths greater than 0                2 of 3
BROKE::GREEN                                         11 lines   8-APR-1997 15:04
                         -< Thanks - will report back >-
--------------------------------------------------------------------------------
    Hi Dan,
    
    Thanks.
    
    I think I'll have to revisit my test.  Yes, I used a union view.  But
    now that I look back at the customer's mail he claims he did a union
    all view.  
    
    Back to the drawing board.
    
    Don
================================================================================
Note 1147.3           DBI and dbkey lengths greater than 0                3 of 3
BROKE::GREEN                                          6 lines   8-APR-1997 15:11
                               -< 100% correct >-
--------------------------------------------------------------------------------
    Dan,
    
    Right as rain on the union all view.
    
    Thanks,
    Don
T.RTitleUserPersonal
Name
DateLines
760.1Hold off for a bitBROKE::GREENWed Apr 09 1997 10:545
    This issue needs some more testing before writing the article.  Right
    now we know that the doc is wrong in it's flat out statement that DBI
    always returns a length greater than 0.  But now in addition to union 
    versus union all, there's some differences regarding behavior when the
    view is created in DBI versus being imported from the Rdb UDB.