Search Postgresql Archives

Re: Order of SUBSTR and UPPER in statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13 fev, 12:19, Hermann Muster <Hermann.Mus...@xxxxxx> wrote:
> Hi,
>
> I encountered something I can't really explain. I use the following
> statement in my application:
>
> COALESCE(UPPER(SUBSTR("Y"."Firma",1,7)),'')
>
> This returns "ERROR:  syntax error at end of input"
>
> However, using the following statement is fine:
>
> COALESCE(SUBSTR(UPPER("X"."Firma"), 1, 7), '')
>
> The fieldtype of "Firma" is character varying.
>
> The only difference is the order of UPPER and SUBSTR. Is it possible
> that this changed during some PostgreSQL version update? By the way,
> right now I'm using 8.2.
>
> Regards,
> Hermann

Please post the entire SQL statement and table structure, and even
posting here, did you notice in the first SQL you wrote you're using
"Y"."firma", and on the second you typed "X"."firma". Is there any
difference between "X" and "Y" aliases?

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux