rose-db-object

How to pass a a string variable as “query” for get Manager call?

可紊 提交于 2019-12-12 05:14:47
问题 I'm trying to make this simple call: DataB::testTable::Manager->get_testTable( query => [ id => $id, name => $name ] ) which works perfectly fine. But is it possible to pass a variable for the query. Something like: $query = "id => $id , name => $name"; DataB::testTable::Manager->get_testTable( query => [ $query ] ); or something similar. 回答1: Strings and complex data structures are completely different things. Strings are a sequence of codepoints/graphemes/bytes (depends how you're looking).

How do i pass a variable for the query in a get Manager call?

拈花ヽ惹草 提交于 2019-12-12 05:14:47
问题 I am trying to make a simple Rose DB call: $id = xyz; $name = "company"; DataB::testTable::Manager->get_testTable( query =>[ id => $id, name => $name ] ); in it possible to not have the whole query written every time, and declare it like a string variable such that i can just call DataB::testTable::Manager->get_testTable( query =>[ $query ] ); where $query = qq { id => $id , name => $name }; Please Help 回答1: By what I understood from your question, I am giving this answer. Try this one. my