pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Explicit Cast
3+ messages / 3 participants
[nested] [flat]

* Explicit Cast
@ 2003-08-20 12:24 Rhaoni Chiu Pereira <rhaoni@sistemica.info>
  2003-08-20 15:19 ` Re: Explicit Cast Mendola Gaetano <mendola@bigfoot.com>
  2003-08-20 15:45 ` Re: Explicit Cast Stephan Szabo <sszabo@megazone.bigpanda.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Rhaoni Chiu Pereira @ 2003-08-20 12:24 UTC (permalink / raw)
  To: pgsql-admin

Hi List, 

     As I already said .. I'm porting an Oracle DB to PostgreSQL and I must 
rewrite most of the functions . So I have a problem to do something like this:

... atual_fatura in(''+'',''-'') ...

It gives me the following error:

 Unable to identify an operator '-' for types 'numeric' and 'character varying'
 You will have to retype this query using an explicit castenciosamente,

atual_fatura is a varchar field.

I read howto create an explicit cast but I didn't understand what I must do in 
this case. 
    
Can anybody help me ?


Rhaoni Chiu Pereira
Sistêmica Computadores

Visite-nos na Web: http://sistemica.info
Fone/Fax : +55 51 3328 1122








^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Explicit Cast
  2003-08-20 12:24 Explicit Cast Rhaoni Chiu Pereira <rhaoni@sistemica.info>
@ 2003-08-20 15:19 ` Mendola Gaetano <mendola@bigfoot.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Mendola Gaetano @ 2003-08-20 15:19 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Rhaoni Chiu Pereira <rhaoni@sistemica.info>

"Rhaoni Chiu Pereira" <rhaoni@sistemica.info> wrote:
> Hi List,
>
>      As I already said .. I'm porting an Oracle DB to PostgreSQL and I
must
> rewrite most of the functions . So I have a problem to do something like
this:
>
> ... atual_fatura in(''+'',''-'') ...
>
> It gives me the following error:
>
>  Unable to identify an operator '-' for types 'numeric' and 'character
varying'
>  You will have to retype this query using an explicit castenciosamente,
>
> atual_fatura is a varchar field.
>
> I read howto create an explicit cast but I didn't understand what I must
do in
> this case.
>
> Can anybody help me ?

May we have more details on it ? Seems that you want add a numeric with a
varchar.


Regards
Gaetano Mendola





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Explicit Cast
  2003-08-20 12:24 Explicit Cast Rhaoni Chiu Pereira <rhaoni@sistemica.info>
@ 2003-08-20 15:45 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Stephan Szabo @ 2003-08-20 15:45 UTC (permalink / raw)
  To: Rhaoni Chiu Pereira <rhaoni@sistemica.info>; +Cc: pgsql-admin

On Wed, 20 Aug 2003, Rhaoni Chiu Pereira wrote:

> Hi List,
>
>      As I already said .. I'm porting an Oracle DB to PostgreSQL and I must
> rewrite most of the functions . So I have a problem to do something like this:
>
> ... atual_fatura in(''+'',''-'') ...
>
> It gives me the following error:
>
>  Unable to identify an operator '-' for types 'numeric' and 'character varying'
>  You will have to retype this query using an explicit castenciosamente,
>
> atual_fatura is a varchar field.
>
> I read howto create an explicit cast but I didn't understand what I must do in
> this case.

Can you send the actual function you're having problems with and version
information?  I don't seem to get an error with a simple function that
uses such a construct on 7.3.4, but I expect the real example is more
complicated.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-08-20 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20 12:24 Explicit Cast Rhaoni Chiu Pereira <rhaoni@sistemica.info>
2003-08-20 15:19 ` Mendola Gaetano <mendola@bigfoot.com>
2003-08-20 15:45 ` Stephan Szabo <sszabo@megazone.bigpanda.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox