Обсуждение: column name does not exist

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

column name does not exist

От
abhinav mehrotra
Дата:
 
Hi All,
 
I have created a stored procedure
 
CREATE OR REPLACE FUNCTION ab(integer, integer,varchar,text,integer) RETURNS text AS'
DECLARE
 ret text;
BEGIN
     if(ret is null) then
          raise notice ''invalid auxiliary tag'';
     end if;
     return ret;
END;
'LANGUAGE 'plpgsql';
 
On doing: select * from ab (1,4,"exam","abhi",5);
 
I get an error : ERROR: column "exam" does not exist.
 
 
Any idea what is going wrong? Am I missing something?
 
Thanks in Advance
Abhinav
 

 

Re: column name does not exist

От
Michael Wood
Дата:
Sorry, meant to send this to the list:

2009/7/28 abhinav mehrotra <talk2abhinav@gmail.com>:
[...]
> On doing: select * from ab (1,4,"exam","abhi",5);
>
> I get an error : ERROR: column "exam" does not exist.
>
>
> Any idea what is going wrong? Am I missing something?

Use single quotes.  Otherwise PostgreSQL thinks you're talking about
columns instead of literal strings:
- Hide quoted text -

select * from ab(1, 4, 'exam', 'abhi', 5);

--
Michael Wood <esiotrot@gmail.com>