Author |
Message |
SqlExplorer
Joined: 18 Sep 2011 Posts: 124 Country: United States |
|
Can we edit tables? |
|
Hi,
We can edit and delete tables manually in Sql Developer. But I can't figure out how to do it in the Sql Assistant editor. I have to use DELETE statements to do it, there.
|
|
Mon Jun 26, 2023 8:11 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Using a query select the data you want to edit. If the query is editable, such is that it can recognize table primary key in the result, you can edit data directly in the result grid, as well as delete rows. If the table is small, you can retrieve full table, for example, Ctrl+click table name in the code and then choose Retrieve All menu in the result grid. Or similarly right-click table name in DB Explorer and choose Data Preview and again Retrieve All. there is a button on the result grid toolbar that activates Edit mode.
|
|
Mon Jun 26, 2023 9:00 pm |
|
 |
SqlExplorer
Joined: 18 Sep 2011 Posts: 124 Country: United States |
|
|
|
Thanks,
I included the primary key in the query and highlighted the rows, but all of the Modify menu items (Right-Click, then Edit, Add Row, Delete Row) are disabled.
I also tried it with a table that doesn't have a primary key and has only 3 columns. In that case, I used SELECT * rather than referring to particular fields. But nothing is editable or deletable.
 |
 |
Using a query select the data you want to edit. If the query is editable, such is that it can recognize table primary key in the result, you can edit data directly in the result grid, as well as delete rows. If the table is small, you can retrieve full table, for example, Ctrl+click table name in the code and then choose Retrieve All menu in the result grid. Or similarly right-click table name in DB Explorer and choose Data Preview and again Retrieve All. there is a button on the result grid toolbar that activates Edit mode. |
|
|
Wed Jun 28, 2023 2:56 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Does SQL Assistant show primary key for that table its DB Explorer?
|
|
Wed Jun 28, 2023 3:39 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Also if it can recognize table primary key, a little key icon should be painted over the header of the primary key columns. Here is how it appears on my screen

|
|
Wed Jun 28, 2023 3:44 pm |
|
 |
SqlExplorer
Joined: 18 Sep 2011 Posts: 124 Country: United States |
|
|
|
It recognizes the primary key, according to the left hand column, Table Name/Columns/Field Name.
But in the query, Edit is disabled.
Note that the 'Quick Preview' DOES allow to edit records. But I'm not able to filter it, probably because the quick preview record set doesn't include the record I need.
 |
 |
Also if it can recognize table primary key, a little key icon should be painted over the header of the primary key columns. Here is how it appears on my screen
 |
|
|
Fri Aug 18, 2023 11:01 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
In that Quick Preview, right-click the grid and select Retrieve All command. This will retrieve all records, Quick Preview stops after first 100.
Warning: this is not recommended for large tables as it will pull the entire table into memory.
|
|
Fri Aug 18, 2023 12:50 pm |
|
 |
SqlExplorer
Joined: 18 Sep 2011 Posts: 124 Country: United States |
|
|
|
Unfortunately, some of the tables are fairly large.
I can continue to just do UPDATEs if need be, or use Sql Developer in rare instances.
 |
 |
In that Quick Preview, right-click the grid and select Retrieve All command. This will retrieve all records, Quick Preview stops after first 100.
Warning: this is not recommended for large tables as it will pull the entire table into memory. |
|
|
Fri Aug 18, 2023 9:25 pm |
|
 |
|