Can't create new columns, constraints, indexes using DBeaver 7 in MySQL 8 - windows

I'm attempting to create new tables and add new columns to an existing MySQL 8 database. I'd like to use DBeaver GUI for this task. Creating the new connection with the MySQL 8+ driver, I'm able to connect to my localhost using root user.
I'm able to load the database tables and explore their columns, constraints, properties, etc. But I'm not able to create new columns... I can't see any option similar to New column, New Table, etc. In MySQL Workbench, for example, one just has to right-click over the grid to be able to add new columns.
I've right-clicked everywhere and I've read all menus and I'm not able to find a way to insert something new using the GUI. It seems as if I was in a read-only connection. However, I didn't check Security: Read-only connection when creating the connection (double checked).
Under table properties, if I right-click and I select Generate SQL > INSERT I'm not able to type anything in the resulting window...
Testing my connection I got the following:
Connected (30 ms)
Server:
MySQL 8.0.21
Driver:
MySQL Connector/J mysql-connector-java-8.0.17 (Revision: 16a712ddb3f826a1933ab42b0039f7fb9eebc6ec)
Finally, in table properties, if I change the table description, click de Save button and then the Persist button, I'm able to update the description. What am I doing wrong then?
I'm missing something obvious for sure.
Thanks in advance.

You can make changes to your tables with SQL. Click on the 'New SQL Editor' button here:
Then type up your SQL:
ALTER TABLE db_name.my_table,
ADD COLUMN column_1 NULL,
ADD COLUMN column_2 TEXT,
ADD COLUMN first_name VARCHAR(255);
Make sure you check the syntax for your specific version of MySql, and when you've got what you want there, click the 'Execute SQL Script' button:
That should do the trick.

Checked on windows machine on DBeaver 21.3.2, right the respective table on which you want to add column, click on "create column" and then enter the name and default values of the column like Auto increment and not null etc.
Finally click save and persist those changes in the database if you are sure of the changes you did otherwise edit the column and then persist them.

Running on Linux but seeing the same issue. I was able to start adding columns in the left pane, in the Database Navigator. Open a table, then right mouse on a table and you will see the option to add a column. Thereafter you can add columns in the properties tab.

Related

How to resolve error ORA-20987: APEX - ORA-02015?

I have a page in apex with multiple interactive grid. In one of the interactive grid i am trying to update the data of a column of a table in the database. The column named defect kind is a dropdown in the grid and on click of save should be able to updated the column value in database with the selected value in the grid.
While clicking on save apex is showing an error as follows:
Ajax call returned server error ORA-20987: APEX - ORA-02015: cannot select FOR UPDATE from remote table for.
I have used the type interactive grid - automatic row processing(DML) for saving the grid. Only defect kind is selected by the user rest all column value are coming directly from the table.
Interactive grid image:
NOTE:For this workspace the tables are accessed through a database link. I am using APEX 5.1.
This error is raised specifically because you are working over a database link.
Error code: ORA-02015
Description: cannot select FOR UPDATE from remote table
Cause: An attempt was made to select FOR UPDATE on a remote table (directly, or via a view) that had abstract data type columns, and the
view or select list contained abstract data type columns or non-column
items.
Action: To attempt a select FOR UPDATE, use a view or select list that consists only of base columns from the remote table, none of
which may be abstract data type columns.
I can't tell from what you've posted if the issue is with the query you're using to populate the IG or with some underlying view or the table itself. Depending your ability to locate and remove the "abstract data type columns or non-column items" (if that's even possible with an IG) you may not be able to make this work with automatic row processing over a database link at all. It may require a custom PL/SQL API instead.
Have you tried to set the attribute Lock Row (group Settings) to No in your Interactive Grid - automatic row processing(DML) process?

ORACLE ODI - ORA -00904-invalid-identifier

New to oracle. I have a dimension with a primary key. I create an interface. Mapping from staging area to analytics area. I set the primary key for target to execute on target. I click active mapping and set mapping to ROWNUM via the expression editor so the mapping looks like a screen shot I have.
When I execute I'm getting the above error and I've reached a dead end. Can anyone help? I don't want to map it to anything. I just want it to have a int ID created when records are inserted
Thanks
Debbie

Importing csv using Datagrip (table with identity column)

How to import CSV file into SQL Server table with identity column using DataGrip.
More precisely, how to exclude the identity column during the import or force importing the identity column?
Assume, you've got a table
create table test_identity_insert(

 x bigint primary key identity(1,1),
y int
);
go
You need to change data mappings
From the 'Import: "file_Name.csv" Format' window, on the Columns tab, click the trash can icon with the Identity column highlighted. (See screencap here, I don't currently have the reputation allowed to insert images.)
Also, see the bottom of the 'Import: Format Dialog' help page in DataGrip, or the web help here.

oracle query talend etl

I am a beginner to use talend etl I would make a request to select a database oracle then make a change _ S and insert it into a mysql table I'm stuck. I have not found how to make select queries with talend not know how I started that can help me please
To make a select on Oracle schema you need a tOracleInput component instance. You need to specify a Oracle connection (either a builtin connection or a repository-registered connection) and the output schema (the columns you need).
Then, click on "Guess query" to build the select SQL code accordingly to your desired output schema. You can then modify the automatically generated SQL code to fit your needs (ie. add WHERE or SORT clauses). Don't forget that output schema and selected columns must be the same (ie if you add a SQL-generated column inside the select clause you must add in your output schema, too). Any valid SELECT syntax can be used here (including subselects, cursors, window over partition and even more weird oracle stuff).
After the input instance, add a tMap where you make all your data manipulations. Finally, close with a tMySqlOutput, specifing connection and output table details. The flow will trivially looks like:
tOracleInput ----> tMap ----> tMySqlOutput
Create the connection Mysql and Oracle in Metadata Objects (Db Connections).
Create the following objects (tMySqlConnection - TOracleConnection)
Configure the objects with the parameters connections (Property Type: Repository).
Extract data: You can select the table with the object tOracleInput.
Edit schema of the table in the submenu Component
Create object TMAP, (transform the data)
Create object tMysqlOutPut and configure the schema and columns to insert.
Create object tMysqlCommit and close the connection.
Listo! ¡¡Run to job!! :)

How to create refresh statements for TableAdapter objects in Visual Studio?

I am working on developing an ADO.NET data provider and an associated DDEX provider. I am unable to convince the Visual Studio TableAdapater Configuration Wizard to generate SQL statements to refresh the data table after inserts and updates. It generates the insert and delete statements but will not produce the select statements to do the refresh.
The functionality referred to can be accessed by dropping a table from the Server Explorer (inside Visual Studio) onto a DataSet (e.g., DataSet1.xsd). It creates a TableAdapter object and configures SELECT, UPDATE, DELETE, and INSERT statements. If you right click on the TableAdapter object, the context menu has a “Configure” option that starts the “TableAdapter Configuration Wizard”. The first dialog of that wizard has an Advanced Options button, which leads to an option titled “Refresh the data table”. When used with SQL Server tables, that option causes a statement of the form “select field1, field2, …” to be added on to the end of the commands for the TableAdapter’s InsertCommand and UpdateCommand.
Do you have any idea what type property or interface might need to be exposed from the DDEX provider (or maybe the ADO.NET data provider) in order to make Visual Studio add those refresh statements to the update/insert commands?
The MSDN documentation for the Advanced SQL Generation Options Dialog Box has a note stating, “Refreshing the data table is only supported on databases that support batching of SQL statements.” This seems to imply that a .NET data provider might need to expose some property indicating such behavior is supported. But I cannot find it. Any ideas?
The refresh functionality in TableAdapter means that the associated datatable for the tableadapter operation will have updated data after the operation is completed.
If you call insert method of the tableadapter and pass the datarow or the datatable for the insert operation, the tableadapter will refresh the datatable/datarow to reflect the latest values from the database after the insert operation. If your table in database has generate a unique-id or auto-number for the insert command for the given row to insert, the original datarow's p.key coloumn will reflect the auto-generate id value from the database. This refreshing will be taken care by the tableadapter provided you have set the refresh option to true in the wizard configuration.
Now to this 'refresh' tableadapter will execute 2 queries in single batch, first will be the Insert, then the select with the scope_identity.
EDIT
My default Insert command would fire this single SQL if Refresh is turned OFF on the TableAdapter
INSERT INTO Table (coloumns) VALUES (values);
But My default Insert command would fire these SQL statement batch if Refresh is turned ON on the TableAdapter. Datarow that is passed as argument to Insert() will also be updated after successful execution.
INSERT INTO Table (coloumns) VALUES (values);
SELECT coloumns FROM Table WHERE (PKeyID = SCOPE_IDENTITY())

Resources