Component results passing to another component

Hi,

I'm still learning this tool and need some help on achiving this.

my source is snowflake and using component to get one column values and I need to pass this column values to next component which is DataBase Query. How can I do it?

Eample:

Source (Snowflake)

select col_a <-----

from table_name

 

To (DB query)

select count(*)

from col_a <----

 

 

Thanks,

BS

 

 

 

You can try the following approach:

  1. Creata a new job variable $myvar
  2. Use "Query Result To Scalar" (https://documentation.matillion.com/docs/2978362) to load a value to $myvar
  3. In the Database Query Component choose advanced mode and add $myvar to your query: select count(*) from ${myvar}

Thanks Michael. This helps.

facing another issue. can you suggest what i'm doing wrong?

 

I'm using the database query component to connect SAP hana and i'm doing just

select count(*) from sap_db_name.${saptablename}

 

${saptablename} = Is passed from scalar variable. I can see this variable showing correct values when i check SQL of database query component to make sure this variable is getting value or not.

 

error

SQL compilation error: error line 1 at position 60

invalid identifier '"COUNT(*)"'

 

 

Hi @santosh.b.biradar​ ,

I am not familiar with SAP hana. If that query can be executed in your source database system and the SQL which is generated by Matillion is valid, then the Database Query Component should work. I think you should open a ticket with Matillion Support to investigate this further.