Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Getting ExtendedData information
Cheryl_Henry_(nswcdahladmin_-_(deleted))
Is there any way to get the value of a field that is part of the extendeddata field?If I wanted to get the max value of a field in Oracle I would have the SQL statement "select max(SNUMBER) from ATABLENAME". If SNUMBER was one of the fields that was created as an extendeddata field, how would I get this value? Is it possible?Would have have to extend my schema to include another table?Thanks.
Find more posts tagged with
Comments
Robert_Davies_(unlondonadmin_-_(deleted))
Hi Cheryl.My knowledge of Oracle and SQL is fairly basic so I can't really help you except to recommend looking into using 'temporary' tables.I remember reading somewhere that you could create a temporary table on-the-fly ( as a result of one query ) that could then be used during another.Here you would select the field out of the extenddata data area into a temp table, then select the max/min/whatever from that.No-one here knows how to do this and I may be talking out of my hat, but I hope this may help get you started.Best regards/matt.
Cheryl_Henry_(nswcdahladmin_-_(deleted))
Thanks for your reply.My problem is getting the single element from the ExtendedData field. When doing a select on the extended data field you get back something like, A<1,?, 'fieldname1'='fieldvalue1','fieldname2'='fieldvalue2'. I am not sure on how to construct my SQL to get only the one field value.Marjorie Parish
Paul_Eddie_(PEddie_(Delete)_801545)
You have two choices:1) loop through each record and check the field within the Assoc.2) run a utility that copies the field value into a custom table that you created. -- (you can actually use DAPI.AddNodeUserColumn which will add a column for you to use).Here is the info on the DAPI.AddNodeUserColumn: AddNodeUserColumn Integer AddNodeUserColumn( DAPISESSION sesssion, String columnName, String columnType ) Adds a new column to the DTree table. This is most often used during system configuration to properly set up the database. Parameters: session - The DAPISESSION object handle. columnName - The name of the new column. columnType - The data type of the new column. Returns: DAPI.OK (Integer 0) if successful; Error otherwise.
Bickers
Your problem here is that the extendeddata column in DTRee is a long string, so in terms of SQL you can't access individual fields within it (because Oracle doesn't see any fields. Livelink converts the extendeddata Assoc to a string before storing in the database).Another problem is that I don't think you can query a long field.If you need to be able to query your extended data regulary, the only way I can think of is to store the data in your own table, rather (or in addition to) the extendeddata column.If you need some examples of which OSpace objects/scripts you would need to change, let me know and I'll see what I can find.Phil.
Cheryl_Henry_(nswcdahladmin_-_(deleted))
Thanks,I created a new sequence and extended the database schema, instead of trying to get a value from an extended data column. Thanks for you help.
Cheryl_Henry_(nswcdahladmin_-_(deleted))
Thanks for the help.I went off in another direction and created a sequence for a number ordering. But what you have provided for me will be very helpful, for other things I will need to do.Thank you very much.
David_Dutro_(DDutro_(Delete)_1047665)
Does anyone have an example of getting/setting extendedData via LAPI? I can't figure that one out.
Christina_Pultrone_(x-nasalewisadmin_-_(deleted))
Hi, Unfortunately, it can't be done! I asked OT support about this and here is their reply:I'mafraid that I don't have any really good news for you. You are correct innoting that there is at present, no way to update the ExtendedData field foran object using LAPI. The good news (?) is that this was reported as a bugpreviously and our development group is well aware of this limitation andare looking at ways to rectify this situation in a future release of theproduct. For your reference, the bug number for this issue is: 1601939.
Babulal_Rawal_(ConAdmin_(Delete)_2212090)
We are trying to implement a custom table that would be linked to the DTREE table to implement custom node attributes and functionality. Could you give us pointers/examples on how we can accomplish this?Can we use triggers to maintain referential integrity between DTREE table (ExtendedData column) and our custom table(s)?
Alex_Kowalenko_(akowalen_(Delete)_2285456)
I routinely get information from the ExtendedData field of DTree. In an Oracle PL/SQL program use a cursor to select ExtendedData to a VarChar2(32000) variable and then parse it out. Of course, if there is more than 32K then this doesn't work well.
Alex_Kowalenko_(akowalen_(Delete)_2285456)
In Oracle you can add a function to the schema to convert the first 32,000 characters of ExtendedData into a VarChar2 datatype:create function ed_char(selid in number) return varchar2 is edc varchar2(32000); begin select extendeddata into edc from dtree where dataid = selid; return(edc); end;Then you can use SQL functions on this function to manipulate the extendeddata.Here's another function that extracts a named assoc value from extendeddata:create or replace function ed_value(selid in number, valuekey in varchar2)-- Extract an assoc character value from DTree.ExtendedData-- This function searches for ''='' and returns -- Alex Kowalenko 2001 01 02 return varchar2 is edc varchar2(32000); keytag varchar2(255); vstart number(10); vend number(10); retvalue varchar2(32000); begin select extendeddata into edc from dtree where dataid = selid; keytag := '''' || valuekey || '''='; vstart := Instr(edc,keytag); If vstart = 0 Then retvalue := null; Else vstart := vstart + Length(keytag) + 1; vend := Instr(edc,''',''',vstart); If vend = 0 Then vend := Instr(edc,'''>',vstart); End If; If vend >= vstart Then retvalue := replace(substr(edc,vstart,vend-vstart),'\''',''''); Else retvalue := null; End If; End If; return(retvalue); end;These functions can be used in LiveReports. An example is a LiveReport that lists discussion threads by extracting 'Content' assoc values containing discussion comments.