You are viewing limited content. For full access, please sign in.

Question

Question

The 'short_str_val' Column

asked on April 24, 2017

How does the short_str_val column of the propval table get populated?

0 0

Answer

SELECTED ANSWER
replied on April 25, 2017 Show version history

Actually, it looks like this is the only trigger that's used in the database schema. Backup the database first and then run the following query while the Laserfiche Server service is stopped:

create trigger short_str_val_insert_update
	on propval
	after insert, update
as
	set nocount on

	if update(str_val)
		update propval
		set short_str_val = case when len(i.str_val) <= 100 then i.str_val else null end
		from inserted i
		where propval.tocid = i.tocid
		and propval.prop_id = i.prop_id and propval.pos = i.pos

As for addressing the existing values that need a short_str_val, you can run

update propval set short_str_val = str_val where str_val is not null and len(str_val) <= 100

Then restart the Laserfiche Server service.

1 0

Replies

replied on April 24, 2017

The propval table uses two columns for text type metadata fields. If the value saved in the field is 100 characters or less, then it will get written to both the str_val and short_str_val columns. Otherwise, if the field value is over 100 characters then it just gets written to the str_val column. This is for search performance reasons.

1 0
replied on April 24, 2017

At some point, values have stopped getting written to the short_str_val column completely, regardless of  character length.  This has definitely impacted search results.  Only rows with a short_str_val column value are returned.  Is there some obscure administrative setting that could have been changed to cause this?

0 0
replied on April 24, 2017

This isn't controlled by a setting.

The propval table should have a trigger named [short_str_val_insert_update] that checks after insert or update, if the length of the str_val value is <= 100, then set the value into short_str_val.

Can you confirm that trigger exists in the propval table in your repository database?

0 0
replied on April 25, 2017

The trigger does not exist in the propval table.

0 0
replied on April 25, 2017

None of the tables in the repository database have a trigger.

0 0
replied on April 25, 2017

Did something happen to your original repository database where you needed to recover it or restore the data to a new database?

Otherwise, I can't explain why else you might not have any triggers on any tables at all. The integrity of the database may be suspect at this point.

Was there a specific event that occurred which could have affected your database as such? Can you check any database backups you may have to see if those contained the proper triggers?

0 0
replied on April 25, 2017

In July 2014, we migrated from an offsite to onsite hosting solution.  This is the same time frame in which values stopped getting written to the short_str_val column.

0 0
SELECTED ANSWER
replied on April 25, 2017 Show version history

Actually, it looks like this is the only trigger that's used in the database schema. Backup the database first and then run the following query while the Laserfiche Server service is stopped:

create trigger short_str_val_insert_update
	on propval
	after insert, update
as
	set nocount on

	if update(str_val)
		update propval
		set short_str_val = case when len(i.str_val) <= 100 then i.str_val else null end
		from inserted i
		where propval.tocid = i.tocid
		and propval.prop_id = i.prop_id and propval.pos = i.pos

As for addressing the existing values that need a short_str_val, you can run

update propval set short_str_val = str_val where str_val is not null and len(str_val) <= 100

Then restart the Laserfiche Server service.

1 0
replied on April 25, 2017

Thank you, Alexander.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.