Subject | Re: [firebird-support] Firebird embedded & UDF |
---|---|
Author | Helen Borrie |
Post date | 2004-05-02T23:29:26Z |
At 07:17 PM 2/05/2004 +0200, you wrote:
time a string containing an apostrophe reaches the server, it is too late
to fetch out the apostrophe and double it.
That is to say,
INSERT INTO PERSONS (FIRST_NAME, LAST_NAME)
VALUES (
QUOTEDSTR('Basil'), QUOTEDSTR('d'Oliviera'))
Your UDF won't process "d'Oliviera" but "d".
The insert statement needs to include the doubled apostrophe. In Delphi, I
would have an insert statement like this:
INSERT INTO PERSONS (FIRST_NAME, LAST_NAME)
VALUES (:FIRST_NAME, :LAST_NAME)
and, at run-time, in BeforePost, to ensure that apostrophes come through
doubled, I would have
ParamByName('FIRST_NAME').AsString :=
QuotedStr(ParamByName('FIRST_NAME').AsString);
ParamByName('LAST_NAME').AsString :=
QuotedStr(ParamByName('LAST_NAME').AsString);
As to the problem of embedded not finding UDF libraries....
I saw that you set firebird.conf
UDFAccess = UDF
This won't work in embedded, because that's relative path syntax. You need
the absolute path, because the relative locations of things isn't the same
as in the full server. The full server can use relative paths because it
can find things relative to the RootDirectory, which (without a Registry
entry) it determines to be the directory *above* the one where the server
executable is. However, with embedded, you have the server in the
application root, i.e. one level above where it is in the full server.
So, provide an absolute path entry like this for UDFAccess:
UDFAccess = c:\approot\UDF
/heLen
>Hi,No; but normally you would take care of this on the client, anyway. By the
>
>thanks for your answer. The problem is that I have to deploy a DLL
>developed by me containing only one function but they give me the same
>error displayed by those implemented in ib_udf.dll.
>The function is QUOTEDSTR: a single quote character (') is inserted at the
>beginning and end of String, and each single quote character in the string
>is repeated.
>Is there an existing function ?
time a string containing an apostrophe reaches the server, it is too late
to fetch out the apostrophe and double it.
That is to say,
INSERT INTO PERSONS (FIRST_NAME, LAST_NAME)
VALUES (
QUOTEDSTR('Basil'), QUOTEDSTR('d'Oliviera'))
Your UDF won't process "d'Oliviera" but "d".
The insert statement needs to include the doubled apostrophe. In Delphi, I
would have an insert statement like this:
INSERT INTO PERSONS (FIRST_NAME, LAST_NAME)
VALUES (:FIRST_NAME, :LAST_NAME)
and, at run-time, in BeforePost, to ensure that apostrophes come through
doubled, I would have
ParamByName('FIRST_NAME').AsString :=
QuotedStr(ParamByName('FIRST_NAME').AsString);
ParamByName('LAST_NAME').AsString :=
QuotedStr(ParamByName('LAST_NAME').AsString);
As to the problem of embedded not finding UDF libraries....
I saw that you set firebird.conf
UDFAccess = UDF
This won't work in embedded, because that's relative path syntax. You need
the absolute path, because the relative locations of things isn't the same
as in the full server. The full server can use relative paths because it
can find things relative to the RootDirectory, which (without a Registry
entry) it determines to be the directory *above* the one where the server
executable is. However, with embedded, you have the server in the
application root, i.e. one level above where it is in the full server.
So, provide an absolute path entry like this for UDFAccess:
UDFAccess = c:\approot\UDF
/heLen