cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Keyword Dual Table

Patty_Delmott
Star Contributor
Star Contributor

In the following query, I'm looking for a Unity form where the keyword (130 - dual table) was missing or invalid, and I corrected it by right click/Keywords on the Unity form.  There is only 1 form and 1 keyword, but when I query the table, I get two keyword values - the old one and the new one.  Checked Keywords again (rt click/keywords) to be sure, but still only the new keyword (not both).

select *

from hsi.keytable130 kt,

hsi.keyxitem130 kxi,

hsi.itemdata id

where kt.keywordnum = kxi.keywordnum

and kxi.itemnum = id.itemnum

and id.itemtypenum = 263

and id.status <> 16

and id.itemname like '%7681%'

order by 1

 

Is there another table or something missing in my query?


Thanks!  Patty

1 ACCEPTED ANSWER

Ansley_Ingram
Elite Collaborator
Elite Collaborator

Hi Patty,

Are you saying that you see itemnum 1053102 in hsi.keyxitem130 twice, with two different keywordnum values?

If so, that's actually a valid situation - a document could have multiple values for the same keyword type. However, if you attempted to change the keyword value from one thing to another, we would expect the original value's keywordnum to no longer be referenced by that itemnum in hsi.keyxitem130. The value and keywordnum would still exist in hsi.keytable130 though. 

Can you clarify that this is what you are or aren't seeing?

Thanks,
Ansley

View answer in original post

12 REPLIES 12

Colin_Wright
Champ in-the-making
Champ in-the-making
That looks correct to me.

Double-check: is the query matching a single document? (id.itenum/kxi.itemnum is the same for both records) returned?



Patty_Delmott
Star Contributor
Star Contributor
Yep, ID.itemnum and kxi.itemnum are the same (1053102).

Joe_Pineda
Star Collaborator
Star Collaborator

Hi Patty:

I just tested this using the thick client to change the kw value, and your query, and got one record returned, the latest change I made.

On your KXitem130 table, do you have two of the same keywordnum values for the same itemnum?

Patty_Delmott
Star Contributor
Star Contributor

Hi Jose,

They are different keywordnum values.  Results from query of earlier post:

(images did not appear - looked something like this from keytable130 and keyxitem130 - itemdata was identical on both rows)

keywordnum  keyvaluechar  itemnum  keyword num   keysetnum

976313            E12345678     1053102    976313            0

1110900             12345678     1053102    1110900          0


Document retrieval for ticket #4681 – only one document, only one keyword.

 Thanks!  Patty