Tables are empty in Query Builder when Saved SQL script is retrieved - oracle-sqldeveloper

I saved a query I created in the SQL Developer Query Builder.
When I retrieved the query, the linked Tables don't show the Column Names in the Query Builder.
The Tables are still linked/joined to one another and the query still runs, but the columns names are blank.
How do I get the Column Name to reappear?
I'm new to SQL Developer, so I'm not sure how to resolve this issue.
Any help would be greatly appreciated.
Searched through the menus for something that would restore the columns names.
Searched through help option on SQL Developers and nothing found relating to this issue.

I was very tempted to delete this post when I found the answer myself.
However, I think there are more rookies out there like me.
The resolution is to add a semi-colon ";" to the end of the statement in the Worksheet Tab.
Even though I created the query in the Query Builder Tab, SQL Developer creates the SQL Statement in the Worksheet Tab.
So for some reason after you save that Query that was created in the Query Builder Tab; when you retrieve the script, you must add ";" to the end of the SQL Statement in the Worksheet Tab or else you get the issue I encountered with the blank columns.

Related

SQL Developer - automatically refresh a query

Is there a way to automatically refresh my own query in Oracle SQL Developer?
Something like Tools/Monitor Sessions.../Refresh but for any provided query.
Yes, turn your query into a user defined report.
You can right-click on your query result grid in the worksheet -
Then if you want a new one, i'd just keep the one and edit the report properties for your new query.
Doesn't have to be a grid either - you can have a report of type script. Or use charts. Or a lot more.

Access/Get SQL Developer Table 'Details'

I have a list of tables in an Oracle Schema. I use SQL Developer to build my queries. I can click on each table within the schema in SQL Developer and get access to a number of tabs, one of which is 'Details':
Within the 'Details' window, I have a property called 'Comments' which contains a description of what the table is for.
Now, I have quite a few tables and I want to somehow grab the table name and description in that comments property for each table and put it into a spreadsheet. Is there any way to do that in SQL Developer? Maybe a query? Or some built in function that iterates over each table and provides that information? I thought about using python, but I'm not sure I can access the 'Details' of the table.
Every once in a while, I find a solution before i have some of you awesome people answer for me, so i thought I'd post up what I found. This is the query I found that works:
select * from all_tab_comments where owner = 'your_schema_name_here'
This provides a list of all the tables in the schema (owner) I want and provides the comments I was looking for. From there, I can just export to an excel spreadsheet.

Can't remap fields - map fields window is missing new table

I have a Crystal Report with a database command:
The command has a join clause that can be removed and read from a table in the database, because it represents static data. I add this table (called _System) to the database expert:
Now I edit the command to remove the join and columns that reference this table. Since the report fields that depended on these columns are no longer mapped, this causes the Map Fields window to appear:
...which does not have the new table in it. If I cancel out of this I am back to where I originally was. If I hit OK without mapping, all of the unmapped fields on the report are deleted (suffice it to say... I was not expecting this >:( )
I have tried adding links between the command and the new table, and refreshing report parameters, but these have had no effect.
One workaround is to manually replace every field in the report, but this is very labour intensive.
Here is the outline of the command before:
SELECT ACT.Account_Code, ACT.Company, ACT.FName, --etc
STM.CompanyName AS 'DLRName', STM.Address_1 AS 'DLRAddress', STM.City AS 'DlrCity' --etc
FROM Accounts AS ACT
JOIN _System AS STM ON 1 = 1
GROUP BY ACT.Account_Code, ACT.Company, ACT.FName, --etc
STM.CompanyName, STM.Address_1, STM.City --etc
And after:
SELECT ACT.Account_Code, ACT.Company, ACT.FName, --etc
FROM Accounts AS ACT
GROUP BY ACT.Account_Code, ACT.Company, ACT.FName --etc
I have removed the JOIN on the _System table, and all referenced columns.
It appears to not be recognizing your _system table as a new source.
I would :
1) leave your command object SQL unchanged & get the issue worked out with the _System table, then
2) ensure that you are able to establish a join between the command object fields and the _System table fields, and lastly
3) then remap the fields.
Step two I suspect is the source of the problem, as your join condition is "ON 1 = 1" which I assume to mean that you may not have a common key field in both tables.
Note that your original command SQL selects STM.Companyname AS 'DLRName'.
Hence, crystal now know of a field called DLRName, but does not know of a field called CompanyName, hence it cannot make the association between DLRName in the old source, and CompanyName in the new source...
Likewise with the rest of the fields that are being moved from the command object to an attached table. if no name match exists...Crystal cant make the connection. However...it would list all unmatched fields that are on the report, and all unused fields in the recognized data sources, and allow you to specify the matches yourself.
But it does not...which tells me that something has gone wrong with the attempt to attach/open the _System table. Hence..you need to get that worked out first, then make the field adjustments.
If this doesnt get you thru...then show some sample data so I can see how the two tables are relating ( ensure some examples exists where there is a row match from both tables ).
I had the same problem a while ago.
Unfortunately I can't find anything online that helps, or maybe wasn't looking hard enough. I just noticed that in my case, that particular field that isn't showing in the map field dialogue box has nvarchar(max) as its datatype (in view).
I tried to force the datatype with CAST(missingfieldname as nvarchar(20)) as missingfieldname (I did this in the view), and voila, it magically appears in the map field dialogue box.
It seems that field mapping dialogue box aren't showing fields with blob texts.
I know this question was asked 4 years ago. But hopefully, this comment could help future solution seekers regarding this absurd and weird problem. I just got lucky seeing what's unique about that particular missing field.

Must be possible to filter table names in a single database?

As far as I can tell, the search filter in the navigator will only search available database names, not table names.
If you click on a table name and start typing, it appears that a simple search can be performed beginning with the first letter of the tables.
I'm looking for way to be able to search all table names in a selected database. Sometimes there can be a lot of tables to sort through. It seems like a feature that would likely be there and I can't find it.
Found out the answer...
If you type for example *.test_table or the schema name instead of the asterisk it will filter them. The key is that the schema/database must be specified in the search query. The asterisk notation works with the table names as well. For example *.*test* will filter any table in any schema with test anywhere in the table name.
You can use the command
SHOW TABLES like '%%';
To have it always in your tools, you can add it as a snippet to SQL aditions panel on the right.
Then you can always either bring it in your editor and type your search key between %%, or just execute it as it is (It will fetch all the tables of the database) and then just filter using the "filter rows" input of the result set.

Using Select query, nothing merges onto Crystal report

I have a Crystal template that I am modifying in developer because we are changing the datasource from an Access file to our Oracle DB. I created a database field that accurately connects to Oracle and added a select statement that because pulls a field from a particular table
select s.field from table s;
On the right hand side, under database fields, I see my command and can right click and browse the data, which right now returns two values.
I also made a formula field using an Azalea barcode function that calls the values (I think, this is where stuff is going wrong, I guess)
The formula field is
BarcodeC39ASCII({Command.field})
So this should take the data and format it into the barcode, except when I use print preview or print out the report, no data is merged.
I've tested this by creating a new formula field with just the Command.field, and still no data is merged. I imagine there is something really obvious that I am missing and would appreciate any input.
So unless I misunderstood your question, you are changing your datasource from Access DB to Oracle DB, correct? Assuming that the database structure remains the same then all you should need to do is go into Database -> Set Datasource Location and set the datasource location from the Access DB to the Oracle DB and your existing report should work as it did. You might have to map some fields, but that should be the extend of it. Is that what you are trying to do?
Chris