If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > how to create a procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-18-11, 12:50
fernando guerrero fernando guerrero is offline
Registered User
 
Join Date: Aug 2011
Posts: 10
Question how to create a procedure

Hello

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
Reply With Quote
  #2 (permalink)  
Old 08-19-11, 12:42
fernando guerrero fernando guerrero is offline
Registered User
 
Join Date: Aug 2011
Posts: 10
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On