jmac13
Member
Hi I'm using open edge 10.2b
We have a program that tranfers records on central database to other 'child' databases
the following code is an example
the trouble with this is there is a procedure for each table we are doing is there a better way of doing it. I do store the table name within syncloc.ToLocal. So I know I could create a temp table dynamically but how do I search for the existence of the record dynamically? Can you pickup the indexes so you can check to see if we are going to try a create one that exists already?
We have a program that tranfers records on central database to other 'child' databases
the following code is an example
Code:
create tt-cp2_08. /*Temp table thats defined*/
raw-transfer syncloc.ToLocal.Data to tt-cp2_08.
/*syncloc.ToLocal.Data is a raw that stores the record */
/*find to seee it the record exists on this database*/
find cp2_08 where
cp2_08.compno = tt-cp2_08.compno and
cp2_08.Level1 = tt-cp2_08.Level1 and
cp2_08.Level2 = tt-cp2_08.Level2
exclusive-lock no-error.
if not available cp2_08 then /*if not create record*/
do: .
create cp2_08.
end.
buffer-copy tt-cp2_08 to cp2_08. /*copy contense into record*/
the trouble with this is there is a procedure for each table we are doing is there a better way of doing it. I do store the table name within syncloc.ToLocal. So I know I could create a temp table dynamically but how do I search for the existence of the record dynamically? Can you pickup the indexes so you can check to see if we are going to try a create one that exists already?