Newbie question about casting literals - oracle/postgres

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

Ok,

 

I have a query that runs fine in oracle:

 

   select driver_id, 'GREEN' as color, pos_date, pos_lat, pos_lon

   from driver_pos

   where driver_id = 1

   order by pos_date

 

The only way this works in postgres is by casting ‘GREEN’ to text using ‘GREEN’::text

 

The problem is then this does not work with oracle. Since my software has to support both databases, I am left in a bit of a bind. Any ideas on how to make postgres accept ‘GREEN’ as text without my having to spell it out by casting?

 

Thanks!

naeem

В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: list fieldnames in table? (from PHP)
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: [Fwd: Abrupt close of pgsql backend]