Subject SV: [firebird-support] Error in show LPAD
Author Svein Erling Tysvær
Hi Ismael!

Try

SELECT a.CODIGO,cast(lpad(CAST(a.CUENTAUSD AS VARCHAR(4)),4, '0') AS VARCHAR(4)) AS CUENTAUSD, cast(lpad(a.SUBCTAUSD, 3, '0') AS SUBCTAUSD AS VARCHAR(255))
FROM ALMINV a ORDER BY a.CODIGO

I think Firebird has a max row size of 64Kb and I suspect LPAD returns 32Kb (possibly this could be changed when declaring it, I rarely use UDFs and don't know).

By the way, when writing a mail with a new subject you should not hit 'reply' and change the subject - even though the subject is changed it will mess up things for people threading their emails (I don't and do not know whether you did this or not). What you should do is to hit 'new', write your message and send to the list.

HTH,
Set
________________________________________
Fra: firebird-support@yahoogroups.com [firebird-support@yahoogroups.com] på vegne av Ismael L. Donis García [ismael@...]
Sendt: 8. januar 2010 17:57
Til: firebird-support@yahoogroups.com
Emne: [firebird-support] Error in show LPAD

Excuse I did not change the subject

When I try to use the show lpad 2 times in the same sql does error give me, as solving this?

Starting transaction...
Preparing query: SELECT a.CODIGO, lpad(CAST(a.CUENTAUSD AS VARCHAR(4)),4, '0') AS CUENTAUSD, lpad(a.SUBCTAUSD, 3, '0') AS SUBCTAUSD
FROM ALMINV a ORDER BY a.CODIGO

Error: *** IBPP::SQLException ***
Context: Statement::Prepare( SELECT a.CODIGO, lpad(CAST(a.CUENTAUSD AS VARCHAR(4)),4, '0') AS CUENTAUSD, lpad(a.SUBCTAUSD, 3, '0') AS SUBCTAUSD
FROM ALMINV a ORDER BY a.CODIGO)
Message: isc_dsql_prepare failed

SQL Message : -204
Undefined name

Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -204
Implementation limit exceeded
block size exceeds implementation restriction

WI-V2.1.3.18185 Firebird 2.1
WI-V0.9.3.1870 FlameRobin

Thanks
=========
¦¦ ISMAEL ¦¦
=========