Hi,

Firebird v2.5

I've noticed something with "by descriptor" UDF parameters and
trying to get the character set from paramdsc.dsc_sub_type.

I wrote a simple UDF to reflect back the type information it
found in the paramdsc given as the first parameter.  When I use
it like this:

    CREATE PROCEDURE "Test (
        "Param1" TYPE OF NAME_D
    ) RETURNS (
        "Result" TYPE OF NAME_D
    ) AS
    BEGIN
        "Result" = ReflectType(:"Param1");
        SUSPEND;
    END

Everything works as expected and the result tells me the
character set of Param1 was WIN1252.


But if I do this from the client (an IBObjects application):

    EXECUTE BLOCK (
        "Param1" TYPE OF NAME_D = ?
    ) RETURNS (
        "Result" TYPE OF NAME_D
    ) AS
    BEGIN
        "Result" = ReflectType("Param1");
        SUSPEND;
    END

I get a character set of 127 (presumably ttype_dynamic).


I get the same 127 result when I use this from the client:

    SELECT ReflectType('abcdef') FROM RDB$DATABASE

although in this case is makes some sort of sense.


Is this expected behaviour?  (I can understand the last
example but the EXECUTE BLOCK example seems wrong.)

ttype_dynamic is not all that useful inside a UDF, because it
has no way to find out what the relevant attachment character
actually set was.

-- 
Geoff Worboys
Telesis Computing Pty Ltd


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to