예를 들어 문자열에 ${variable1}
및 ${variable2}
이 포함 된 문자열이 있습니다.bash는 scala에서와 유사합니다.
"select * from table where product ='${variable1}' and name='${variable2}'"
eval을 사용하여 런타임에 bash에서 문자열을 평가할 수 있습니다. 다음은 select * from table where product='iphone' and name='apple'
어떻게 스칼라에서 동일한을 달성하기 위해 회전
export variable1="iphone"
export variable2="apple"
sql_query=`eval echo ${sql_query}`
? 현재 문자열 바꾸기 함수를 사용하고 있습니다.
다른 방법이 있습니까? 스칼라에 eval이 있습니까?
수동으로 SQL 문에 매개 변수를 인용의 LANG 무엇이든, SQL 주입 – cchantep