Help on writing UDRs needed!
Posted in 2000
Topics: Stored Procedures & SPL, Data Types & Schema Design
Hello,
I need to programm UDRs with Informix. I did a lot of UDF programming
with DB2, but I can't find any examples or descriptions of how to
pass parameters and so on for Informix. The function is supposed to
get two character types (varchar(30) and lvarchar) and has to return
an integer:
create function contains(
txt_hd VARCHAR(30),
s_arg LVARCHAR)
returns INTEGER
with( handlesnulls,
not variant)
external name "/.../irlib.so(IR_contains)"
language c
end function;
I defined the C function as follows:
int IR_contains(
char *txthd, /* Input text handle */
char *s_arg /* Input search string */
)
Unfortunately I can't access the character strings in the C function.
In DB2 I had to define some indicator variables and DB specific variables
as well. Did I forget something here. I'm going nuts here, because there
is absolutely no example UDR and the books are crap - they explain how
great the UDRs are, what different types there are and so on, but no single
C-example :-(
Could someone of you help me with an online-description on programming
UDRs in Informix or with just some example UDRs? That would be great.
Thanx.
Raiko
there are secrets revealed online -
http://examples.informix.com/frameset.html
points the way...
has an example of writing a datablade module in c
raiko@informatik.uni-rostock.de wrote:
> Hello,
>
> I need to programm UDRs with Informix. I did a lot of UDF programming
> with DB2, but I can't find any examples or descriptions of how to
> pass parameters and so on for Informix. The function is supposed to
> get two character types (varchar(30) and lvarchar) and has to return
> an integer:
>
> create function contains(
> txt_hd VARCHAR(30),
> s_arg LVARCHAR)
> returns INTEGER
> with( handlesnulls,
> not variant)
> external name "/.../irlib.so(IR_contains)"
> language c
> end function;>
> I defined the C function as follows:
>
> int IR_contains(
> char *txthd, /* Input text handle */
> char *s_arg /* Input search string */
> )
>
> Unfortunately I can't access the character strings in the C function.
> In DB2 I had to define some indicator variables and DB specific variables
> as well. Did I forget something here. I'm going nuts here, because there
> is absolutely no example UDR and the books are crap - they explain how
> great the UDRs are, what different types there are and so on, but no single
> C-example :-(
>
> Could someone of you help me with an online-description on programming
> UDRs in Informix or with just some example UDRs? That would be great.
> Thanx.
>
> Raiko
Thanx very much, that looks definitely like the information I need. Raiko In article <3964A4D5.B016B2D0@home.com>, Edward Rosenthal <edrosenthal@home.com> writes: > This is a multi-part message in MIME format. > --------------AD795D3364E4C8358D42B432 > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > there are secrets revealed online - > http://examples.informix.com/frameset.html > points the way... > has an example of writing a datablade module in c >