Hello,
I have a following statement:
case when ($(DB_OPERATION) = 'INSERT')
then (
select max(uot.id)+1 as id, i.geometry_type as geometry_type, i.name as name,
i.name as label, i.name as label_mask
from unip_object_type uot
cross join Inserted i)
else select * from Inserted i
end
When I run this in my workspace, I get the following error:
InlineQuerier(InlineQueryFactory): Error preparing database query: near "case": syntax error Unable to execute statement
InlineQuerier(InlineQueryFactory): Database was unable to prepare query 'case when (UPDATE = 'INSERT') then (
select max(uot.id)+1 as id, i.geometry_type as geometry_type, i.name as name,
i.name as label, i.name as label_mask
from unip_object_type uot
cross join Inserted i)
else select * from Inserted i
end
'.
InlineQueryFactory instance was not properly defined. Consult logfile for details.
InlineQuerier(InlineQueryFactory): A fatal error has occurred. Check the logfile above for details
A fatal error has occurred. Check the logfile above for details
It has to be my mistake in the case statement. When I run the query just as
select max(uot.id)+1 as id, i.geometry_type as geometry_type, i.name as name,
i.name as label, i.name as label_mask
from unip_object_type uot
cross join Inserted i
It works. However I need to run this query only when $(DB_OPERATION) (user parameter) is set to INSERT, when it is UPDATE, I need to only do select.
Any help is really welcome.
Thanks,
Radek