Skip to content

Useful or useless? You decide.

I’ve been poking around the ADF code and came across these IMA objects for data types and operators in the DBMS.
These IMA objects, like many others, exist but are never exposed.

Data types
The following registration will create a table that contains data type name and the data type description bits.

drop ima_dbms_datatypes;
\p\g
register table ima_dbms_datatypes (
	server varchar(64) not null not default is
		'SERVER',
	name varchar(30) not null not default is
		'exp.adf.adg.dt_name',
	id integer4 not null not default is
		'exp.adf.adg.dt_id',
	stat integer4 not null not default is
		'exp.adf.adg.dt_stat'
)
as import from 'tables'
with dbms = IMA,
structure = sortkeyed,
key = (server);
\p\g
grant all on ima_dbms_datatypes to ingres with grant option;
\p\g
grant select on ima_dbms_datatypes to public;
\p\g

The data type description bits should match the definitions in adf.h. Use the hex function in the select to make the values easier to read.
select id, hex(stat) as stat, name from ima_dbms_datatypes;

Operators
The following registration will create a table containing information about the operators available in the DBMS.

drop ima_dbms_operators;
\p\g
register table ima_dbms_operators (
	server varchar(64) not null not default is
		'SERVER',
	name varchar(30) not null not default is
		'exp.adf.adg.op_name',
	opid integer4 not null not default is /* order within the constructed operator list */
		'exp.adf.adg.op_id',
	type varchar(20) not null not default is /* type of operator */
		'exp.adf.adg.op_type',
        use varchar(30) not null not default is /* where in an expression the operator is used */
                'exp.adf.adg.op_use',
        qlang integer not null not default is /* the query language where the operator is permitted 1=QUEL, 2=SQL*/
                'exp.adf.adg.op_qlangs',
        cntfi integer not null not default is /* count of function instances */
                'exp.adf.adg.op_cntfi'
)
as import from 'tables'
with dbms = IMA,
structure = sortkeyed,
key = (server);
\p\g
grant all on ima_dbms_operators to ingres with grant option;
\p\g
grant select on ima_dbms_operators to public;
\p\g


A query of the table produces an indiscriminate list of functions defined in the DBMS.

I’ve only tried to register these tables on Ingres II 9.2.0 and if you are considering trying them out the usual disclaimers apply.

So, useful or useless?

Related posts