[odb-users] Native view paramter placeholder (?)

Andrei Ivanov andrei.i.ivanov at commandus.com
Thu Jun 9 20:39:52 EDT 2016


Hi Boris,

Ok, thank you, it works fine.

2016-06-10 2:17 GMT+09:00 Boris Kolpackov <boris at codesynthesis.com>:

> 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
>



-- 
Best regards,

Andrei Ivanov
tel:+7 (914) 104-0619
fax:+1 (801) 880-0903
http://commandus.com/


More information about the odb-users mailing list