Thread: Firebird UDF

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    11
    Rep Power
    0

    Question Firebird UDF


    Does someone let me know answers to the following problems
    on UDF?

    1. When specifying a UDF in a SQL sentence in
    TSQLClientDataSet property of CommandText, I find that
    the TSQLClientDataSet object does not recognize the UDF.
    How can I make it recognize the UDF from a Firebird Client
    application using the object? ( IBConsole surely recognizes
    the UDF.)

    2. When deleting a UDF alias from RDB$FUNCTIONS, I find
    that the same alias can no longer be registered with Firebird.
    How can I? Or, how can I refer to or delete the UDF alias
    registration record?

    Kindly let me know.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    249
    Rep Power
    14
    1. When specifying a UDF in a SQL sentence in
    TSQLClientDataSet property of CommandText, I find that
    the TSQLClientDataSet object does not recognize the UDF.
    How can I make it recognize the UDF from a Firebird Client
    application using the object? ( IBConsole surely recognizes
    the UDF.)
    What do you mean, "recognized"?

    Firebird should process this just fine and any client component should ignore this completely.
    2. When deleting a UDF alias from RDB$FUNCTIONS, I find
    that the same alias can no longer be registered with Firebird.
    How can I? Or, how can I refer to or delete the UDF alias
    registration record?
    Don't delete anything from the system tables! Use the "DROP EXTERNAL FUNCTION <function_name>" statement.
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    11
    Rep Power
    0

    Firebird UDF


    Thanks a lot for the quick advice.

    By "does not recognize", I mean that when setting the
    TSQLClientDataSet property of Active to "true", I get a complier
    error message of message of "Function unknown my own udf name>. That is, I first input an SQL statement such as "SELECT
    SERIAL, MyUDF( SOME_FIELD ) FROM MYTABLE" in the CommandText and then set the active property to TRUE then
    I get the above mentioned error message from the compiler.

    A further advice would be appreciated. Awaiting your reply,

    As for the UDF function alias deletion from the system table,
    I thank you for your advice.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    249
    Rep Power
    14
    Hi,

    If you get "function unknown", then the error comes straight from Firebird.

    Does the statement with another Firebird tool? If so, did you "commit" after the DECLARE?
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    11
    Rep Power
    0

    Firebird UDF


    Thank you for the quick advice again! Amazing!

    I made the following "DECLARE" statement.

    declare external function MYUDF
    int,
    cstring(32)
    returns parameter 2
    entry_point 'MYFUNCTIONFB' module_name 'MYUDF.dll';
    commit;

    Any errors? I await your advice. Incidentally, as I wrote first,
    IBConsole certainly processes this UDF of mine just fine and
    IBConsole returns my intended results.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    249
    Rep Power
    14
    Can you write:

    SELECT
    SERIAL, MYUDF( SOME_FIELD ) FROM MYTABLE

    In the .CommandText property? It _might_ be that the dbExpress driver is putting double quotes around object names.
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    11
    Rep Power
    0
    Thanks all the time, Mr. Tonies,

    I may have confused you, I put the double quotes enclosing
    my SQL statement just to make the statement outstanding.
    I actually input my SQL statement just you advise me to,
    i.e. SELECT SERIAL, MYUDF( SOME_FIELD ) FROM MYTABLE
    in the .CommandText properly of TSQLCLientDataSet.

    I did as you suggest again, just in case, but to no avail.

    Can you come up with any other possible causes? Awaiting
    your advice.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    249
    Rep Power
    14
    And that particular statement does work in IBConsole?

    'Cause if so, then I have no other ideas.
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    11
    Rep Power
    0
    I note your advice. Thanks anyway. regards,

IMN logo majestic logo threadwatch logo seochat tools logo