We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [csv]

Questions on how to import into, extract data from, or exchange data between databases in CSV format (plain text using commas to separate values).

Filter by
Sorted by
Tagged with
0
votes
2answers
24 views

How to automate the detection of the column type of a csv file for a table creation script?

I am new to pgAdmin and Azure database. I have a huge csv file with around 220 columns and I want to create a table out of it in pgAdmin4 to push it to Azure. However I don't know how to detect ...
0
votes
2answers
24 views

How to create a csv with SQLCMD which can be imported into another database system

I may be doing this all the wrong way so please point me in the right direction if I am missing something. I have an Ubuntu server with SQLCMD installed and a Windows Server with a MSSQL database. I ...
0
votes
1answer
40 views

How to add multiple query results into one csv file?

By the help of the members of this community I have created a script which shows recent T-log backup for each database in the server. Instead of sp_MSforeachdb I used a customized script written by ...
0
votes
0answers
29 views

Collect a column as CSV in GroupBy

I have this schema: Result Story: BILL_INFO has all bill headers. There is a business process called Deposit that occurs once a day: BILL_INFO are updated with a DEPOSIT_ID from DEPOSIT_INFO table ...
0
votes
0answers
28 views

Import folder with Multiple CSV's into SSMS w/ out SSIS

I am wondering what's the best and most effective way to import csv's stored in a local folder into DB w/ in SSMS. Folder path- C:\Users\ngutierrez\Desktop\Open_Air_Tables Folder contains about 30 ...
0
votes
0answers
8 views

Allow only import table in phpmyadmin

We build a wordpress site as a database interface in localhost (only). We are using a plugin WpDataTables to display tables, statistics etc. Is it possible to expose somehow only the import option of ...
1
vote
1answer
108 views

exporting a sql view to a csv file

Whilst I can just about script to pull data via queries, I'm finding it very difficult to figure out how to export the results of a query to a .csv file and save in a network storage location (novice ...
0
votes
0answers
50 views

Errors with trying to run a stored procedure with local file output

I'm trying to run a stored procedure that I'm passing some variables to. The output is being writted to a CSV file on a local file share. The CSV file gets created, but I'm hitting some errors ...
-1
votes
3answers
89 views

Sub-select from comma separated list in WHERE clause

I have tables like so: TableA id id_link_list 1 1,2 TableB id info 1 blah 2 blah-more I'm struggling to include the TableA.id_link_list column (which is already a comma ...
-1
votes
1answer
176 views

Importing CSV file into a PostgreSQL table

I am using Python with pandas to import a CSV file into a table in Postgres import pandas as pd import psycopg2 from sqlalchemy import create_engine df = pd.read_csv('products.csv', sep=';', ...
0
votes
3answers
295 views

Extracting data from extremely large csv files [closed]

I have a 40gb csv file with over 60 million rows for data analysis. Each row has a unique identifier (some numbers). For example, the first row's unique identifier will repeat approximately 150,000 ...
0
votes
0answers
16 views

RDDs, Maps and Apache Spark

I have been playing around with Apache Spark, firstly I learned PostgreSQL and I have a few queries that I needed to run on Spark. I managed to run them as SQL Strings in Spark SQL, but now I have to ...
0
votes
1answer
27 views

Best practices for storing multiple SQL tables per user (built from uploaded csv file?)

I have a few users who will be uploading a few types of predefined CSV files. I need to store these as sql tables to be able to run queries on this data for a particular user, however that means there'...
1
vote
0answers
15 views

Custom Export from power BI service

I'm trying to make a custom button that exports filtered tables to a csv and downloads them to my computer. I am aware that you can do this with the '...' button but this functionality is for other ...
0
votes
0answers
36 views

Can I force a LOAD DATA LOCAL statement to abort if an error is not loaded?

I am trying to load a CSV file into a MySQL table with the load data local statement. After loading it, the statement reports Query OK, 1030 rows affected, 7314 warnings (0.03 sec) Records: 1043 ...
0
votes
0answers
87 views

Writing CSV directly to a BYTEA column from PostgreSQL tables

Assuming these two tables: CREATE TABLE data (day DATE, kpi INTEGER); CREATE TABLE reports (csv BYTEA); Is it possible to (pseudocode): INSERT INTO reports (csv) (SELECT to_csv(SELECT day, kpi FROM ...
1
vote
1answer
60 views

InfluxDB batch insert only inserts the last line

I'm trying to insert some lines into a InfluxDB instance (running on Windows 7 x64) from both a .txt and a .csv file, but it's only inserting the last line on the file. I'm currently using the ...
0
votes
1answer
20 views

Load flat file into a predetermined table

Scenario Table created Data in flat file loaded to the table but with errors. please advise how to fix it (a) 'address' is split to 3 columns causing mismatch between the source and destination (b)...
-1
votes
1answer
235 views

How to normalize CSV invoice data?

For flat data which comes in with fields like: name address status class version user mode CSV files are regularly received, with the above as typical columns. ...
0
votes
2answers
600 views

MongoDB CSV Export: One Array/Column & Array Index on rows, or vice versa

I have a MongoDB schema that looks like this: const batchSchema = mongoose.Schema({ _id: mongoose.Schema.Types.ObjectId, time: {type: [Number]}, tmp: {type: [Number]}, hum: {type: [Number]}, ...
0
votes
1answer
32 views

csv engine and mysql start

my question is about speed when perform service mysql start. with many tables (some not often used). what engines consumes more or less start time ? example: innodb --> the more tables, the more ...
1
vote
1answer
103 views

\COPY not returning count psql

I am trying to copy CSV data into tables. Also I want to print the count. The command I'm using is: echo "begin; delete from a; \copy a from a.csv CSV HEADER; end;" | psql -hlocalhost -dpostgres -...
2
votes
2answers
809 views

Can't import flat file into SqlServer

I've got this tab-delimited flat file with fifty columns and two million rows. I am trying to import it into Sql Server 2017 Express. (I first tried working with it in Excel... hopeless.) I see two ...
0
votes
0answers
161 views

MySQL automatic import of (huge) csv files fails using mysqlimport

For testing purposes, I have to insert large Time Series data on a MySQL database, running on a Windows remote server. Firstly, the (very basic) table: CREATE TABLE 'sensor_data' ( '...
0
votes
0answers
34 views

mysql: make the server fail instead of just giving warnings

I have a mysql 5.7 server. I am trying to import some .csv files. Sometimes it may so happen that these are malformed. Here is a sample case: - 'mysql: [Warning] Using a password on the command ...
1
vote
2answers
1k views

postges: psql csv import fails although file exists

Trying to import a csv file as follows: psql -h 127.0.0.1 -d jira_statistics -U admin -p 5432 -c "COPY bugs FROM '/home/centos/bugs.csv' delimiter '|' csv;" Password for user admin: ERROR: could ...
0
votes
1answer
125 views

csv import fails without throwing an error

Ι am trying to import a csv file into an existing mysql 5.7 table. Here is the command (the db is in docker with bind mount for persistence) mysql -h 127.0.0.1 -uroot -prootpass --local_infile=1 ...
0
votes
2answers
3k views

foreach loop in sql scripts?

In powershell I use foreach to run a function through a list of targets. I was wondering that if there is any thing similar to foreach in sql, so I can run the same query through multiple DBs I chose ...
2
votes
0answers
47 views

How To Query Databases in Subject-Predicate Format?

I have csv data in this format: id fieldname fieldvalue -- --------- ---------- 1 fieldA A1 1 fieldB B1 2 fieldA A2 2 fieldA B2 If I upload this to MySQL, how can I ...
0
votes
3answers
601 views

Leading zeros are truncated when I spool to CSV

I have spooled a file to CSV using sqlplus. Everything works great but there is one issue. I have mobile numbers which start with 0, for example 04589 and 02586. After the spooling is complete, 0s ...
0
votes
1answer
105 views

listagg in order and including a sequence of separator when missing any row of a sequence

Sorry for the long title but it's a little bit difficult to explain. We have a table | N rows | Atrib1 | Atrib2 | Atrib3 | Atrib4 | Final row | --------------------------------------------------...
0
votes
2answers
427 views

SQL Server Agent - Do not show job step details and column headers in output file

I have a SQL Server Agent job which runs a select statement on a schedule and appends results to a CSV file (Right click the job --> properties --> advanced and then adding a file path to the output ...
1
vote
1answer
4k views

How to automate CSV-exports of queries in PL/SQL Developer (Oracle)?

I'm no pro in Oracle or PL/SQL Developer (I mostly use and admin mySQL and MS SQL Server). I'm not an admin of any sort, but have read access to many tables in Oracle via PL/SQL Developer. I need ...
5
votes
2answers
960 views

How to import CSV file in SQL server 2008?

I am trying to import a CSV file in SQL Server 2008. BULK INSERT is a way to go but it is applicable for CSV from SQL Server 2014 onwards. What would be an alternative way to achieve this goal? Any ...
-1
votes
1answer
386 views

Copy in SQL with index vs without index

Recently I have received a data dump in csv format that I am trying to import in my PSQL database. The dump consists of 8 csv file each of size 7GB. I have found that using the Copy command on one ...
2
votes
1answer
139 views

Handling variable fields in a CSV file with JSON?

Im trying to figure out the engineering to get a CSV file into PostgreSQL. Requirements: The CSV has X number of predetermined required fields The CSV file has Y number of dynamic fields Example: ...
0
votes
4answers
275 views

SSIS deployment failed - working with files

I've developed a simple SSIS package that will open a csv file, select a number of column, add two derived columns and then copy the results to a file. This works within visual studio (even if it ...
0
votes
1answer
1k views

Upload multiple csv file to multiple tables sqlServer

I have over than 200 csv files that each of them is diffrent table. I create now a new DB and want to upload them all so I will have all the table. I not accessable to old DB to backup in diffrent ...
-3
votes
1answer
375 views

Bulk Insert csv file error [closed]

I am trying to BULK INSERT a csv file to my SQL Server. Using code I found on this SO question, I ran: BULK INSERT Temp FROM 'c:\csv\student.csv ' WITH ( FIELDTERMINATOR = ',', ...
1
vote
1answer
466 views

How to upload multiple csv files to sql server without constrains

I backed up an old SQL Server DB with .CSV files for each table. The old DB is now gone; the .CSV files are all I have. Now I want to create new DB and upload all those csv file (my old db removed) . ...
2
votes
1answer
97 views

How do I bulk load data and still provide row-by-row feedback?

We want to allow our users to import CSVs containing many thousands of records to "pre-load" a particular table in our system. It's not strictly a one-time operation, it may be performed multiple ...
2
votes
1answer
441 views

postgresql - Importing CSV Data with Custom Type

I'm mostly a newcomer to databases and am building a postgres database of student achievement in a series of courses. My database uses a type called "class" that consists of the course, the academic ...
2
votes
2answers
1k views

How to dump to csv valid json with Postgresql?

I am trying to dump some data as json with: \copy (SELECT json_build_object('areaSqft',area_sqft, 'titleNos',title_nos, 'buildingIds',building_ids, 'geometry',geom_json) FROM my_data) to my_data.csv ...
1
vote
2answers
159 views

How to split a string on every 2nd delimiter?

I have curves consisting of X/Y points (an array?) stored in a string with the same delimiter. There is 1 curve per row. Below is a simple example: 0,0,1,1,2,1.9,2.9,2.8,3.6,3.5 I want to extract ...
0
votes
1answer
472 views

Set columns dinamically in UTL_FILE

I've been stuck with this problem, so I'm looking for help now. I'm trying to get a .cvs file from a query with PL/SQL. I'm using a cursor and UTL_FILE to achieve that. The problem is that I have to ...
0
votes
1answer
384 views

Finding Columns causing errors in SQL Developer

I'm relatively new to Oracle SQL and trying to import CSVs using SQL Developer. I've been getting errors such as Insert failed for rows 1351 through 1400 ORA-01438: value larger than ...
0
votes
2answers
526 views

How to connect from local computer (mac) to remote Oracle DB and execute script and save results to CSV?

I can connect to remote Oracle DB using this signature: sqlplus 'user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))' Now want to ...
-1
votes
1answer
433 views

Export only certain column on single table to csv format

I need to export certain column only of a database table to csv file. Here is the format of the source: ID | user_email | user_login | user_nickname | usergroup | address | user_registered | ...
1
vote
1answer
513 views

Oracle XMLAGG issue with combining cells that have comma separated values in cells

Have a situation where I'm trying to use xmlagg to get: | ID | name row1 | 1 | apple row2 | 1 | apple,pear,banana row3 | 1 | apple,banana row4 | 1 | pear,banana,orange row5 | 2 | orange ...
0
votes
2answers
5k views

how to import a huge csv file into Cassandra?

I am trying to import a csv file into Cassandra which is very long. These are food products: ingredients, nutrition, labels... It comes from Open Food Data. List information on food products: ...