Hi Eric,
I just finished following the document from Miller. I think I am following the steps. What is bothering me is that the SELECT statement using the osad function is able to find many records but at one point, during the search, a memory problem occurs. It seems to me that interactive debugging does not helps because I need to process hundreds or thousands of records in order to get the problem. I have tried it using different memory durations without success.
/* if ( mi_switch_mem_duration(PER_STATEMENT)== MI_ERROR ) { return 96 }; */
(void)mi_switch_mem_duration(PER_STMT_EXEC);
SELECT DISTINCT p.pin, p.dob, p.lname, p.fname, p.address
FROM person_name AS p
JOIN person_name AS p2 ON p2.dob = p.dob AND p2.fname = p.fname AND osad(TRIM(p2.lname),TRIM(p.lname)) <= 5
UNION
<another SELECT using osad()>
UNION
<another SELECT using osad()>
Some times I replace my osad() function for another wrapping SPL function (that calls osad) that gives me a percentage: osad_tp(str1,str2) <= 0.6 and I do check for zero before doing a division.
03/02/20 13:20:29 Assert Failed: Exception Caught. Type: MT_EX_OS, Context: mem
03/02/20 13:20:29 IBM Informix Dynamic Server Version 12.10.FC7WE
03/02/20 13:20:29 Who: Session(62, ocrpsdba@hugospc, -1, 0x44f88508)
Thread(92, sqlexec, 44f4c1f0, 1)
File: mtex.c Line: 420
03/02/20 13:20:29 Action: Please notify IBM Informix Technical Support.
03/02/20 13:20:29 stack trace for pid 1671 written to /usr1/informix/tmp/af.4444e6c
03/02/20 13:20:29 See Also: /usr1/informix/tmp/af.4444e6c, shmem.4444e6c.0
03/02/20 13:20:31 Exception Caught. Type: MT_EX_OS, Context: mem
------------------------------
Zambrano, Hugo
Informix DBA
Ottawa Police
Ottawa, ON
(613)236-1222, 5575
------------------------------
Original Message:
Sent: Sat February 29, 2020 05:50 AM
From: Eric Vercelletto
Subject: User Defined Routine (UDR) example required - OSAD Array
This book is not too old at all. bear in mind that Informix developments done decades ago are still compatible with today's technologies
Not always the case with other technologies :-)
And just wondering where my answer to you a few days ago has gone ...
It said that John Miller III had written some material about C based UDR. Any material produced by John is top level resource!
In this case,he explains very well how you should proceed to build a UDR in C, with all contextual info you need to understand.
Look for the 'C03_Miller_Writing_C-UDR' presentation in the IIUG Conferences repository, for year 2012
here
http://iiugworld.iiug.dyndns.org/2012/2012-sessions.zip
This is the location where you will find all the IIUG conference presentations since 2008
please note that this url is temporary and anytime will be changed to http://iiugworld.iiug.org/2012/2012-sessions.zip )
Eric
------------------------------
[eric] [Verceletto] []
[Founder]
[kandooerp.org]
[Pont l'Abbé] [France]
[+33 626 52 50 68]
Original Message:
Sent: Mon February 24, 2020 09:37 AM
From: Hugo Zambrano
Subject: User Defined Routine (UDR) example required - OSAD Array
Thanks for your answer,
I found a book in Amazon (ISBN 978-0130137098) entitled "Informix Dynamic Server.2000: Server-Side Programming in C" by Jacques Roy from 1999. It seems to me too old. Do you think it would still be a useful book?. I have the routine in 4Js Genero, I will convert it to C and send it over.
------------------------------
[Zambrano] [Hugo]
[Informix DBA]
[Ottawa Police]
[Ottawa] [ON]
[(613)236-1222, 5575]
Original Message:
Sent: Mon February 24, 2020 09:08 AM
From: Paul Watson
Subject: User Defined Routine (UDR) example required - OSAD Array
Look for Jacques Le Roy book on EBay - it will tell you everything you need
If you can't find it ping me and I dig out the ISBN
Cheers
Paul
Paul Watson
Oninit LLC
+1-913-387-7529
www.oninit.com
Oninit®️ is a registered trademark of Oninit LLC
Original Message------
I need your guidance, please. I am looking for an example code for a User Define Routine (UDR) made in C or C++ in order for me to create one to be used in stored procedures and SQL statements. I've found none in the internet and none in github. I need to implement the Optimal String Alignment Distance (osad) routine that even though is a small routine, it requires to create a 121 by 121 array of integers.
I am desperate to find an example so I can achieve my work task that seems almost impossible without that routine. Any help or guidance is greatly appreciated. We are using Informix 12.1 at work.
------------------------------
Hugo Zambrano
zambranoh@ottawapolice.ca
hugoezam@yahoo.com
------------------------------
#Informix