How to change the order of the parameters in Oracle SQL Developer

Asked

Viewed 488 times

0

I have a question regarding the order of the parameters within SQL developer.
Query for example:

select *      
from conta_paciente  
where cd_convenio = :cd_conv   
and dt_conta between :dti and :dt

In older versions the parameters were in the order I put in select as an example below:
versão antiga

Already in the latest version, the parameters are getting alphabetical order, as example below:
Versão Nova

It may look silly but during the query it is easier when the order is exactly the same as the script.

1 answer

-1

Hello, Gabriel.

You can use "Invisible Columns and Column Ordering" to solve your case.

In the Oracle 12c version, to rearrange the columns logically, you can use "VISIBLE".

Example:

Create the table

CREATE TABLE t (
    a INT,
    b INT,
    d INT,
    e INT
);

Add a column:

ALTER TABLE t ADD (c INT);

Move column to middle:

ALTER TABLE t MODIFY (d INVISIBLE, e INVISIBLE);
ALTER TABLE t MODIFY (d VISIBLE, e VISIBLE);

DESCRIBE t;

Name
----
A
B
C
D
E

When you make an invisible column visible, the column is included in the order of table columns as the last column.

Documentation link

  • Dude, this has nothing to do with what he asked

Browser other questions tagged

You are not signed in. Login or sign up in order to post.