tags:

views:

204

answers:

1

I have a firebird database that I need to recreate. It contains an external UDF function. I made an SQL dump of the DB structure using IB Expert:

DECLARE EXTERNAL FUNCTION LPAD
    CSTRING(255),
    INTEGER,
    CSTRING(1)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_lpad' MODULE_NAME 'ib_udf'

However, I get an error when I run the query:

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 1, column 27.
'LPAD'.

I'm using Firebird 2.1.1 on Windows. Does anyone know what might be the problem?

+1  A: 

try this

DECLARE EXTERNAL FUNCTION "LPAD"
    CSTRING(255),
    INTEGER,
    CSTRING(1)
RETURNS CSTRING(255) FREE_IT
ENTRY_POINT 'IB_UDF_lpad' MODULE_NAME 'ib_udf'
RRUZ
Thanks, it worked - I tried escaping with single quotes, but it did not. I wonder why this would make any difference, and why does IB Expert export it incorrectly...
Rytis