Friday, January 15, 2010

Edit results of query in data grid - Toad

Query statements MUST return the ROWID to be updatable. For example:

select * from employee where salary > 2000

would not be updatable, whereas:

select employee.*, rowid from employee where salary > 2000

would be updatable.

To reduce this obvious nuisance, you can use the TOAD-specific EDIT statement. For example:

edit employee where salary > 2000

If the resultset should be editable but remains read-only, make sure the TOAD Options > Data Grids - Data tab, Default to Read-Only Queries checkbox is NOT enabled

in reference to:

"Query statements MUST return the ROWID to be updatable. For example: select * from employee where salary > 2000 would not be updatable, whereas: select employee.*, rowid from employee where salary > 2000 would be updatable. To reduce this obvious nuisance, you can use the TOAD-specific EDIT statement. For example: edit employee where salary > 2000 If the resultset should be editable but remains read-only, make sure the TOAD Options > Data Grids - Data tab, Default to Read-Only Queries checkbox is NOT enabled"
- faq:answers:datagrid - TOAD Wiki (view on Google Sidewiki)

1 comment:

  1. Thank you so much!! This really help. A question...

    Using SQL Editor, how to produce new line character in the Data Grid result? My SQL below doesn't working.

    SELECT 'ABC' || CHR(13) || CHR(10) || 'DEF' FROM DUAL;

    ReplyDelete

Thank you for your feedback