Hi Georg, I'm afraid you have to stay with that in 2.0.x... In v. 2.1 parameters in subqueries will be supported
Luigi 2015-03-29 5:33 GMT+02:00 Georg Göttlich <[email protected]>: > Hi everyone. > > I just have a quick best practice question. > I want to set a Link property on a class instance. I have the RID of the > link target as a string. The naive approach would look like this. > > 'INSERT INTO MyClass SET myLink = ' + itemId > > (I can't use a parameter, because Oriento (wisely) escapes all input strings) > > > The trouble is, the the value for itemId comes in form of a user input > over the internet. So I think a saver way would be to do it like this: > > insert into MyClass set myLink = (select from OtherClass where @rid = :itemId) > > Unfortunately params in sub queries don't work currently, so I resort to > building the sub query with Oriento and adding it as a string. > > > But what is you general take on this? Is there a better way to do it? > > > Cheers > > Georg > > > > > > > > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
