Re: Newbie question about casting literals - oracle/postgres - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: Newbie question about casting literals - oracle/postgres
Date
Msg-id 417F0DB0.2020000@commandprompt.com
Whole thread Raw
In response to Newbie question about casting literals - oracle/postgres  ("Naeem Bari" <naeem.bari@agilissystems.com>)
List pgsql-general

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?

You could create separate views for both. That means you would have to keep seperate views for each database but the SQL in your code would be the same.

Sincerely,

Joshua D. Drake



 

Thanks!

naeem



-- 
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL

pgsql-general by date:

Previous
From: "mayra"
Date:
Subject: Theory
Next
From: Robby Russell
Date:
Subject: Re: primary key and existing unique fields