Oracle SqlDeveloper - order and size of column set in code completion window - oracle

I am currently using Oracle sql developer v4.0.3.16. When I do auto-complete of table columns, they show up in ascending order. I've got table with over 200 columns. Auto-completion window shows only 40 positions. When i choose last position '...' - window is being refreshed with all column names, but still in ascending order.
How can i change the way of presenting result in prompt, to show all column names in order as is returned by 'DESCRIBE table' command?

You can't influence the order, we do alphabetical only. Main reason is because a general user isn't going to have your data model memorized.
To get the best bang for your buck with this feature, you're going to want to type the first 1 to however many characters of your column or table or procedure name.
We don't show 200 columns by default, because that's not very helpful at all.
But give us the first letter, and now things become much more interesting.
Starting in a version very close to what you have, the automatic insight feature doesn't even make a suggestion unless you have 10 or fewer 'hits' - although this is configurable.

Related

BIRT suppress multiple duplicate columns

I am working on a BIRT report. Its records are grouped on the basis of the status column. I was looking for an option in the Eclipse BIRT tool by which I can hide combinations of multiple columns in a row which are repeating. I have attached screenshots for both the current report and the expected report structure.
I tried the "suppress duplicate" option but that is limited to a single column. I am not able to apply this on multiple columns together. I couldn't figure out any other option. Please suggest any solution in the tool or do I need to change my query to return the result in the expected format?
Actual Result:
Expected Result:
There are three obvious ways to hide duplicate values.
All of these require you to configure this per column (BTW I don't understand why you consider this to be a problem).
As you already did: Use "suppress duplicates" at the column level.
Add more groups to your table after the existing group.
E.g. one group for the first column (whatever that is).
Then you can choose "Drop" "detail" in the properties of the corresponding group header cell. It's a bit difficult to get the layout right this way.
In your data set, if it's SQL, you can use a little construnct with CASE and the LAG analytic function to compare the column value to that of the previous row, and if they are equal, return NULL instead (pure SQL solution).

Set sort on first column as default in TOAD

I'm using Toad for Oracle 12.5 and a little thing anoy me : when I look into the "Data" tab of a table, the row order is all jumbled up.
On any other DB software I used (SQL developper, phpmyadmin, etc), the default data view would retur the rows ordered by the primary key
So, I would like it to automaticly by default sort the data in the "Data" tab of each table to the first column, or even better, to the table primary key.
I've looked in the options but I can't see anything related to this.
Have some of you had the same problem ?
No oracle client that I have seen ever tacks an "order by" onto a statement on its own accord. It returns what the query returns in the order (or lack thereov) that it receives it.
Now it may LOOK ordered if the rows were inserted in order, but that is a fluke. Period.
And frankly, I'd be upset if a UI arbitrarily added expensive sorts to my queries unless I specifically told it to.
I have some BIG tables. presuming that I want the UI to take the time to scan the index and grab the lowest PK values just because I opened the DATA tab? No. Dear me - NO!
If I want it ordered, I will open the sort/filter dialog and specify so, or click on the appropriate column header to sort the results.
ADDITION:
If there ARE some tables where you want this behaviour (I can see the convenience if checking code tables for example), then use the sort/filter dialog on the data grid for that table to set an order by and TOAD will remember that setting for that table in this schema until you remove it. So you CAN set this behaviour where you want and not deal with the performance aspects where you don't.

Linq to SQL - Random Select Order and Paging

We have a database with 2,00,000 vendor in 100 plus category, if someone visit the website we want to allow them to select a category and show them 25 Vendor per page, first we kept order by VendorId but it always use to get first 25, but we removed it, but now in paging it sometime repeat the vendor, is there a way to get random 25 vendor and also keep the paging.
Regards
you can randomize your result but everytime you dot he query, it will create new random list so unless you randomize and save the randomized state in your Code and page over it, it cant be done straightforward way.
refer, SQL Query results pagination with random Order by in SQL Server 2008
I believe this requirement is impossible to implement if a new random order is needed every time, there needs to be good performance and every item should have equal chance to get selected. I believe you should redesign the way your application works.
One possible workaround is to have a couple of columns in a table and fill them with random numbers. When a user requests the list assign the random column to him (stick it in the URL for example). Then do an order by that column and display the results. Randomly switch 4-5 columns to create the appearance of randomness. Update the random numbers in the columns once a day.

Reporting services - Interactive sort nulls last - Reportviewer VS2010

SSRS 2008
I've defined Interactive sort on a column that has also null values.
I want the nulls to always appear at the end of the report regardless of whether the
direction is Ascending or Descending.
Report is displayed by Reportviewer in VS2010
User clicks on column header to activate interactive sort
All help/suggestions are welcome.
I can think of one workaround here, which may or may not help, but at worst might give you more ideas.
What you can try doing is actually use two tables, and apply the sort to only one, but make it look like one table in the report.
Create two tables:
Apply filters to the tables to show non-null values in the first and null values in the second.
I used the expression:
=IIf(IsNothing(Fields!val2.Value), "NULL", "NOTNULL")
Apply Interactive Sorting to the first table.
This gives the results:
So in this simple case it's achieving what you're after.
Since it's actually two objects, you might get breaks in places users don't expect; this could be mitigated by keeping the objects together with a Rectangle.
If you're looking for multiple columns this might not be suitable, but hopefully it helps.

VB6 and data-bound MSHFlexGrid, moving and populating columns

I'm working on a VB6 program that connects to a SQL Server 2008 R2 database. In the past I have always used the MSFlexGrid control and populated it manually. Now, however, the guy who is paying me for this wants me to use data-bound grids instead, which forces me to use the MSHFlexGrid control because I'm using ADO and not DAO. So, I have two questions...
First, how would I move a column in a MSHFlexGrid? For example, if I wanted the third column to appear as the sixth column in the grid, is there a simple single line of code that would do that?
Second, believe it or not, I've never had to do anything in a grid other than display the data, as is, from a recordset. Now, however, I have a recordset with some fields that contain just ID numbers that refer to records in other files - for example, a field containing an ID number referring to a record in the Customers table, instead of the field containing the customer's name. What is the easiest way to, instead of having a column showing customer ID numbers from the recordset, having that column show customer names? I thought I read somewhere that there's a way to embed a sql command in a MSHFlexGrid column, but if there is I wouldn't know how to do it. Is this possible, or is there a simpler way to do it?
TIA,
Kevin
The column order would typically be handled by your SELECT statement.
Say you have a Pies table that has a FruitID foreign key related to the FruitID in a Fruits table:
SELECT PieID AS ID, Pie, Fruit FROM Pies LEFT OUTER JOIN Fruits
ON Pies.FruitID = Fruits.FruitID
This returns 3 items: ID, Pie, and Fruit in that order.
Moving columns after the query/display operation is rarely used, but yes ColPosition can be used for that.
Wow! VB6.... Back to the future! :-)
You can move Columns using the ColPosition Property.
This article shows how you could setup the grid to display hierarchical data.
If you just want to display the customer name on the same line as the main data then that is doable as well by just creating the proper SQL for your data source. For that matter you can control the column order the same way as well.
Now, how about considering upgrading to .Net? Just kidding..... No, I'm not. OK. I am, maybe. :-)

Resources