Question - Adding non-database field column to temp table us

Posted by jasdeep on 30-Oct-2014 09:50

I need to create a temp table using SDO with non-database table column along with database table columns. For instance: DEFINE TEMP-TABLE tempBirthPlaceAlias FIELD Birthplace_Id LIKE RFRealBirthplace.Real_Birthplace_Id FIELD Real_Birthplace like RFRealBirthplace.Real_Birthplace FIELD Birthplace like RFBirthplace.Birthplace ==> FIELD Count AS INTEGER. Is there a way to add non-database table field to temp table as pointed above(FIELD Count AS INTEGER.)? SDO does not allow to define temp table in its initializeobject procedure or user defined function. Is it possible with SDO?

All Replies

Posted by Ken McIntosh on 30-Oct-2014 13:45

Hi Jasdeep,

The issue you bring up is a known issue within the tools from 9.1C timeframe, which development determined not to fix at that time.

The workaround is to directly edit the SDO in the procedure editor, or to use the TEMP-DB maintenance utility for creating objects from TEMP-TABLEs.

Cheers,

Ken McIntosh

Posted by jasdeep on 30-Oct-2014 13:55

Thanks Ken. It would be great if you could elaborate the  workaround is to directly edit the SDO in the procedure editor.

I tried working in the query window for SDO. But it does not allow to define temp table.

Posted by Håvard Danielsen on 30-Oct-2014 14:15

There is an option to add Additional Fields in the dialog where you define the temp-table for the SDO.  But you can also add extra fields as Calculated fields to the SDO's RowObject temp-table.    

Posted by Håvard Danielsen on 30-Oct-2014 14:33

Sorry, I misunderstood the question as a how to add extra fields (not directly bound to the data ) to an SDO. As Ken points out the Additional Fields option does not work on an existing SDO.    

Posted by Håvard Danielsen on 31-Oct-2014 13:40

More corrections:

The Additional Fields option apparently does not work when creating a new SDO either. As Ken pointed out the issue was reported in 9.1C. It was originally reported as a problem with editing an existing SDO, but was updated later with info about this not working at all.        

The bug was closed as no plan to fix with the following reasoning:

A new temp-db maintenance tool was introduced in 10.0B.  The recommended approach is to use that tool to maintain temp tables for use in tools.

Posted by Ken McIntosh on 03-Nov-2014 07:57

Hi Jasdeep,

What I found is that you can modify the sdo include file to add the field definitions that you want, then do the same everywhere the fields are listed in the SDO.  You cannot, however, ever edit the SDO in the AppBuilder from that point forward, because it assumes that any contained fields are able to be referenced in the database using LIKE syntax.

Obviously the additional fields feature is a complete no-op.  The alternatives are to use temp-db maintenance or add the field to your original table.

I hope this helps.

Regards,

Ken McIntosh

Posted by Ken McIntosh on 04-Nov-2014 11:16


Test case entry

Posted by Ken McIntosh on 04-Nov-2014 13:17


Hi Jasdeep,

What I found is that you can modify the sdo include file to add the field definitions that you want, then edit the SDO.w file in the procedure editor and add the field name everywhere the fields are listed in the SDO.

Doing this however prohibits opening the SDO in the AppBuilder, because the AppBuilder will overwrite all of your changes.

The benefit of this approach is that the browsers and viewers that are based on the SDO in question read the SDO include file for their field definitions, so adding the field(s) to the SDB or SDV is no different than usual as long as you've recompiled your SDO manually (e.g. COMPILE sdo.w SAVE).

Please let me know if this is not clear. If you wish I will be happy to demonstrate this using a screen sharing tool. I will also be happy to demonstrate using the temp-db maintenance tool, which is also available in your current release.

Thanks,
Ken McIntosh
(781)280-3059

This thread is closed