Home » SQL & PL/SQL » SQL & PL/SQL » Decrease the length of a column with select
Decrease the length of a column with select [message #360391] Thu, 20 November 2008 16:34 Go to next message
bigmac15
Messages: 2
Registered: November 2008
Junior Member
I have to run through a bunch of questions and make a statement for each.

But im stuck on one where im suppose to "Then decrease the length of column Name in table GOODCUST to the lowest possible value by performing a “smart” SELECT statement"

Anyone know how you use a a select statement in "alter" to find the lowest possible value for the column??
Re: Decrease the length of a column with select [message #360399 is a reply to message #360391] Thu, 20 November 2008 20:37 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
show user GOODCUST and its data?

maybe post the entire question?

Is this homework or some self applied test? If so, should we really be doing the work?

Is the question asking to recreate a table with some varchar2 column or to alter some varchar2 ccolumn by setting its size to the minimum size based on data currently in the table?

Is the question asking us to dyanmically create column names using some technique which by the nature of the example give you (but not use) should be somewhat obvious?

Kevin
Re: Decrease the length of a column with select [message #360404 is a reply to message #360391] Thu, 20 November 2008 21:06 Go to previous messageGo to next message
bigmac15
Messages: 2
Registered: November 2008
Junior Member
i attached a screen shot and thats the whole question. Its homework yes but i don't wont you to do the work, i just want to know how you can alter a fields character lenght and yes this is what i need >> "to alter some varchar2 ccolumn by setting its size to the minimum size based on data currently in the table"
  • Attachment: goodcust.PNG
    (Size: 11.01KB, Downloaded 106 times)
Re: Decrease the length of a column with select [message #360406 is a reply to message #360404] Thu, 20 November 2008 21:21 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
Then google up "oracle alter table" and read about the "modify" portion. This lets you change the datatype and length of a field.

Does this help?

Kevin
Previous Topic: PROCEDURE FOR ALL_OBEJCTS
Next Topic: Analytic functions - HELP !!!!!
Goto Forum:
  


Current Time: Sun Dec 04 08:43:38 CST 2016

Total time taken to generate the page: 0.07157 seconds