Andreas,
I believe you are correct about it excluding the 'o', 'd', and 'r' routines, but that's only part of the problem I'm seeing. For example, in sysprocedures, a number of these "system-generated" routines have mode = "O". Examples include binary18cast, binary18expb, binary18in, binary18out, binary18recv, binaryvarcast, binaryvarexpb, binaryvarexpt, binaryvarimpb, compare, equal, greaterthanorequal, and notequal.
Running 'dbschema -d
database_name -f all | grep -i "^create " | grep equal', I get:
create function "informix".equal (SYSBldSQLText,SYSBldSQLText)
create function "informix".equal (binaryvar,binaryvar)
create function "informix".notequal (binaryvar,binaryvar)
create function "informix".lessthanorequal (binaryvar,binaryvar)
create function "informix".greaterthanorequal (binaryvar,binaryvar)
create function "informix".equal (binary18,binary18)
create function "informix".notequal (binary18,binary18)
create function "informix".lessthanorequal (binary18,binary18)
create function "informix".greaterthanorequal (binary18,binary18)
We didn't create any of those in-house. And none of them show up in the database_name.sql file created by dbexport. So dbschema appears to be extracting the three 'equal' routines that have mode = "O", but not the two that have mode = "r".
------------------------------
Mark Collins
------------------------------
Original Message:
Sent: Thu July 14, 2022 11:36 AM
From: Andreas Legner
Subject: Question on sysprocedures
dbschema/dbexport would only produce mode 'O', 'D' and 'R' ones, so not those 'd' and 'r' internal ones.
------------------------------
Andreas Legner
Original Message:
Sent: Tue July 12, 2022 06:25 PM
From: Mark Collins
Subject: Question on sysprocedures
Informix 14.10.FC7W1 on RHEL 8.6
I've got a couple of questions about the sysprocedures table. First, the isproc column. It looks like isproc is set to 'f' any time the routine has return values, regardless of whether it was created via CREATE PROCEDURE or CREATE FUNCTION. I guess that brings up a question of whether there is any difference between a CREATE PROCEDURE that has return values vs a CREATE FUNCTION, which must have return values. Can you use both interchageably? Do both work the same way in projection clauses, WHERE clauses, and SPL LET statements (among other places)?
So it seems that isproc will only be 't' if the routine was created via CREATE PROCEDURE and has no return values. Is that correct?
Next, the mode column. Is it correct that mode would be 'D' only for those routines created via CREATE DBA PROCEDURE or CREATE DBA FUNCTION? It sounds like mode would be 'R' for routines created via "CREATE PROCEDURE username.my_procedure" if you ran this as user informix or some other user with DBA permission. Is that correct?
Finally, how do you identify routines that were generated by your own staff? I was thinking it would be a simple case of mode = "O", but that isn't it. I've got a number of procedures that I know were created by our developers, which have mode = "O" (or possibly "R"), but there are many others, such as the binary18* routines and some of the equal and notequal routines, that also have mode = "O". Is there some other column that differentiates those routines provided by IBM from those created in-house? Or another table that I need to join against to get that information?
Thanks.
------------------------------
Mark Collins
------------------------------
#Informix