Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011

    Question Unanswered: how to create a procedure


    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?

    Thanks in advance

  2. #2
    Join Date
    Aug 2011
    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:

    dbschema -d db78 -f work_all_day saveithere.sql

    I hope this can be useful for someone

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts