Home » SQL & PL/SQL » SQL & PL/SQL » composite data type (4.1.3 sql developer)
composite data type [message #648583] Thu, 25 February 2016 16:55 Go to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

hi all

I want to know when we have to use or on what basis we have to use composite data type
Records,Varrays,index - i mean on what basis we can come to conclusion that if we use this datatype in our program we can achieve result..
if we use varray(10) ..we are limiting the values to be processed...
I worked on few basic examples for records and varraay ,,But could not understand clearly we have to use them ?

Any comment is appreciated.

[Updated on: Thu, 25 February 2016 17:21]

Report message to a moderator

Re: composite data type [message #648584 is a reply to message #648583] Thu, 25 February 2016 18:17 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
IMO, the should be avoided whenever possible.
Re: composite data type [message #648586 is a reply to message #648584] Thu, 25 February 2016 19:01 Go to previous messageGo to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

did not understand ?
are you mentioning this is not right question ?
Re: composite data type [message #648587 is a reply to message #648586] Thu, 25 February 2016 19:26 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
You asked when to use composite data type.
My answer is to not use them.
Re: composite data type [message #648588 is a reply to message #648587] Thu, 25 February 2016 19:30 Go to previous messageGo to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

oh thats makes me to think ,why these were introduced Shocked Shocked
..anyhow thankyou
Re: composite data type [message #648589 is a reply to message #648588] Thu, 25 February 2016 20:11 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Just because you can do something does NOT mean that you actually should do it.
You can poke yourself in the eye with a sharp pencil, but you would be wise if you decided to not do it.

Do you realize & understand that SQL language is NOT controlled by Oracle?
There is an International Standard Organization which manages the valid SQL syntax.
What is the downside of adding datatypes that are infrequently used?

I challenge you to come up with a business requirement, where a composite data type is the only & best solution.
Composite data types are a solution in search of a problem.
Re: composite data type [message #648591 is a reply to message #648589] Thu, 25 February 2016 23:27 Go to previous messageGo to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

ok thankyou
Re: composite data type [message #648593 is a reply to message #648583] Fri, 26 February 2016 01:11 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This is explained in the book I already pointed you:
Database PL/SQL Language Reference
In chapter 5 "PL/SQL Collections and Records", you have sections like:
- Appropriate Uses for Associative Arrays
- Appropriate Uses for Varrays
- Appropriate Uses for Nested Tables
- ...

So once more, read this book.
Also ALWAYS post your Oracle version with your questions.

Previous Topic: Query to find all records with either same value or null value
Next Topic: retrieve first changed row
Goto Forum:
  


Current Time: Thu Mar 28 07:34:14 CDT 2024