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

Question

Question

Token not found error in Custom Query

asked on December 8, 2017

Getting an error when running some custom queries against the Laserfiche database for audit purposes.  

Doing a simple SELECT from the TOC table where del_tocid = 0 and etype = 0 and name LIKE '%([0-9])%'

When I hit the test button it works fine.

Any ideas as to why the test would work but not when running the workflow?

 

Thanks,

Chris

0 0

Answer

SELECTED ANSWER
replied on December 11, 2017

Hm, that's interesting. I'll look into what's actually happening.

Try it like this (with a "/" before the % to turn off token parsing):

select *  from TOC where del_tocid = 0 and etype = 0 and name LIKE '/%([0-9])%'

 

0 0

Replies

replied on December 8, 2017

Testing a query asks for all parameter values up front, so it's not trying to resolve tokens. The runtime does attempt to resolve tokens.

The query should return results anyway, it's just a warning that something may not be right based on what Workflow knows about tokens in this instance.

0 0
replied on December 8, 2017 Show version history

Hmm, thanks Miruna.  

Something does not seem to be right though.  There are no tokens as its just a straight query with no parameters.  I have other custom queries going and these are the only two that are having the problem.  Checking the tokens on one of them shows

Yet when I run the test it only shows 328.  Also when I run the syntax in SQL I get 328.

There are certainly not 71,000 plus repository entries with possible (2), (3), etc.  I am looking for the result count in WF to be same (328)

Edit - Here is the exact syntax:

SELECT [tocid]
           ,[name]
  FROM [database].[dbo].[toc]
  where del_tocid = 0 and etype = 0 and name LIKE '%([0-9])%'

Ahh, ok.  Now that I type it out, the syntax starts exactly like a token...  %(

So the SQL syntax happens to conflict with Workflows naming scheme.  That's a first for me, any ideas on how to treat that literally and not as a token?

 

 

0 0
SELECTED ANSWER
replied on December 11, 2017

Hm, that's interesting. I'll look into what's actually happening.

Try it like this (with a "/" before the % to turn off token parsing):

select *  from TOC where del_tocid = 0 and etype = 0 and name LIKE '/%([0-9])%'

 

0 0
replied on December 11, 2017

Thanks Miruna.  Adding the / in front of the % is what did the trick.  Final string was:  LIKE '/%([0-9]%)%'

The activity does return 0 rows when I test it.  However, the activity is green and the output to my word document matches the count I get in the Client.  

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

Sign in to reply to this post.