Changes between Version 7 and Version 8 of FDORfc50


Ignore:
Timestamp:
Jun 2, 2010, 11:31:43 AM (14 years ago)
Author:
gregboone
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc50

    v7 v8  
    6262We will use some SQL examples just to illustrate things we are trying to achieve, each RBDMS-based provider will translate FDO selects in server side SQL depending of the server capabilities.
    6363
    64 '''SELECT * FROM class1 AS p1, class2 AS p2 WHERE p1.ID=p2.!FeatId AND SPATIAL_COND(p1.GEOM, GEOM_VAL);'''
     64''SELECT * FROM class1 AS p1, class2 AS p2 WHERE p1.ID=p2.!FeatId AND SPATIAL_COND(p1.GEOM, GEOM_VAL);''
    6565
    6666Below we added some C++ code on how caller can use this new improvement to achieve above select statement:
     
    8484}}}
    8585
    86 '''Note:''' In the base class we have a method named !GetFeatureClassName, in case caller will use it and the !FdoIdentifier is not added into !GetFeatureClassNames we can add it at Execute time.
    87 
    88 
    89 === Handle Joins ===
     86''Note:'' In the base class we have a method named !GetFeatureClassName, in case caller will use it and the !FdoIdentifier is not added into !GetFeatureClassNames we can add it at Execute time.
     87
     88=== Handling Joins ===
    9089
    9190Below we define new classes to define and use a join criteria used in the join select.
     
    180179Join criteria will be used to generate join SQL commands, like:
    181180
    182 '''SELECT p.!FeatId AS xFID,p.Geometry,pxy.Name,pxy.X,pxy.Y,pex.NameB,pex.Link FROM p '''[[BR]]
    183 '''INNER JOIN pxy ON(p.!FeatId = pxy.!FeatId)'''[[BR]]
    184 '''INNER JOIN pex ON(pex.FID = pxy.!FeatId)'''[[BR]]
    185 '''WHERE p.!FeatId >= 0;'''[[BR]]
     181''SELECT p.!FeatId AS xFID,p.Geometry,pxy.Name,pxy.X,pxy.Y,pex.NameB,pex.Link FROM p ''[[BR]]
     182''INNER JOIN pxy ON(p.!FeatId = pxy.!FeatId)''[[BR]]
     183''INNER JOIN pex ON(pex.FID = pxy.!FeatId)''[[BR]]
     184''WHERE p.!FeatId >= 0;''[[BR]]
    186185
    187186Below we added some C++ code on how caller can use this new improvement to achieve above select statement:
     
    245244Named sub-select will be used to generate SQL commands, like:
    246245
    247 '''SELECT * FROM point WHERE  !FeatId IN (SELECT pt.!FeatId FROM pt WHERE pt.!FeatId >= 2 AND SPATIAL_COND(pt.GEOM, GEOM_VAL));'''
     246''SELECT * FROM point WHERE  !FeatId IN (SELECT pt.!FeatId FROM pt WHERE pt.!FeatId >= 2 AND SPATIAL_COND(pt.GEOM, GEOM_VAL));''
    248247
    249248In above case we will have two selects having following filters:
    250     * Main select:  “!FeatId IN(:SUBSEL)”
    251     * Sub-select: “pt.!FeatId >= 2 AND SPATIAL_COND(pt.GEOM, GEOM_VAL)”
     249    * Main select: !FeatId IN(:SUBSEL)
     250    * Sub-select: pt.!FeatId >= 2 AND SPATIAL_COND(pt.GEOM, GEOM_VAL)
    252251
    253252Below we added some C++ code on how caller can use this new improvement to achieve above select statement:
     
    276275}}}
    277276
    278 In order to be able to support sub-selects for '''IN''' operator we need provide a way to pass it through FDO Filter and make the parser to recognize the filter, since FDO Filter parser don’t know SQL syntax. The best way to achieve that is to pass a parameter in the filter, e.g.: '''!FeatId IN(:PARAM)'''. This parameter will be replaced by the provider at execution time by the sub-select. This way we improve IN() operator in FDO to handle sub-selects.
     277In order to be able to support sub-selects for '''IN''' operator we need provide a way to pass it through FDO Filter and make the parser to recognize the filter, since FDO Filter parser don’t know SQL syntax. The best way to achieve that is to pass a parameter in the filter, e.g.: ''!FeatId IN(:PARAM)''. This parameter will be replaced by the provider at execution time by the sub-select. This way we improve IN() operator in FDO to handle sub-selects.
    279278
    280279