[odb-users] Native view paramter placeholder (?)
    Boris Kolpackov 
    boris at codesynthesis.com
       
    Thu Jun  9 13:17:54 EDT 2016
    
    
  
Hi Andrei,
Andrei Ivanov <andrei.i.ivanov at commandus.com> writes:
> When aI put parameter placeholder for text '(?)' like this:
> 
> #pragma db view query("SELECT \"object_id\" userid FROM \"User_phones\"
> WHERE value_number1 = '(?)'");
> 
> it produces SQL statements with parens like this
> 
> ..."User_phones" WHERE value_number1 = '(79141040619)'
The manual, specifically, the section that talks about native views
explicitly says that this won't work.
> How must I use striing placeholder?
There is no such thing as "string placeholder" in ODB. Your best option
is probably this:
#pragma db view query("SELECT \"object_id\" userid FROM \"User_phones\"");
db->query<...> ("value_number1 = '79141040619'");
Boris
    
    
More information about the odb-users
mailing list