473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Column Settings

In my table,Let's say EMP,there are three columns EMPID,ENAME,DEPTNO,LOCATION(in this order),but i want it to be EMPID,DEPTNO,ENAME,LOCATION(permanently).
Can it be possible,please help me.

Regards,
Ibrahim
Nov 6 '08 #1
5 1931
Pilgrim333
127 100+
Hi,

The way to do that is, rename the table, create a new table with the right column order, populate the table with the data from the renamed table and then drop the renamed table. Remember to take a look at the grants, indexes etc.

I don't know of any other way, if anyone else knows one, i am curious.

Pilgrim.
Nov 6 '08 #2
amitpatel66
2,367 Expert 2GB
If you are looking at just selecting the column in that order then you can do that with simple SELECT statement itself. Something like

1. SELECT <your columns> FROM table_name will give you the data in the order in which you sepecified the columns.

2. You can also look at taking the data back up in temp table and renaming the column names and its data types accordingly after truncating the table data. Then restore the data again from temp table

3. Simple option -> Three step process:

CREATE TABLE temp_emp AS SELECT empno,deptno,ename,location FROM emp

Drop table emp

Rename temp_emp TO emp
Nov 7 '08 #3
I know all this what you all have described,but any other method.


Regards,
Ibrahim
Nov 7 '08 #4
amitpatel66
2,367 Expert 2GB
No you DO NOT have any way of reordering table columns after creating a table
Nov 10 '08 #5
Saii
145 Expert 100+
In 10g, try experimenting with alter table options like rename,drop unused. I haven't tried but i think it should work.
Nov 14 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: BCR | last post by:
I created a index on a computed column. I did not see any improvement in performance with a join to this column and also my inserts and updates to this table are failing. Any ideas? Chender
0
by: wwcoop | last post by:
I am connected to an Access Database. I am reading a Yes/No field from the DB which translates back as True/False in the text field of my datagrid. I want to use a checkbox to show the value...
4
by: Grace | last post by:
I use a datagrid included in a repeater. as following: (.aspx) <asp:repeater id="rp_perform" Runat="server"> <HeaderTemplate> <table border="0" bgcolor="gray" cellspacing="0" cellpadding="0">...
0
by: Alan T | last post by:
I have create a settings file would like to apply to the listview column header. eg. I want to display the first column header read from the Settings file at design time. However, there is no...
1
by: msch-prv | last post by:
I have difficulties adjusting the column width of a gridview control. The column width changes appear in the design grid, but at run-time the width changes back to what I presume are the grid's...
5
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works...
31
by: Sarita | last post by:
Hello, this might sound stupid, but I got a really nice homepage template which unfortunately is a 3-Column Fixed Width CSS format. Now I don't have any content for the right column and would...
5
by: Ken | last post by:
I'm trying to run a loop to capture column property information from a table in my datasource. Can anybody see where this is going wrong? Dim tbl As New DataTable Dim col As DataColumn Dim x...
0
by: JRough | last post by:
Hi, I have a page with a form that is included into a php page. It has some php variables which are headers based on the user choices. In the form I will send some mysql data columns but right...
0
by: Clare CAVS | last post by:
I have a table with a lookup column referring to another table . tblRooms has two fields, (Autonumber), and . The column I want to display is the RoomName column. If I have Bound Column = 1,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.