1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Forum Post: RE: Has anyone attached SDO procedure logic with SDO ?

Discussion in 'PSDN Community Discussion Forum' started by jasdeep, Aug 15, 2014.

Thread Status:
Not open for further replies.
  1. jasdeep

    jasdeep Guest

    Thanks Harvard. I have to create and populate a temp table first based on the where condition. DEFINE TEMP-TABLE tempRFSH-1 FIELD Source_Id LIKE RFSH.Source_Id. FOR EACH RFSH WHERE DATE(RFSH.DATE_Time_Updated) = DATE("03/26/2009") BREAK BY RFSH.SOURCE_Id BY DATE(RFSH.DATE_Time_Updated) : IF FIRST-OF (RFSH.Source_Id) THEN DO: CREATE tempRFSH-1. ASSIGN tempRFSH-1.Source_Id = RFSH.Source_Id. END. END. How the logic in the above query can be implemented using SDO? Then I have to use it in the query block like this. There is requirement of the buffer as well for the same table. OPEN QUERY qh FOR EACH tempRFSH-1 , EACH bufRFSH-2 WHERE bufRFSH-2.SOURCE_Id = tempRFSH-1.SOURCE_Id AND (bufRFSH-2.QSA_Approved = YES OR bufRFSH-2.QSA_Approved = NO), FIRST bufRFS NO-LOCK WHERE bufRFS .Source_Id = tempRFSH-1.SOURCE_Id , FIRST tempUA USE-INDEX I_UID OUTER-JOIN OF bufRFSH-2 WHERE tempUA .UID = bufRFSH-2.UID . So basically following will be used : RFSH - its temp table is TempRFSH and its buffer is bufRFSH bufRFS - it will be buffer for RFS table tempUA is temp table for UA. I was able to implement the self join if I do not use tempRFSH table in second query and use the original table RFSH instead. But this ends up in duplicate records . So to eliminate this I have to use the first query for creating temp table and populating it. How the logic in the first query can be implemented using SDO? Thanks

    Continue reading...
     
  2.  
Thread Status:
Not open for further replies.

Share This Page