Thread: There is a different cast than ::MyOtherType() ?

There is a different cast than ::MyOtherType() ?

From
"Ezequias Rodrigues da Rocha"
Date:
Hi list,<br /><br />My Delphi app does not suport this kind of cast:<br /><br />Select id, desc<span style="font-style:
italic;font-weight: bold;">::Varchar(50)</span> from myTable<br clear="all" /><br />I don't know if it is a odbc
problemor a Delphi problem (or a BDE problem). <br /><br /><font face="Verdana, Arial, Helvetica, sans-serif"
size="2"><fontface="Verdana, Arial, Helvetica, sans-serif" size="2"><strong><span style="font-weight: bold;">Even
thoughI would like to try another cast.</span><br style="font-weight: normal;" /><br style="font-weight: normal;"
/><spanstyle="font-weight: normal;">Does anyone is avaliable to help me ?</span><br /></strong></font></font>-- <br />
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />                                  Atenciosamente
(Sincerely)<br/>                        Ezequias Rodrigues da Rocha<br />
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<br/>A pior das democracias ainda é melhor do
quea melhor das ditaduras <br />The worst of democracies is still better than the better of dictatorships<br /><a
href="http://ezequiasrocha.blogspot.com/">http://ezequiasrocha.blogspot.com/</a>

Re: There is a different cast than ::MyOtherType() ?

From
"A. Kretschmer"
Date:
am  Fri, dem 16.02.2007, um  9:30:14 -0300 mailte Ezequias Rodrigues da Rocha folgendes:
> Hi list,
> 
> My Delphi app does not suport this kind of cast:
> 
> Select id, desc::Varchar(50) from myTable

This is PG-only-style, the spec is:

select id, cast(desc as varchar(50)) from mytable;


But i'm not sure if 'desc' is a reserved key-word.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


Re: There is a different cast than ::MyOtherType() ?

From
Alvaro Herrera
Date:
Ezequias Rodrigues da Rocha escribió:
> Hi list,
> 
> My Delphi app does not suport this kind of cast:
> 
> Select id, desc::Varchar(50) from myTable

Try

select id, cast(desc as varchar(50)) from yourTable

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support