Live ORACLE

if you are Oracle Developer ,than this Blog most likely will make you happy.

About my Blog

This Blog particularized for Oracle Developers ... you will see interesting Codes for SQL , PL/SQL as well as new ideas for Developer Suite and Client Tools that will help you in your professional life ... and I hope I reach for your satisfaction.

About Me

I'm Hany Freedom , 25 years old , I live in EL-Minia City in Egypt , I'm Moderator at ArabOUG.org the best Arabic Forum for ORACLE on the Net. if you interested to know more about me .... just Click Here.

Type Compatibility With the NUMBER Datatype

An unconstrained subtype is interchangeable with its base type. For example, given the following declarations, the value of amount can be assigned to total without conversion:


DECLARE

SUBTYPE accumulator IS NUMBER;

amount NUMBER(7,2);

total ACCUMULATOR;

BEGIN

amount := 10000.50;



total := amount;

END;

/




Different subtypes are interchangeable if they have the same base type:


DECLARE

SUBTYPE b1 IS BOOLEAN;

SUBTYPE b2 IS BOOLEAN;

finished B1; -- Different subtypes,

debugging B2; -- both based on BOOLEAN.



BEGIN

finished := false;



debugging := finished; -- They can be assigned to each other.



END;

/




Different subtypes are also interchangeable if their base types are in the same datatype family. For example, given the following declarations, the value of verb can be assigned to sentence:

DECLARE
SUBTYPE Word IS CHAR(15);
SUBTYPE Text IS VARCHAR2(1500);
verb Word; -- Different subtypes
sentence Text(150); -- of types from the same family
BEGIN
verb := 'program';
sentence := verb; -- can be assigned, if not too long.
END;
/


Share/Save/Bookmark

0 comments:

Post a Comment



Newer Posts Older Posts Home Page
 
http://www.dpriver.com/images/sqlpp-banner-2.png

Thanks for reading my Blog ... you Visitor Number :-