Обсуждение: why does this query does not work??????

Поиск
Список
Период
Сортировка

why does this query does not work??????

От
satya pariki
Дата:
are there any substitution variables in postgresql ?
 select * from EMP where EMPNO = &empnum;

it is giving error. it is telling to type cast or use
parenthesis.

i will be grateful if u help me out of this.

bye
satya

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com


Re: why does this query does not work??????

От
"Josh Berkus"
Дата:
Satya,

> are there any substitution variables in postgresql ?
> 
>   select * from EMP where EMPNO = &empnum;

No.  If you need to use variables, write a PL/pgSQL function or do the
substitution in your middleware/client language.

-Josh


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: why does this query does not work??????

От
Jeff Eckermann
Дата:
If you are using psql (command line client), you can
use:
\set variable_name variable_value
Then refer to the value by ":variable_name", i.e.
colon instead of ampersand.
"man psql" for more information.
--- satya pariki <spariki@yahoo.com> wrote:
> are there any substitution variables in postgresql ?
> 
>   select * from EMP where EMPNO = &empnum;
> 
> it is giving error. it is telling to type cast or
> use
> parenthesis.
> 
> i will be grateful if u help me out of this.
> 
> bye
> satya
> 
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org


__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com