Question
How to write udf s in delphi?

Answers

It’s quite simple. the only thing you need to remember is that you must always use ib_util_mallocOto allocate memory if your UDF returns string result. The UDF must be declared as FREE IT. so that Firebird releases the memory after it reads the string.
To use ib_util_mallocO, you need to import it from ib_utildil into your program - and make sure you use it instead of regular memory alocating functions. Here’s a simple example of Delphi UDF:
function ib uti l_rnalloc(l: integer): pointer; cdecl: external ‘ib_util.dll;
function ChangeMyString(const p: PChar). PChar; cdecl:
var
s: string;
begin
s := DoSomething(string(p));
Result := ib_util_malloc(Length(s) + 1);
StrPCopy(Result, s);
end;
Declaration in Firebird:
DECLARE EXTERNAL FUNCTION ChangeMyString
CString(255)
RETURNS CString(255) FREE_IT
ENTRY_POINT ‘ChangeMyString’ MODULE_NAME ‘……’‘   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q How to select elements using jQuery whose css class is some-class
  • Q What was Jim Reeves' only UK No1 hit?
  • Q At what fret are found the same notes as the open strings, but an octave higher, on a standard guitar: 8th; 10th; 12th; or 14th?
  • Q Who is the Chief Minister of Delhi
  • Q Opsonization is the process by which what occurs?
  • Q What kind of optimizations can be done to data models
  • Q What is creative accounting?Question
  • Q Name the family and order of Australasian salmon ?
  • Q What are the steps you would follow when a change request comes in?
  • Q What is the mechanism of the bleeding diathesis that occurs in the setting of severe aortic stenosis?
  • Q In a public key infrastructure (PKI), the authority responsible for the identification and authentication of an applicant for a digital certificate (i.e., certificate subjects) is the: A. registration authority (RA). B. issuing certification authority (CA). C. subject CA. D. policy management authority.