> -----Original Message-----
> From: firebird-devel-admin@...
> [mailto:firebird-devel-admin@... Behalf Of Neil
> McCalden
> Sent: Domingo 20 de Mayo de 2001 14:43
> To: firebird-devel@...
>
> A simple example to illustrate what the change allows:-
>
> select substr(first_name,1,2) as sname ,count(*)
> from mayors
> group by substr(first_name,1,2);
One caveat: whereas
SQL> select rdb$relation_name from rdb$relations
where rdb$relation_name starting with 'RDB$'
group by rdb$system_flag;
=>
Statement failed, SQLCODE = -104
Dynamic SQL Error
-SQL error code = -104
-invalid column reference
this suspicious command
SQL> select rdb$relation_name from rdb$relations
where rdb$relation_name starting with 'RDB$'
group by substrlen(rdb$relation_name, 1, 4);
=>
RDB$RELATION_NAME
===============================
RDB$XML
The income is the name of the latest table that carries the RDB$ prefix.
(BTW, rdb$xml is a table I created with an arbitrary name, nothing special.)
I think the engine should have complained like in the first case, but maybe
the issue is hard to catch?
Other than that, the addition works well. Now you have substr (that won't
return NULL if final pos is greater than string's length, but the full
string) and substrlen that receives the string, a starting pos and length of
the slice. I changed ib_udf and added the declaration to the accompanying
SQL file.
C.
|