Skip to Content
0

Input Parameter on a SQLScript function in Calculation View fails

Dec 15, 2016 at 01:05 PM

98

avatar image

Hello, Gurus. Hope you can advice on this one.

I have the following where clause on a script Calculation View on HCP

where t2."UserId" is null
and t1."BeaconId" = '$$ENTRANCEBEACON$$'
and t1."Date" <= current_timestamp
and t1."Date" > ADD_SECONDS(current_timestamp, '$$INTERVAL$$') 

The first parameter ENTRANCEBEACON works fine, the problem is the INTERVAL.

Since the function ADD_SECONDS expect a number the system is not recognizing this input parameter as a placeholder, but as a string:

Encountered an error in repository runtime extension;Model inconsistency. Deploy Calculation View: SQL: SqlScript: invalid number: not a valid number string '$$INTERVAL$$'

I tried also to force the conversion with

and t1."Date" > ADD_SECONDS(current_timestamp,TO_INT('$$INTERVAL$$') )

but got also an error due the '$$'

Model inconsistency. Deploy Calculation View: SQL: SqlScript: invalid number: not a valid number string '$$INTERVAL$$' at function to_int() 

Any advice here would be really appreciated.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers