Re: Stored Procedures
Posted in 1998
In Informix, I like to name my stored procedures sp_<procname>, my views
v_<viewname> etc, to easily determine object type by name. Within stored
procedures, I also use sp_<varname> for variable names, because Informix
does not distinguish variable names from table names (although it warns you
of possible confusion, when there AREN'T name conflicts).
Always DOCUMENT your stored procedures, although you should be aware that
there is a bug in 7.1x up to 7.22 dbexport, where those DOCUMENT
instructions will be truncated in the SQL file. If you use this feature,
you'll have to edit the SQL file for it to be good. Not terribly
difficult, but tedious.
Also, I'd avoid SYSTEM calls if at ALL possible, for a myriad of reasons,
and where possible, try to avoid nested stored procedure calls (although
these are sometimes necessary).
Lastly, be sure to UPDATE STATISTICS on your stored procedures fairly
frequently. When you build a stored procedure, Informix pre-optimizes the
SQL based on how the tables look at compile time. If the tables you
reference change a lot, you'll want to do this more often. If your tables
are fairly static, one or two times a month should suffice.
HTH,
- Thomas J. Girsch
Database Systems Manager
Arch Communications Group, Inc.
Venky9970 wrote in message <68k04k$bid@cssun.mathcs.emory.edu>...
>I would like to get some input regarding naming conventions (for
>procedures, variables etc) and any other factors which should be
>taken care so that future maintenance is easier.