Subject Re: [firebird-support] UDFs problem
Author Helen Borrie
At 04:49 AM 26/06/2003 +0000, you wrote:
>Hello,
>I am using the UDFs for idNvl & sNvl. The query is successfully
>executed using IBConsole utility.But, when it is being executed thr'
>code (ASP.Net) then it gives an error -
>
>Unable to complete network request to host "localhost"
>
>But if the same code without using the UDFs is executed, it works
>fine.

Whether UDFs are used in a >> statement << should/would make no difference
to the ability of the >> connection << to be made to the
database. Something else is at work here and you are looking at the wrong
things. For example, you have hard-coded "localhost" into your script, but
you are trying to access this from a remote client. This will *never* work.

If you are testing on the server and getting success, then testing from a
remote client and getting the error above, then the answer is obvious.

>Whether we are required to take some specific care while creating UDFs

Of course you should take care when creating UDFs. A bad UDF will crash
the server. But I thought you were using UDFs that already exist (iNVL and
sNVL, from fbudf.dll?) Please be clearer if this isn't the case.

>or Whether we need to use the same name of UDF as that of entry point in
>the module?

Yes, of course.


>Is it because of locking? When UDF is used, whether it gets a lock on
>the table/database?

No. Locking occurs as the result of requests to update or delete
rows. There is no table locking.

When a UDF is called, the db engine looks at the declaration and then
passes a call to the specified dynamic (shared) library. If the library
isn't already loaded in memory, it loads it.

>If so, how to release the lock acquired by UDF.May be I am totally wrong.

You are. First, solve the problem of connecting. A statement can't be run
without 1) a connection, then 2) a transaction, then 3) preparation. If
something is wrong with the UDF, then the first place it could throw an
exception is at 3).

>Urgently help needed. Because I need to use both the UDFs into my
>application.

This has nothing to do with UDFs.

heLen