I have two different questions about procedures in Informix.
Can I copy the procedures that I have in one database another database? if yes, how?
Also, I want to create a procedure, I already know the syntax to create a procedure, but i don't know where to execute the command. I already tried in the main menu, Query-language, New, but I got a error. Does anyone know where do I have to write the CREATE PROCEDURE command?
I already found the answer to my questions. I will share them , just in case someone also has the same problem.
To create a procedure and save it into a specific DB we need to create a sql file, inside the file we can put the CREATE PROCEDURE command, then just load into the DB using dbaccess. for example my database is db32 and my file is answer.sql I will have to execute:
dbaccess db32 answer.sql
If we want copy the procedures that exist in one database to later copy them into any other db, we need to use dbschema, the name of the database, the name of the procedure and the name of the file where we are going to save the procedure.
For example, my database is db78, my procedure is work_all_day(int ) and my file is saveithere.sql
I would have to run: