SQL & PL/SQL :: Constants In SP?

Jun 3, 2011

I am new to plsql, and I am working with re-creating existing stored procedures which was written like 10 years back with a lot of constant values used and hard coded values used. I am trying to give a new look to those SP and also to make it easier to understand.

would like to replace those constants which is defined into SP with "record" datatype used by plsql.

e.g
AccountType CHAR(3) := 'LMN';
ValueType NUMBER := 34;
Reasonsign CHAR(3) := 'er';
To

[code]...

And using this Constant_values type in places where the constants are refered.

View 3 Replies


ADVERTISEMENT

SQL & PL/SQL :: Naming Integrity Constants

Feb 24, 2013

How is naming Integrity Constants useful? See example below:-

create table incrr
(incrid number(4) constraint incrid_pk primary key,
incrdate date not null,
incramt number(8,2) not null
);

In the above if I don't use incrid_pk it also works.Then what is the use of incrid_pk ?

View 6 Replies View Related

SQL & PL/SQL :: How To Reference Constants Declared In Package From Adhoc Query

Oct 25, 2010

We have a package that contains mostly constants like:

c_flag_true CONSTANT CHAR(1) := 'Y'

When I try to reference it in these constants in an adhoc query it doesn't work:

SQL> select * from FINANCIAL_BATCH_STATUS_HISTORY where active_flag = constants_pkg.c_flag_true;
select * from FINANCIAL_BATCH_STATUS_HISTORY where active_flag = constants_pkg.c_flag_true
ORA-06553: PLS-221: 'C_FLAG_TRUE' is not a procedure or is undefined

Is there a simple solution to make the reference work?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved