The Altair Community and the RapidMiner community is on read-only mode until further notice. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here.
Options
Passing parameter to mysql stored procedure for Read Database
![chakravarthy_ra](https://us.v-cdn.net/6030995/uploads/defaultavatar/nCCNNSPK1YM69.jpg)
![](https://s3.amazonaws.com/rapidminer.community/vanilla-rank-images/contributor-16x16.png )
I have following statement in the Build SQL query , for 'Read Database' operator, which gives result.
call tatvam_opms.volume_change(@customer_id_in=null);
How do i make that input into a prepared statement ? So user can key in 'null' or some other value ?
(null)
Tagged:
0
Best Answers
-
Options
chakravarthy_ra Member Posts: 6
Contributor II
Ok so i created a macro with variable as customer_id_in. Then refrenced this in the SP execution as SPName(%{customer_id_in}).
It worked. Thanks
2 -
Options
Edin_Klapic Moderator, Employee, RMResearcher, Member Posts: 299
RM Data Scientist
Hi @chakravarthy_ra,
In order to prevent SQL injection I propose to check prepare statement in the Read Database Operator.
Then you can select a list of parameters (i.e. the values) you want to use in Read Database (see screenshot).
Afterwards you need to replace the macro in the SQL statement with a question mark (?).
Best,
Edin
2