Skip to Content

Input Parameter on a SQLScript function in Calculation View fails

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers