Forum Discussion

aignn's avatar
aignn
Helper II
6 years ago

How use parameter in Mysql connector query?

hello!

Tell me please how use parameter in Mysql connector query?

 

I use Mysql connector in Powerbi for get data from Mysql base

 

 

 

= MySQL.Database("mysqlserver1.local", "base", [Query="  select.............................. where queue=1", ReturnSingleDatabase=true])

 

 

I want to create a parameter and substitute different values instead of 1 in the queue

 

Thank you advace

2 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi aignn ,

     

    We can create a parameter called "id_parameter" and use text type, then use it as following formula:

     

    = MySQL.Database("localhost", "testdb", [ReturnSingleDatabase=true, Query="select * from testdb.tablename where category_id = " & id_parameter])

     

     

    Please also refer to this thread about the warning "Permission is required to run this native database query".

    https://community.powerbi.com/t5/Desktop/Permission-is-required-to-run-this-native-database-query/td-p/750878

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi aignn ,

     

    How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.