I do not want to have to add columns to tables once on Oracle. Is there a way around?

I  have tables on Oracle and do not want to have to ask the DBA to add columns.  Is there a way around this with elements where I add rows instead of columns?  If so , can you explain.
Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
I'm not understanding what you are wanting to do with 'elements'.

You are wanting to store row information in rows and not columns?  probably not possible but I need to understand the issue before I can say for sure.
Christoffer SwanströmPartnerCommented:
You could make a generic table that has the following structure:

attribute VARCHAR2(...)
value VARCHAR2(...)
value_type VARCHAR2(...)

Using this you can store for any given primary key (identified by id) any number of attribute/value pairs that you would normally store in table columns (the column defining the attribute and the value being stored for each row in the column).


You want to store information about car models. A traditional data model would look something like this:

model_id NUMBER
model_name VARCHAR2
engine_displacement NUMBER

A row could look like:

1 / Ford / Explorer / 2.0

In the generic data structure you would store the corresponding data as follows

1 / make / Ford
1 / model name / Explorer
1 / engine displacement / 2.0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Christoffer SwanströmPartnerCommented:
Sorry, forgot to explain the value type. That can be used to define whether the value is a number, string, date or some other datatype. Depending on the value_type the value can then be decoded/converted.

Of course such a data model would present problems in terms of performance and ease of understanding. But on the other hand it lets you store arbitrary information without having to change the data model itself.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

slightwv (䄆 Netminder) Commented:
Before I would do that I would create an XMLTYPE table and store xml docs that contain anything you want.
DavidSenior Oracle Database AdministratorCommented:
Slight, this reads to me that the individual does not have DDL privileges.
slightwv (䄆 Netminder) Commented:
I agree.  I was just pointing out that if the solution by tosse was an option (create a table), there is an alternative.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.