cancel
Showing results for 
Search instead for 
Did you mean: 

IDT - Universes - Dynamic SQL with Parameters

tkim1205
Explorer
0 Kudos

Hi all,

Is it possible to create "dynamic" SQL statements with Parameters?

For example, I created a parameter called "CUSTOM_PARAM".

I set it to something like "(CASE WHEN COMPANY_ID > 100 THEN 1 ELSE 0 END) AS CUST_ATTR".


I then created a Derived Table:

SELECT

     a.*,

     @Prompt(CUSTOM_PARAM)

FROM company_table a

Unfortunately when I show values, the CUSTOM_PARAM is showing up as a string.

Any idea how I can make my SQL script or Derived Table dynamic?

Accepted Solutions (0)

Answers (1)

Answers (1)

amitrathi239
Active Contributor
0 Kudos

what is the data type of parameter you have selected in the Parameters and list of values section in data foundation?

tkim1205
Explorer
0 Kudos

there were a few options. String, numeric, Boolean, and date i believe. I picked string.

amitrathi239
Active Contributor
0 Kudos

what is the actually values in the CUSTOM_PARAM?

if values are string then you need to select string type and you will get string values only.if numeric then you need to select numeric type.