Eliminate sort order on Data tab of SQL Developer table view - oracle

In Oracle SQL Developer, one can list the data in a table using the Data tab when viewing a table. There is also a 'Sort...' button to set the sort order of the data you are viewing. This can be very handy for viewing some data on the fly.
The problem: I set a sort order for viewing a particular table which is not supported by the indexes on that table. It seems that SQL Developer does the sort on the fly when you go to view that data. At first the delay wasn't too bad. But the table has grown and now it takes forever. There is no way to stop it except by force quitting SQL Developer, losing anything unsaved. (If you know another way to stop this sort, let me know!) So, I should change the viewing sort order to something else, but you can only access the Sort... button when viewing the data.
Is there another way to delete the viewing sort order besides viewing the data?
Where does SQL Developer store this information?
Any way to stop the sorting of the data after clicking on the data tab while waiting for it to appear?

Easy to fix (at least in v1.5.5, which is what I'm using). There's a prefs option to reset it, read about it here:
https://forums.oracle.com/forums/thread.jspa?threadID=860431
Go to Tools > Preferences > Database > ObjectViewer Parameters and select the Clear button. This will clear the sort settings.

I haven't found a command from the GUI to eliminate the sort order but you can use this workaround:
Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
Perform a full text search specifying the name of the sorted column. If the column's name is too common (ex: data) specify another column with a different name in the same table. You will find one or more xml files matching your searching criteria. Those files are table descriptors.
At the end of the xml descriptor search for the taf element with name 'orderByClause'. If it contains the name of the column you want eliminate from sorting replace the line with an empty element ()
Restart sqldeveloper and ... sort is not there anymore!
Hope this helps
Cheers,
Fabrizio Fortino

If you are willing to take a little risk, you can follow start by doing Fabrizio's suggestion, and then clean house as follows:
Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
Perform a search using the following mask "*tablesettings.xml".
Delete the files that were returned to you.
Restart sqldeveloper and your problem is gone.
To be safe, you might want to just move those files to a quarantine directory.

I believe there isn't currently a way, but there is a suggested enhancement not to retain the filter between sessions that you can vote on here on the SQL Developer forum

Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
On SQLDEveloper Version 3.0.03 (and up I guess) search for *GridSettings.xml
Find the file containing xml related to your table/view.
Either delete the file or remove only the lines corresponding to the columns previously deleted from the table. You need to remove lines from ; ;
You don't need to restart sqldeveloper. Just disconnecting and connectting back did it for me.

Related

Filtering the list of tables in JetBrains Datagrip

I have recently started using JetBrains DataGrip as a replacement for HeidiSQL.
My issue relates to the list of tables in the Database Explorer. We have a large database (700+ tables) and scrolling to find the table I'm looking for is rather cumbersome. For a table with a nice, long, specific name I can just start typing and get the highlighting on the table names, which usually takes me right where I need to go:
But if I'm trying to get to the table user and we have lots of other tables with "user" in the name in various positions, the highlighting tool only takes me to the first table with "user" in the name, which is not the actual "user" table (and because we have tables with names like billingUsers, it doesn't scroll to anywhere near the actual user table that I'm looking for).
What other methods should I be using when I want to find a particular table in DataGrip? In HeidiSQL, there was the "filter tables" box which would filter the list of tables based on the search term, which got me much closer to my intended destination much more quickly. Does DataGrip have any sort of "quick filter" like this? Or is there some other tool or prompt I should use to go directly to this table instead?
During the writing of this question I came across the "double Shift" shortcut, which is helpful and closer to what I'm looking for -- though in my case I have several of our development environments configured in DataGrip, and it lists the table in every environment - whereas in the Database Explorer, I usually only have one environment expanded at a time (and only want to see results from that database, not the others).
StackOverflow suggested this question to me, which has the same issue as the double-Shift shortcut -- it shows results from all databases, not just the one I'm working in.
I am from the DataGrip teram. We are currently working on that and expecting the filtering functionality in 2022.3. Anyway, now there are several workarounds (and Shift+Shift is one of them). See them here:
https://youtrack.jetbrains.com/issue/DBE-3017/Show-only-filtered-items-when-typing-in-the-database-explorer

Can we find a table that is used in a set of FMBs without opening it individually in Oracle Forms?

I am using both Oracle Forms version 11g and 12c.
Is it possible to find a table for e.g table1 used in the Oracle Forms application screens including LOV's without opening each FMB individually and searching in it.
Totally there are around 50-75 FMBs in the application.
Thanks
While Forms was a new software product, back then in its 3.0 version (or even lower), you could choose whether you'll keep the form source
in the database or
in that case, you could have written a query which selects data from the data dictionary and - hopefully - extract tables' names
in file system
file extension was .INP (not .FMB) and it was a textual file; it means that you could even create a form using text editor! Nobody probably did that, but hey - you could have done it.
.FMB is no longer textual file. Yes, you can open it it a text editor (such as Notepad++) and search for e.g. FROM (because any table used in form's PL/SQL units or LoVs is part of a SELECT statement which requires the FROM keyword) and get something like this:
Yes, you'll get "duplicates" if any table is referenced more than once.
Another option is to write a program which will parse the .FMB file and extract tables' names (I can't help with that, though).

Oracle SQL Developer - Array Fetch Size

I thought for sure this would be an easy issue, but I haven't been able to find anything. In SQL Server SSMS, if I run a SQL Statement, I get back all the records of that query, but in Oracle SQL Developer, I apparently can get back at most, 200 records, so I cannot really test the speed or look at the data. How can I increase this limit to be as much as I need to match how SSMS works in that regard?
I thought this would be a quick Google search to find it, but it seems very difficult to find, if it is even possible. I found one aricle on Stack Overflow that states:
You can also edit the preferences file by hand to set the Array Fetch Size to any value.
Mine is found at C:\Users<user>\AppData\Roaming\SQL
Developer\system4.0.2.15.21\o.sqldeveloper.12.2.0.15.21\product-preferences.xml on Win 7 (x64).
The value is on line 372 for me and reads
I have changed it to 2000 and it works for me.
But I cannot find that location. I can find the SQL Developer folder, but my system is 19.xxxx and there is no corresponding file in that location. I did a search for "product-preferences.xml" and couldn't find it in the SQL Developer folder. Not sure if Windows 10 has a different location.
As such, is there anyway I can edit a config file of some sort to change this setting or any other way?
If you're testing execution times you're already good. Adding more rows to the result screen is just adding fetch time.
If you want to add fetch time to your testing, execute the query as a script (F5). However, this still has a max number of rows you can print to the screen, also set in preferences.
Your best bet I think is the AutoTrace feature. You can tell it to fetch all the rows, you'll also get a ton of performance metrics and the actual execution plan.
Check that last box
Then use this button to run the scenario

Validation Rule in Access Not Accepting Valid Data; Can't Save Record

I am using some simple validation rules on a table in the database I manage (it is ANSI-89 at the moment, if that helps). One, for example, reads:
Like "#" Or Like "##"
As I understand it, this should allow any single- or double-digit number (1, 2, 35, 00, 99, et cetera). However, typing "1" into the field is rejected, and the validation rule keeps prompting for a correct input, as it is a required field.
Similarly, and more importantly, I have another field that is validated like so:
Like "######?"
"201620A" should be valid (as you may guess data for this field is based partially on the year). And, while not real data, "123456Z" should be accepted as well. Despite this, both are rejected.
Because they are required fields, I am then unable to save the record... usually. Bizarrely, I have sometimes been able to save the record successfully. I.e., it's not behaving consistently.
I am baffled. I wish to retain the validation rules, as these fields are essential and I would like to at least do some basic checking to ensure they have been entered correctly. I realize there must be some simple thing I am overlooking...
As noted in the comments, HansUp's suggestion of using Compact & Repair seems to have corrected the issue, as once I did that the problem has been consistently gone now for over two months. While it is a simple process, in case anyone needs it Microsoft's instructions on how to do this can be found here: https://support.office.com/en-us/article/Compact-and-repair-a-database-6ee60f16-aed0-40ac-bf22-85fa9f4005b2?ui=en-US&rs=en-US&ad=US&fromAR=1
They suggest backing up the database first. Here is an excerpt:
Compact and repair a database that you have open
NOTE: If other users are also currently using the database file, you
cannot perform a compact and repair operation.
On the File tab, click Info, and then click Compact and Repair
Database.
Compact and repair a database that is not open
NOTE: If other users are currently using the database file, you cannot
perform a compact and repair operation. While you run the compact and
repair operation, no one can use the database file.
Start Access, but do not open a database.
Point to Info, and then click Compact and Repair Database.
In the Database to Compact From dialog box, navigate to and
double-click the database that you want to compact and repair.

ADOX Rearrange Or Insert Columns Rather than Append them in Access Vb6, VB.Net or CSharp

I need to insert a field in the middle of current fields of a database table. I'm currently doing this in VB6 but may get the green light to do this in .net. Anyway I'm wondering since Access gives you the ability to "insert" fields in the table is there a way to do this in ADOX? If I had to I could step back and use DAO, but not sure how to do it there either.
If yor're wondering why I want to do this applications database has changed over time and I'm being asked to create Upgrade program for some of the installations with older versions.
Any help would be great.
This should not be necessary. Use the correct list of fields in your queries to retrieve them in the required order.
BUT, if you really need to do that, the only way i know is to create a new table with the fields in the required order, read the data from the old table into the new one, delete the old table and rename the new table as the old one.
I hear you: in Access the order of the fields is important.
If you need a comprehensive way to work with ADOX, your go to place is Allen Browne's website. I have used it to from my novice to pro in handling Access database changes. Here it is: www.AllenBrowne.com. Go to Access Tips then scroll down to ADOX Code.
That is also where I normally refer people with doubts about capabilities of Access as a database :)
In your case, you will juggle through creating a new table with the new field in the right position, copying data to the new table, applying properties to the fields, deleting original table, renaming the new table to the required (original) name.
That is the correct order. Do not apply field properties before copying the data. Some indexes and key properties may not be applied when the fields already have data.
Over time, I have automated this so I just run an application to do detect and implement the required changes for me. But that took A LOT of work-weeks.

Resources