Importing csv using Datagrip (table with identity column) - datagrip

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.

Related

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

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.

Generating sql insert into for DataGrip

When you run a query (a SELECT statement) in the console, the data retrieved from the database are shown in table format in the Result pane of the Database Console tool window.
I've searched through datagrip Help and I'm just wondering if there is anyway out there that can be used to generate INSERT INTO scripts for a tables' content or rows in table format?
Choose SQL Insert extractor in the drop-down menu.
Them you'll be able to copy (Ctrl/Cmd+C) data as a bunch of INSERTS. Or use Export button next to the extractor.

Oracle Apex: show picture in report from a different table?

I have the following apex report :
select id,
user_ as participant,
--This is a blob
dbms_lob.getlength(MY_UTILITIES.GetUserPicture(user_)) as Picture,
order_ as order_
from My_Operations
I would like to display the column Picture as an image in the report. It's a blob stored in another table : Table My_Users (the Primary key column name is 'ID')
I configured as follows the Picture Column :
enter image description here
The report generates but the picture doesn't show :
enter image description here
I'm sure using this implementation Apex has no way to know that the field picture corresponds to the row X in the table My_Users.
Does anyone know how to correct that please ?
Cheers,
The way APEX displays images in reports is somewhat weird and wacky it would seem. What you need to do is apparently undocumented but I believe it is as follows:
The column that will be displayed as an image must contain the length of the BLOB column (which you have done correctly). I found this out from this blog post.
The column specified for Primary Key Column 1 specified in the BLOB attributes of that column must also appear in the report with the same name. I figured that out by trial and error.
You have aliased column user_ as participant. APEX requires it to be called ID - but you already have a different column called ID! So I think you should try this:
select id as op_id,
user_ as id,
dbms_lob.getlength(MY_UTILITIES.GetUserPicture(user_)) as Picture,
order_ as order_
from My_Operations

Can't view all the schema's in SQL sever while importing the source tables in informatica power center

I have to import a specific source table from the source database. I could see only a few schemas and not all (as there are thousands of), hence could not select desired table, so I am specifying the table in search box. But it does not show up anything. I tried using schema.tablename and different combinations but in vain. Infact, when I try searching for the tables that are already visible, they doesn't show up. i used the same credentials that i used to create schema and tables. though im not getting those required schema and table. ANy help is appreciated!
In the Import Tables dialog box select "All" in Show owners:

How to import excel data into Toad 9.5 table

How to import Excel data into Toad 9.5 Table
I have Toad for Oracle 9.5 and MS Excel 2007. I want to import Excel data into Oracle table using Toad.
Please let me know the steps, how to do that. Thanks
try the following methods
METHOD 1: Click Tools → Import → Import Wizard. This window can be used to import data from various kinds of source files into a table.
METHOD 2: SQL*Loader You can use TOAD's interface to a program from Oracle called sqlloader. Save the Excel file as a comma-delimited (.csv) or tab-delimited (.txt) file. If your data has commas within a text field, save your file as tab-delimited.
Open DBA→Sql Loader Wizard
Choose "build a new control file". Next.
Click "Add". Choose your comma-delimited or tab-delimited file. Next.
Click "Add". Choose your table.
If you are loading a comma-delimited file, type a comma in the "all fields delimited by" combo box. If you are loading a tab-delimited file, select "TAB" from the "all fields delimited by" combo box. Next.
Choose a "load method" noting the following:
TRUNCATE will erase whatever is in the table before loading.
INSERT will insert data if table is empty but will return an error if table has any data in it.
APPEND will insert data without deleting any existing data. You might get duplicates this way but it's a good method if you're trying to get that last line that somehow got munged for some reason or another.
If your file has column headers in its first row, type a 1 in the skip box. Next.
Type a control file name in the control file name box. Next.
Choose either "execute now" to load the data now or "just build the control file" to build the .ctl file. Once you have the ctl file theoretically you don't even need TOAD, as you could just use sqlloader on any machine that has sqlloader and can connect to the database. But why would you want to. :) I choose execute now.
Note: If you are working with Oracle 8.0 or earlier on a Windows 2000 or later OS, uncheck "Watch Progress"
Note: once you have a ctl file you can:
Choose DBA→Sql Loader Wizard
Choose "Use control file". Next.
Select your control file. Next.
Choose "execute now". Finish.
Menu Database then Import and Import Table data.
You have to select the table where are you going to import and then, the more easy way, import from Clipboard (so before proceed to import just ctrl+c your cells in excel).
Usually I copy also the header row, it helps me in checking if columns are matched well.

Resources