DBeaver will not display certain schemas correctly in the Database Navigator - db2

I'm using DBeaver 5.2.5.201811181655 with IBM DB2/400 v7r3.
I'm trying to see a schema called WRKCERTO, but Database Navigator will not show it. The schema is there and I have rights to it, and I'm able to run SQL scripts with its objects, such as SELECT * FROM WRKCERTO.DAILYT and it works.
To make matters stranger, when WRKCERTO is the only schema in the filters, the contents of a schema which I cannot identify are shown under the connection as if the connection is their parent. It doesn't show any schema as a node in the tree between the connection & Tables, Views, etc. The tables are familiar, but I cannot determine their exact schema, and as such also cannot query any of them because DBeaver doesn't know what schema to use.
The behavior of the Projects window is the same.
If I connect with SquirrelSQL 3.8.1 everything looks ok. I can see WRKCERTO along with all my other schemas as if nothing is different.
The screenshot below shows the issue. The schema I use most is F_CERTOB, which is visible under the connection ASP7, which currently has two schema filters: F_CERTOB and WRKCERTO. But as shown, WRKCERTO...isn't.
The connection TEST is an exact copy of ASP7, but its only filter is WRKCERTO. And as mentioned above, the items under the connection name cannot be identified.
I've gone through the DBeaver settings, but I cannot find any way to change this behavior. AND...this is the first time I've tried to use WRKCERTO. I tried to access it for the first time only a couple days ago, so it seems unlikely there are bad bits of information about it floating around in my system, or in DBeaver.
What information can I provide to help diagnose this issue...?

Please check below url.Similar issue mentioned with some solution.
You may also want to try this and let me know if it works or not.
https://dbeaver.io/forum/viewtopic.php?f=2&t=911

Related

Mysql i can't save data types on table settings

Hello i can't save my data types on table settings, However when i try to apply changes it seems as saved on the table information section which is on the bottom left. But on the settings it is not visible. I'm adding a photo to describe it better. I'm using course schemas and all settings are on default. I think because of this i'm getting error on foreign keys. I can't use them at all (I can't check the box on foreign keys) because data types are not matching.
I'm using windows 11 fully updated.
All of my drivers are updated.
I'm using high-end pc so specs are more than enough.
I formatted my pc twice and reinstalled Mysql workbench and server multiple times(I also tried different versions such as (8.0.32-8.0.31.-8.0.20-8.0.16-8.0.12-8.0.11)) but i couldn't find a solution on anywhere. Please help me.
enter image description here
As you see on the photo for candy_product_id BIGINT and perms are missing , for cogs and price DECIMAL and their perms are missing. However on the bottom left as you see i actually saved them. After i click on apply and save the changes these datas are dissappering.

MYSQL how to see a table?

I am trying to see the data from a table called "places"
The schema that I am calling the "places" from is called "mtoldb"
I have previously successfully loaded data from "places" but I have forgotten how.
I understand this must be a stupid question but I just can't figure out what I need to type to query to make the request.
Please if you could kindly educated me by answering my stupid question, it will greatly help me to move forward.
In order to execute queries without a schema qualifier it is necessary to define (activate) a default schema when opening a connection. You can either do that by double clicking on a schema node in the schema tree on the left hand side or use the context menu on such a node and choose:
Alternatively, you can already select a schema in the connection settings:
Once you had an active schema and close the connection it will be set automatically on next open. The currently active schema is displayed in bold in the schema tree.

Can I debug a PostgreSQL query sent from an external source, that I can't edit?

I see how to debug queries stored as Functions in the database. But my problem is with an external QGIS plugin that connects to my Postgres 10.4 via network and does a complex query and calculations, and stores the results back into PostGIS tables:
FOR r IN c LOOP
SELECT
(1 - ST_LineLocatePoint(path.geom, ST_Intersection(r.geom, path.geom))) * ST_Length(path.geom)
INTO
station
(continues ...)
When it errors, it just returns that line number as the failing location, but no clue where it was in the loop through hundreds of features. (And any features it has processed are not stored to the output tables when it fails.) I totally don't know enough about the plugin and about SQL to hack the external query, and I suspect if it was a reasonable task the plugin author would have included more revealing debug messages.
So is there some way I could use pgAdmin4 (or anything) from the server side to watch the query process? Even being able to see if it fails the first time through the loop or later would help immensely. Knowing the loop count at failure would point me to the exact problem feature. Being able to see "station" or "r.geom" would make it even easier.
Perfectly fine if the process is miserably slow or interferes with other queries, I'm the only user on this server.
This is not actually a way to watch the RiverGIS query in action, but it is the best I have found. It extracts the failing ST_Intersects() call from the RiverGIS code and runs it under your control, where you can display any clues you want.
When you're totally mystified where the RiverGIS problem might be, run this SQL query:
SELECT
xs."XsecID" AS "XsecID",
xs."ReachID" AS "ReachID",
xs."Station" AS "Station",
xs."RiverCode" AS "RiverCode",
xs."ReachCode" AS "ReachCode",
ST_Intersection(xs.geom, riv.geom) AS "Fraction"
FROM
"<your project name>"."StreamCenterlines" AS riv,
"<your project name>"."XSCutLines" AS xs
WHERE
ST_Intersects(xs.geom, riv.geom)
ORDER BY xs."ReachID" ASC, xs."Station" DESC
Obviously replace <your project name> with the QGIS project name.
Also works for the BankLines step if you replace "StreamCenterlines" with "BankLines". Probably could be adapted to other situations where ST_Intersects() fails without a clue.
You'll get a listing with shorter geometry strings for good cross sections and double-length strings for bad ones. Probably need to widen your display column a lot to see this.
Works for me in pgAdmn4, or in QGIS3 -> Database -> DB Manager -> (click the wrench icon). You could select only bad lines, but I find the background info helpful.

Two types of user in database how might I redesign my database?

I have a database in production, with two types of users. Similar to Uber, we have a 'Rider' and a 'Driver' user.
In my database, I have Users, Rider and Driver tables. The User table contains shared data between the two user types, and the Driver and Rider tables contain the remaining data.
When the database was originally designed, it was not thought that a Driver might also want to be a Rider. This use case how now arisen and I am unsure how to handle the database tables.
Currently, the email_address field has a unique constraint. The user also has a user_type field, which is either Rider or Driver.
My current thoughts are to remove the unique constraint on email_address, and create a unique index on email_address and user_type, which allows users to use both sides of the application.
This does create the problem of needing to specify which type of user is being worked with, for example, when calling /login. I think I would now need to do something like /login?type=rider.
Are there any better approaches to this? We are in production, so I can't just scrap and recreate, but I am open to migrating data if there is a better solution.
My suggestion is a bit too big for comment, so hear me out.
Exact solution is difficult as I have not seen how you are using these tables in the application. So this solution is designed on some assumptions.
At login time, you need to determine if the user wants to logon as driver or rider. Typically, link for drivers should be different that link for users. Or there should be a flag.
For riders, you don't need additional validation. But not everyone should be allowed to log in as driver ( e.g. If a user by mistake tries to logon as driver, system should not allow that).
That means your initial user table and driver table does not need any modification. Now if you are not a driver, user role should default to rider.
If you are a rider logging in as rider, no change is needed.
I am assuming you have a role setting mechanism somewhere in your code base.
However, if you are a driver logging in as driver, your existing logic should continue with this additional flag, i.e. you should check if flag is present in code and only then allow checking for driver in your tables. If you are a driver coming in as rider, the flag has to go as no.
Now you have 2 options. First is to get the driver coming in as rider data from driver table only, and second is to make an entry in rider table and use that. Both approaches will work ( you will have to tweak your application logic based on the flag to get to the correct table). My suggestion will be to go to the rider table, that should reduce further complications in the system. So basically, one user, if he is a driver sometimes and rider sometimes, should have entries in both driver and rider table( assuming your constraint is only on user tables) and you should use the correct entry based on the role the person is logging in. Hopefully, once logged in using the correct table, the changes to the system would be a minimum.

SSMS 2008 adding ALTER TABLE WITH CHECK ADD CONSTRAINT to my Procs

I have searched Google, BOL, and several forums and can't find the answer:
I have a very small data base application that I write some queries and SPs to extract data. A few days ago I opened an exsiting SP to find that something had added code similar to that below, sometimes multiple lines referring to every table in the database. When I set up a new simple SP like "Select * from TinyTable" and re-open it, the same code has been inserted.
The last thing I remember doing was reviewing the settings for results to grid in SSMS 2008 R2. I'm afraid I may have accidently changed a setting but I've spent hours reviewing them and can't identify what it might be.
I have considered reinstalling SSMS to set back to defaults but I have a linked server set up to solve a collation conflict, and don't want to cause problems with that. If anyone can point me in the right direction I'd appreciate it. I may be searching using the wrong terminology but can find nothing. As I say, I don't know for sure a change to the SSMS tools options is the problem but I suspect it could be something I have done.
Here's a sample of what gets automatically inserted at the bottom of every one of my procs:
GO
ALTER TABLE [dbo].[tblLot] WITH CHECK ADD CONSTRAINT [FK_tblLot_tblLocation] FOREIGN KEY([LocID])
REFERENCES [dbo].[tblLocation] ([LocID])
You likely have Tools > Options > SQL Server Object Explorer > Scripting > Object Scripting Options > Generate script for dependent objects set to True. Try changing the value to false.