Search code examples
stored-proceduresinformix

Informix SQL 11.5 creating stored procedure without temporary table


I do not have permission on the database as much as creating a temp table, can I write and execute a stored procedure?

This code:

 CREATE PROCEDURE "informix".proc()
 select * from table1;
 end procedure

leads to this error:

INTO TEMP table required for SELECT statement.

and this code:

 CREATE PROCEDURE "informix".proc()
 select * from table1
 into temp_table1;
 end procedure

leads to this error:

Only a DBA can create, drop, grant, or revoke for another user.

Can anyone help?


Solution

  • That "Only a DBA can create...." error is because you are trying to create a procedure belonging to "informix" and your user lacks DBA permission. Basically, you can't create objects that belong to someone else. If you have RESOURCE permission you should be able to create a SPL which belongs to you. Have a read at (https://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.sqls.doc/ids_sqs_0147.htm) it describes the different database permissions and what you are allowed to do.