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

    Join Date
    Jul 2004
    Posts
    3
    Rep Power
    0

    Question Questions With UDF (new to Firebird)


    Hi guys,

    I'm new to Firebird and I want to use the UDFs. I've tried to use SRIGHT. It's fast if for one table only but if there's joining it's very slow. Can you help me how to make it faster? Thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    250
    Rep Power
    15
    What kind of SQL statement are you trying to perform?


    With regards,

    Martijn Tonies
    Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server.
    Upscene Productions
    http://www.upscene.com
    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
    Jul 2004
    Posts
    3
    Rep Power
    0
    Hi upscene,

    Sorry it's only this I have time to reply. Here's my query.

    SELECT A.ITEMCODE, B.PLUCODE, C.ITEMDESC, SUM(B.QUANTITY)
    FROM SCANCODE A, SALESDETAILS B, ITEM_H C
    WHERE SRIGHT(RTRIM(A.SCANCODE), 13) = B.PLUCODE
    AND A.ITEMCODE = C.ITEMCODE
    GROUP BY A.ITEMCODE, B.PLUCODE, C.ITEMDESC
    ORDER BY SUM(B.QUANTITY)


    Hope to hear from you soon. Thank you in advance.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    250
    Rep Power
    15
    Hi,

    With this join, Firebird cannot use an index on A.scancode... It's hard to tell what's going on though, without know the full table metadata (including constraints/indices)
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com

IMN logo majestic logo threadwatch logo seochat tools logo