Oracle sql developer change column order
Hello,
I created a table in Oracle sql developer.. After I created it I noticed that the order of the columns is wrong. So I right clicked the table->Edit.. But the arrow to move a column up/down (ie. change the column order is greyed out). Is there a another way to change this ?
Alex Nuijten wrote:
hello.
I just looked at Guido profile and noticed he was from Germany. You being from India, also learning some Dutch along the way... soon the whole world will be speaking Dutch... :)And then - not a second earlier - the Oranje team will win a FIFA World Cup. ;-)
Similar Messages
-
Oracle SQL Developer 3.2, SQL*Plus COLUMN FORMAT bug
SQL*Plus command COLUMN truncates output result in SQL Developer.
Script in Worksheet:
column nn format 999
select level nn from dual connect by level<=10;The Run Script (F5) result contains only 8 lines in Script Output window:
NN
1
2
3
4
5
6
7
8
Changing column alias:
select level nn2 from dual connect by level<=10NN2
1
2
3
4
5
6
7
8
9
10
10 rows selected
The output can contain no data for more formatted columns.
===============================================================
About
Oracle SQL Developer 3.2.09
Version 3.2.09
Build MAIN-09.30
Copyright © 2005, 2012 Oracle. All Rights Reserved.
IDE Version: 11.1.1.4.37.59.48
Product ID: oracle.sqldeveloper
Product Version: 11.2.0.09.30
Version
Component Version
========= =======
Java(TM) Platform 1.7.0_02
Oracle IDE 3.2.09.30
Versioning Support 3.2.09.30sqldeveloper64-3.2.09.30-no-jre.zip.
My jdk now is 1.7.07 x64, Windows 7 x64.
C:\Java\jdk17\bin>java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
Gary Graham wrote:Also, I don't understand what you mean by
The output can contain no data for more formatted columns.
Sript:
col owner format a10
col table_name format a20
col column_name format a20
col comments format a50
select
row_number() over(order by column_name) r11,
count(*) over() c11,
owner ow,
table_name tn,
column_name cn,
comments co
from all_col_comments t
where owner='SYS' and table_name='INDEX_STATS';
select
row_number() over(order by column_name) r,
count(*) over() c,
owner,
table_name,
column_name,
comments
from all_col_comments t
where owner='SYS' and table_name='INDEX_STATS';
select 1 from dual;
prompt abcThe output truncated after headers of second queryR11 C11 OW TN CN CO
1 25 SYS INDEX_STATS BLKS_GETS_PER_ACCESS Expected number of consistent mode block gets per row. This assumes that a row chosen at random from the table is being searched for using the index
2 25 SYS INDEX_STATS BLOCKS blocks allocated to the segment
3 25 SYS INDEX_STATS BR_BLKS number of branch blocks in the b-tree
4 25 SYS INDEX_STATS BR_BLK_LEN useable space in a branch block
5 25 SYS INDEX_STATS BR_ROWS number of branch rows
6 25 SYS INDEX_STATS BR_ROWS_LEN sum of the lengths of all the branch blocks in the b-tree
7 25 SYS INDEX_STATS BTREE_SPACE total space currently allocated in the b-tree
8 25 SYS INDEX_STATS DEL_LF_ROWS number of deleted leaf rows in the index
9 25 SYS INDEX_STATS DEL_LF_ROWS_LEN total length of all deleted rows in the index
10 25 SYS INDEX_STATS DISTINCT_KEYS number of distinct keys in the index
11 25 SYS INDEX_STATS HEIGHT height of the b-tree
12 25 SYS INDEX_STATS LF_BLKS number of leaf blocks in the b-tree
13 25 SYS INDEX_STATS LF_BLK_LEN useable space in a leaf block
14 25 SYS INDEX_STATS LF_ROWS number of leaf rows (values in the index)
15 25 SYS INDEX_STATS LF_ROWS_LEN sum of the lengths of all the leaf rows
16 25 SYS INDEX_STATS MOST_REPEATED_KEY how many times the most repeated key is repeated
17 25 SYS INDEX_STATS NAME name of the index
18 25 SYS INDEX_STATS OPT_CMPR_COUNT optimal prefix compression count for the index
19 25 SYS INDEX_STATS OPT_CMPR_PCTSAVE percentage storage saving expected from optimal prefix compression
20 25 SYS INDEX_STATS PARTITION_NAME name of the index partition, if partitioned
21 25 SYS INDEX_STATS PCT_USED percent of space allocated in the b-tree that is being used
22 25 SYS INDEX_STATS PRE_ROWS number of prefix rows (values in the index)
23 25 SYS INDEX_STATS PRE_ROWS_LEN sum of lengths of all prefix rows
24 25 SYS INDEX_STATS ROWS_PER_KEY average number of rows per distinct key
25 25 SYS INDEX_STATS USED_SPACE total space that is currently being used in the b-tree
25 rows selected
R C OWNER TABLE_NAME COLUMN_NAME COMMENTS
- - ---------- -------------------- -------------------- -------------------------------------------------- -
How can I change the format of numbers in Oracle SQL Developer 1.0 ?
The value 1.4345 from a table is represented in Oracle SQL Developer 1.0 like 1.5
How can I change this to see all the digits ?
ThanksWhere did you see that, in the SQL Worksheet or viewing the data Connections ->.. tables ->.. tree?
What datatype, precision and column name you have?
I use version 1.0.0.15.57 and seems to be working allright.
- Babu Rangasamy -
How to change the password of a schema using Oracle SQL Developer
Hi need to change the password of a schema using Oracle SQL Developer how do i do it?
Hi
alter user username identified by password -
How to update column in Oracle SQL Developer?
Hi everybody,
How can I update table in Oracle SQL Developer like in PL/SQL Developer use:
Select * from table for update;
Thank you~Do you mean you want to edit the result grid?
You can't edit the result grid of a query, but you can edit the data tab of a table.
Click on the table in the object browser
Click on the data tab
Optionally filter the results using the filter field at the top
Type into the data cells.
Click on the commit button -
Oracle SQL Developer 1.0 is easy to install and use, and is portable
I have tried the latest version of Oracle SQL Developer 1.0 and would like to share my experience of using it.
Installation of Oracle SQL Developer 1.0
Download from
http://www.oracle.com/technology/software/products/sql/index.html?_template
Unzip the Oracle SQL Developer for Windows (55.8 MB) to C:\sqldeveloper (103MB)
Advantages: The unzip folder can be your removable disk and you can access Oracle
anywhere provided that there is an Internet connection to Oracle Server.
Unzip sqldeveloper-1557.zip to C:\ with folder name;
double-click on sqldeveloper.exe in c:\sqldeveloper
Click on [No]
Tick all check boxes
Click on [OK]
Right-click on Connections, New
Database Connection…
Enter User name: SCOTT
Password: TIGER
Hostname: 127.0.0.1 (or IP of your Oracle Server on the Internet)
SID: orcl
If you want to connect to local Oracle user SYS,
Enter User name: sys
Password: ora10g_manager_password
Hostname: 127.0.0.1
SID: orcl
Select Role: SYSDBA
Click on [Connect]
Right-click on Tables, Create Table
Click on [Add Column]
Select Type: NUMBER for COLUMN2
Click on [OK]
Table1 is created
Click on TABLE1, click on “Data” tab
Click on the “Green Plus” icon to insert record
Click on “Commit Changes” icon
Click on “DBConnection1” tab
Enter: select * from table1;
Click on “Execute Statement (F9)” icon
To exit: Click on File, ExitHave you noticed that there's a forum dedicated to SQL Developer?
C. -
BUG in Oracle SQL Developer 3.0.04 on the "generating DLL" with comments?
I'm newbie on oracle, but I think that I found out a bug in Oracle SQL Developer version 3.0.04 on the "generating DLL" tool using "comments".
I will describe the steps that I gave:
I created a view, but after I test it I had to change my “where” condition, so I comment the old code and then I wrote the new “where” condition below. After I done that I tried to look at the sql code of my view using “generating DLL” tool, but oracle sql developer only shown me half of the code, a lot of code were missing. Then I began with some test trying to understand what happen and I notice that if I put an invalid sql code in my comment the generating DLL start working with no problems, for example(pseudo-code):
(COMMENT WITH VALID SQL CODE the "Generating SQL" don't work:)
CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
AS
SELECT column1, column2
FROM table1
INNER JOIN
(SELECT
FROM table2
INNER JOIN .....
INNER JOIN ....
--where time_stamp = (select max(time_stamp) from .....)
WHERE time_stamp >= TRUNC(sysdate)
) t1 ON t1.ID = ....
AND ..... >= TRUNC(sysdate)
ORDER BY ....
Generating DLL returns this(when the error occurs):
CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
AS
(COMMENT WITH VALID SQL CODE the "Generating SQL" work with no problems:)
CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
AS
SELECT column1, column2
FROM table1
INNER JOIN
(SELECT
FROM table2
INNER JOIN .....
INNER JOIN ....
--where
WHERE time_stamp >= TRUNC(sysdate)
) t1 ON t1.ID = ....
AND ..... >= TRUNC(sysdate)
ORDER BY ....
I believe that "Generating DLL" tool have some problem with the comments, I also used /*...*/ to comment but the problem is still active.
I notice as well that if I started to add some more comments along the code, the conditions migth change, so I think the problem is related with "comments" code.
Would you mind telling me if this is a real bug or if I'm doing anything wrong.
Thank you in advance,
Rodrigo Campos
Edited by: 894886 on 3/Nov/2011 5:29Hi Rodrigo,
Thank you for reporting this. The only bug I see currently logged on a comment affecting the generated View DDL involves ending the last line of the definition with a comment, which treats the ending semi-colon (even if on a different line) as part of the comment. That is actually related to a low-priority bug against an Oracle database API.
Unfortunately, your pseudo-code is a bit complex. Trying a few quick, simpler tests against the standard HR schema did not reproduce the issue. I tried INNER JOIN, and nested SELECTs. It would help greatly if you could provide a test case compilable against one of the standard schema, like HR or SCOTT.
Regards,
Gary
SQL Developer Team -
Oracle SQL Developer 1.5.5 Unable to save file
I edit content of a column in a table I get this when trying to save change:
Unable to save TABLE ... ("Failed to save changes").
This error disappear when I do the same task in Oracle SQL Developer 1.1.3.
Please help me!when I run:
UPDATE "OWNFTS"."BONGDATHAMSO"
SET LTDKQURL = 'http://soccernet.espn.go.com/fixtures?league=ita.1&cc=4716'
WHERE ROWID = 'AAASBeAAGAAAAEgAAH' AND ORA_ROWSCN = '4238785';
commit;
from SQL Worksheet, there's "Enter Substitution Variable" window inform me to enter something in a textbox beside "CC:" label.
Clicking "OK" or "Cancel" on this window with or without filling textbox has the same result:
+0 rows updated+
commit succeeded.
AND the command which was cutting ORA_ROWSCN predicate:
UPDATE "OWNFTS"."BONGDATHAMSO"
SET LTDKQURL = 'http://soccernet.espn.go.com/fixtures?league=ita.1&cc=4716'
WHERE ROWID = 'AAASBeAAGAAAAEgAAH';
commit;
fired the same " window
but:
+1 rows updated+
+commit succeeded.+
AND after refresh Table, I couldn't see the new value.
Edited by: user11193632 on Aug 5, 2009 7:30 PM -
Copying SQL Script from Oracle SQL Developer into Excel with formatting
I need to copy a SQL Script into Excel in order to develop some VBA code. Is there any nice way that I can copy SQL Script from Oracle SQL Developer into Excel and retain its formatting? I am a stickler for having legible, readable SQL and like to have all my columns lined up and aliases lined up. When we used to use SQL Navigator, the tab formatting seemed to copy and paste just fine. Now that we have migrated to Oracle SQL Developer, the formatting seems to get all messed up.
And suggestions are greatly appreciated and Thanks in advance for your review and am hopeful for an answer.
Thanks.
PSULionRPI suppose you want a real tabulator instead of spaces. You can configure this in the preferences (SQL Formatter - Oracle). You have to apply it then to your existing code (e.g. CTRL-F7), but new code should get it right from the start.
Hope that helps,
K. -
How to connect from oracle sql developer ?
I've made one java class, to access UserRecord Data Base from sql developer.
My class file is :-
import java.sql.*;
import java.io.*;
public class SelectData{
public SelectData(){}
public void selectData(){
String url="jdbc:oracle:thin:@10.1.236.10:1521:dev92i";//connection url
Connection con= null; //connection create
Statement stat = null; //prepared statement create
ResultSet rs=null; //result set to hold result
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection(url,"scott","tiger");
stat = con.createStatement();
rs = stat.executeQuery("select Name from UserRecord");
while (rs.next()) { // Position the cursor
// Retrieve the first column value
System.err.println("Name= " +rs.getString("Name"));
// Retrieve the first column value
System.err.println("Pswd= " +rs.getString("Password"));
rs.close();
catch(SQLException e){
System.err.println(e.getMessage());
catch(ClassNotFoundException e){
System.err.println(e.getMessage());
catch(Exception e){
System.err.println(e.getMessage());
finally{
try{
if(con!=null)
con.close();
catch(Exception e){
System.err.println(e.getMessage());
public static void main(String args[]){
SelectData sd=new SelectData();
sd.selectData();
When i run this class file it gives error :-
"oracle.jdbc.driver.OracleDriver"
Plz help me out from this problem and suggest any configuration if required in oracle sql developer to run my programs.{color:#0000ff}hi,
add the jar for oracle jdbc to the libraries.
if you are using any IDE then just change the project properties adding the jar file.
if not edit the classpath of the envoirnment variables.
{color}{color:#ff0000}*manik*{color} -
SQL Developer - Pulling column value from previous row
I am using Oracle SQL developer and trying to pull a value from a column from the previous row.
Currently this is an example from the code im using.
Select CD1.nbr_dw, CD1.SEQ_DW, CD1.CDL_NET_PAID, CD1.UNITS_ALLOW,CD1.ALLOW_AMT, CD1.UNIT_PRICE, CD1.BACKED_OUT,
case
When CD1.NET_PAID = 0 then 0
****NEW CODE*****
Else CD1.ALLOW_AMT / CD1.UNIT_PRICE
end as NEW_UNITS
From Table_A CD1
join (Select nbr_dw, DET_DW, SEQ_DW
From Table_B
) CD2
on CD1.nbr_dw = CD2.nbr_dw
I need to add another when statement that says when CD1.BACKED_OUT = 'Y' populated the NEW_UNITS field with the previous rows value of CD1.UNIT_PRICE. Note, the CD1.SEQ_DW can be used to determine the previous row. Any ideas?Hi,
Welcome to the forum!
The analytic LAG function can return a value from the previous row:
LAG (cd1.unit_price) OVER ( -- PARTITION BY x -- if needed
ORDER BY cd1.seq_dw
)It's unclear if you need a PARTITION BY clause or not.
"PARTITION BY x" means that you want the value from the last row that has the same value of x as the current row.
If you omit the PARTITION BY clause, it means you want the last row regardless of what any other columns are.
Whenever you have a problem, it ehlps if you post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
Explain how you get those results from that data.
Always say what version of Oracle you're using. -
Copying from Oracle SQL Developer Worksheet doesn't retain formatting (font,color etc...)in Microsoft Word but copying from other programs such as
visual studio, chrome browser etc works fine. This doesn't work even after changed the setting to Keep Source formatting of Options-> Copy and Paste SettingsHi,
I notice that you have cross posted in Answers forum and Oracle forum. Have you tried Mr. Peter's suggestion?
Then, I recommend we check the Word settings:
1. Go to: Options > Advanced > Cut, Copy and Paste
2. Make sure that Use smart cut and paste is ticked.
3. Click the Settings button next to this option
4. Make sure that Smart Style
Behavior is checked.
If the issue still exists, please upload a sample through One Drive, I want to test.
Regards,
George Zhao
TechNet Community Support -
I recently started working on the Oracle SQL developer. I have 'select' privileges on the QA schema and when tried to execute proc in QA. It is giving the error as 'The file-based source <procedure Name> is not present in the database. Was it compiled?'
instead 'you do not have sufficient privileges to execute this procedure'. Did research on internet but with no luck.What configuration changes needed to be done to make it work.Guide me.Sounds like you do not have the correct privileges. What should have been granted to you by the QA user, or some other user with appropriate privileges, is...
grant EXECUTE on "QA"."<PROCEDURE_OF_INTEREST>" to "<YOUR_USERID>" ;
Note that a grant of execute on a procedure has nothing to do with grants of select on some or all of QA's tables and views.
So, as Vadim suggests, from your connection node in SQL Developer's Connections view, if you expand the Other Users node, then expand QA and look in the Procedures node, do you see the procedure of interest? If not, you cannot expect to be able to execute it from your userid's connection. And even if you do see it, you may have some other privilege that permits viewing but not executing, like...
The role SELECT_CATALOG_ROLE
The system privilege SELECT ANY DICTIONARY
And even if you do not see it there, then having certain other privileges granted to you could permit executing it in general, like...
The role EXECUTE_CATALOG_ROLE
The system privilege EXECUTE ANY PROCEDURE
Also, note that the 3.0 release is a bit dated nowadays. Upgrading to 4.0.3 production or even the 4.1 EA2 (early adopter) release will, in general, give you a better experience.
Best wishes,
Gary -
How to compare two schemas in Oracle sql developer
Hello,
I need to compare both the data and schemas details (columns etc) between two schemas on different databases (connections).
What is the easiest and most efficient way to do this? Hopefully in Oracle Sql Developer or Sql Plus?
Thanks.In SQL Developer go to Tools -> Schema Diff !
in SQL* Plus you will need to write PL/SQL for this.
Amardeep Sidhu -
Oracle SQL Developer freezes and locks up computer randomly
I attempted to find a solution to this before posting. I looked through the first 40 pages of this forum and on Google, through the Developer documentation, etc. with no luck.
The problem: while using Oracle SQL Developer, the computer randomly freezes. Things work, but it hangs too often and for too long to use. This is random - it can happen every 10 seconds or every 2 minutes. The mouse will lock up, and the keyboard buffer will get all messed up. For instance, if it happens to freeze while I'm hitting "backspace", it will delete many lines of text (I've lost a bit of work because of this in the past). The freezing will last about 2 to 20 seconds, and the only way out of it is to ctrl+alt+delete and kill SQL Developer.
If SQL Developer is running, and I'm in a different window - it will freeze the other windows as well. Again, it's impossible to use unfortunately. My coworker doesn't have the same problem, and he's connecting to the same database with the same version using Windows Vista. It must be something on this computer. I reformatted about 1 month ago, so it's a pretty fresh install and I haven't installed much of anything yet.
I'm using Windows Vista Enterprise 32-bit w/SP1.
This was occurring with older versions of SQL Developer (1.2). I'm using the newest install that included the Java JDK. I've completely removed Java, my Oracle installs, and a host of other attempts to fix this, and nothing changes. I've tried running the .exe in the bin directory as administrator as well.
Currently using Oracle Developer 1.5.1.54.40.
Any ideas?I tried dumping the contents, but the java dump wasn't showing anything at all, and it would never freeze while I had the console window in focus, so it wasn't very helpful unfortunately.
I fixed this issue by uninstalling the Java runtime on this machine and installing the Java JDK 6 Update 7 from java.sun.com/javase/downloads . I then downloaded the SQL Developer 1.5.1 version without the Java runtime included, and pointed it to the Update 7 .exe file upon first load.
I was using JDK 6 Update 6 previously, and it must have been behind the errors. Note that the Update 7 has to be downloaded from that website as it's a new version that hasn't been posted on the regular java.com site yet.
Message was edited by:
user645599
Maybe you are looking for
-
In Web UI, the top part (frame) is not displaying
Hello Everyone, After I log into Web UI, but I'm getting error message in top frame of web page saying: An error occurred during initialization of the application An exception occurred during the internal HTTP communicationException Class CX_BSP_WD_H
-
Canon 6D will not focus or flash in "Live View" mode.
My Canon 6D will not focus or flash in "Live View" mode. I have a canon 430ex II and a E-ttl flash connected with a sync cord for E-ttl function. The camera does simulate shutter action, but no photo is taken. How can I over-come this problem. O
-
Error while executing action SMCO in VMS Build-to-Order process.
Hello All, When I execute the Action 'SMCO' for service order confirmation, the system says that the action cannot be executed due to the error: "Actual date(s) is in the future (check parameters)". Also the Actual start & End Dates are blank in the
-
has anyone had a problem with VGA monitor with late 2011 MacBook Pro running Lion?
-
SCH-Notification Message: Company information update - User Attention Required
Does anyone know what to do with this recurring and random message? My customer is receiving this frequently and randonmly with no instructions. Thanks. Tim