1,953 questions
-1
votes
1
answer
158
views
Why must key columns of a Doris table be placed before other columns?
The create table statement in Apache Doris is confusing to me. I want to create a table, but I must put the key columns before other columns, otherwise I will get an error.
I will follow this rule, ...
0
votes
1
answer
50
views
Error "[E-238] Too many segments in rowset" in Apache Doris
When I execute 'ctas' statement in Apache Doris, I get the error below:
[E-238] Too many segments in rowset
the detail SQL is:
CREATE TABLE MY_DB_NAME.MY_TABLE_NAME AS
SELECT T1.DATA_DATE AS SDATE, ...
0
votes
2
answers
121
views
What does the "KEY" keyword used by itself do?
I'm using SQLite 3.40.1. The documentation does not mention the KEY keyword used without PRIMARY, but I am able to create tables with a column of attribute KEY:
CREATE TABLE junk(a INTEGER PRIMARY KEY ...
0
votes
1
answer
34
views
Django - ValueError at /selected-events/ Cannot assign ... must be a "Profile" instance
I have a Django project that consists of, essentially, 3 datasets: auth User (plus a Profile dataset), mem_ev and Events such that User --< mem_ev >-- Event, ie a classic many to many ...
1
vote
1
answer
71
views
Can I use a sequence in a create-table definition in PostgreSQL? [closed]
I am trying to write a PostgreSQL script that meets the following requirements:
Create a table with two columns, Id and Id2, which must always have identical values when a record is added to the ...
0
votes
1
answer
36
views
R DBI dbSendStatement not working for CREATE TABLE
Reading through the reference material-
https://dbi.r-dbi.org/reference/dbSendStatement.html
Is there are reason the below code doesn't create the temp table?:
if (!require("pacman")
) ...
-1
votes
1
answer
84
views
How to make a column in a table with a float value in SQLite?
I'm making a table in a database, and one of the columns needs to store a float number. However, I keep getting an error under the name of the float value when I ask my SQLiteDatabase to create the ...
0
votes
0
answers
151
views
ssms 20.1 tasks/generate scripts fails
running ssms 20.2, selecting database, right-click, choosing tasks then generate scripts. I select tables I want scripted and get a message that script generation failed and I am instructed to click ...
4
votes
2
answers
2k
views
How to create a PARTITIONED table in Python using PyIceberg with pyarrow
business_time
value
2024-06-29 05:00:03.287073252+00:00
1.3
2024-06-29 11:00:03.504073740+00:00
1.4
I am trying to create a partitioned table using the python code from the given DataFrame (see above)....
-1
votes
1
answer
53
views
Error while creating a table joining two tables in pgadmin
I have two tables one is customer data, and the other is geography data which has a common field geography key. I joined the two tables using the following query:
SELECT c.*, g.*
FROM customer AS c
...
0
votes
1
answer
38
views
Converting DDL MasterFile table to SQL Server table, How do I write in missing data?
I am working on converting DDL master files to SQL Server tables, and every one of them have MISSING=ON in the file, which I am interpreting as "if missing then make aware" sort of thing. ...
0
votes
1
answer
79
views
Oracle DB - Create Table As - causes "ORA-01489: result of string concatenation is too long"
I found a weird behavior in a stored procedure that works 99% of the time fine for historizing a standardized report into our Oracle Database.
For some reports I get the error ORA-01489: result of ...
0
votes
1
answer
88
views
What is the correct syntax for creating a table name as variable?
The user can generate a table to rank songs. It checks if there is a ranking system for the user already, if not it creates a new table. I want the name of the system to correlate with the user id.
@...
-1
votes
1
answer
270
views
Why does my CREATE TABLE statement return an "incomplete input" error?
The cursor returns an error.
main.py:
def initialize_database():
conn = sqlite3.connect('PostsData.db')
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS posts (
...
3
votes
1
answer
184
views
Using CREATE TEMPORARY TABLE with pandas
I am trying to create a temporary table or drop a table in MySQL using SQLAlchemy in Jupyter notebook. The SQL function does create table or drops the table but it results in an error
...
0
votes
1
answer
408
views
Failed to create table in bigquery
After downloading a particular dataset name movies from my Coursera studies hands on activities for my BigQuery exercise, then trying to create table before cleaning the dataset i got an error message ...
0
votes
1
answer
801
views
Is there a way to automatically generate a script in Azure SQL containing the create instructions for every table in the database
I have an existing data base in Azure that I need to replicate in another Azure database as External tables. To this end I need to make a script that creates all these 200+ tables.
I’m looking for a ...
0
votes
1
answer
190
views
sql Alchemy models inheritance
I use Python and SQLAlchemy 2.0.23. My aim is to dynamically create SQLAlchemy models and tables in postgre database based on these models. I have several countries, and these are similar tables for ...
2
votes
1
answer
2k
views
user cannot create table on schema public Postgres 16
I have to create a table in Postgres public schema for Airflow implementation. When I create a table with airflow user I get this error
permission denied for schema public
LINE 1: CREATE TABLE public....
1
vote
1
answer
84
views
Cannot generate random uuid syntax error at or near uuid_generate_v4
I want to generate a random uuid but I got the following error:
ERROR: 42601: syntax error at or near "uuid_generate_v4"
LINE 2: id UUID uuid_generate_v4() PRIMARY KEY,
Here is my SQL ...
1
vote
1
answer
91
views
Calling companion table in Kotlin
How create various tables in Kotlin
I am upgrading from Java to Kotlin, and I need to create several tables in a DB, first I create a companion object and define the table, in the DBHelper class, I ...
0
votes
2
answers
889
views
Upload and Create a table from a csv file in BigQuery
I have tried to create a table within a dataset that I already created and saved, the first csv file was uploaded successfully, but the second one I tried it shows the following error when I clicked ...
0
votes
2
answers
61
views
how can I display the create statement of a table in a database I am accessing?
I have a database with a table that I can see the data but I need to see the create statement which created the table. I can do this in SQL server but dont see how in Snowflake.
I tried right ...
0
votes
1
answer
102
views
Laravel Livewire form: no action on create button click
In Laravel Livewire, nothing happens when I click the "Create" button on the form.
namespace App\Livewire\Components;
use App\Models\ProjectLists;
use Livewire\Component;
use Livewire\...
0
votes
1
answer
564
views
Facing error when uploading file given in a coursera course
I am in the middle of a course in coursera (Google Data Analytics)titled: "process Data from Dirty to Clean". In this course's 3rd module they gave a CSV file to upload in BigQuery to create ...
0
votes
1
answer
411
views
Create Table Postgres in new schema does not complete
When trying to run a simple create statement in a new schema within postgres (healthcare), the query never finishes. My question is why?
CREATE TABLE healthcare.admission_source(
...
0
votes
0
answers
156
views
Issue with CREATE UPDATE TABLE in MSSQL with db_ddladmin permission
I can't Update or Create tables within Visual Studio 2022 and SSMS, till now I was able to do everything, I didn't change any users etc. just from one minute to the other, the button Update has been ...
0
votes
1
answer
86
views
MySQL Key Column does not exist in Create Table
When I issue this command:
CREATE TABLE userxxx(
idxxx INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (idxxx)
) Engine=InnoDB;
I get the error: Key column 'idxxx' doesn't exist in table. Should ...
-1
votes
1
answer
115
views
Save results of the union all statement into either a separate table [duplicate]
I want to save results of the union all statement into either a separate table or the H(alf)1 table. I have tried create table and insert into but there is some syntax error I can't seem to figure out....
0
votes
1
answer
105
views
sqlalchemy creating table and column but not rows
I am struggling with an minor issue that I am trying to create a table into MySQL using Python sqlalchemy, which crates table into the database not did not inserting rows into that. Below is the code. ...
0
votes
1
answer
630
views
Need to create a column name which displays current month end
I have a requirement to create a column name in snowflake such that it displays the current month end date. It should change dynamically every month.
Expected table structure.
Tablename:- sample
...
-3
votes
1
answer
543
views
How do I make two foreign keys a primary key?
My table MealIng has two foreign keys from two other tables that I want to make primary key. How do I specify this?
This is my code. What do I need to change to get this to work?
CREATE TABLE Meals (
...
0
votes
2
answers
616
views
Can't insert external table data into table in synapse dedicated sql pool
In Synapse dedicated pool, I'm trying to create an external table, and a dedicated table, and then insert the external table into the dedicated table but I keep getting the following error:
Explicit ...
0
votes
1
answer
2k
views
Include filename and path in external location when creating a table in Trino
I have a S3 bucket named test-bucket with the following structure
- test-bucket
- surveys
- abc.json
- def.json
[...]
Now I create a table in Trino like this
create table hive.qual2....
0
votes
2
answers
805
views
What is the point of creating table with no data in SQL?
I'm looking at somebody else's code and they've got about 200 lines where they use CREATE TABLE with a SELECT STATEMENT, just to finish it with the statement WITH NO DATA
And then directly underneath, ...
0
votes
3
answers
990
views
Creating table from csv using sql query
I was creating table name "tripsdata" in SQL query tool, which is done successfully. Now I have to insert values into the table and I used the below syntax :
LOAD data INFILE 'tripsdata.csv' ...
0
votes
1
answer
540
views
How to add a new table to database on plugin activation in WordPress
I Tried to create table in database with the help of register_activation_hook() but its not working....
function my_plugin_activation(){
global $wpdb , $table_prefix;
$wp_emp = $table_prefix.'...
0
votes
1
answer
110
views
Have troubles with writing a procedure on PL/SQL
So, basically, I need to create a procedure that takes names of two tables as parameter, then creates a new table, in which foreign keys are connected with primary keys of tables from parameters.
What ...
0
votes
0
answers
994
views
The clickhouse cluster cannot create any tables
Code: 107. DB::Exception: There was an error on [ck1:9000]: Code: 107. DB::ErrnoException: Cannot open file /data/clickhouse/store/76b/76b93482-a138-42fc-9969-e608641273be/zxc_sig.sql.tmp, errno: 2, ...
0
votes
0
answers
63
views
what is the Proper way to insert json into postgresql table?
My json file looks something like this:
[
{
"id": 1,
"date": "2023-02-09",
"homeTeam": {
"id": "3",
"players&...
1
vote
1
answer
100
views
CHECK constraint matching beginning of value
We are using sqlite3 for a database and ensuring values inserted into a column matching a specific string would be useful in our case.
Example:
CREATE TABLE people ("firstname" TEXT),
CHECK(...
2
votes
1
answer
8k
views
How to combine multiple tables into one table in Big Query?
I'm trying to combine a couple of tables (i.e., 1 created able from Sep - Nov and another created table from Dec - Jan) into 1 comprehensive table of all of them in Big Query.
How could I do this?
1
vote
1
answer
73
views
Duplicate key name on property of a table being created on MariaDB
I just want to create a new table on my database, but doing so:
CREATE TABLE `houses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`room_id` int(11) NOT NULL,
`car_id` int(11)...
0
votes
1
answer
198
views
How to stop loading full JSON object into single field in AWS Athena
I am attempting to load JSON data from S3 into a table in Athena.
My JSON data looks like this;
[{"a":"a_value", "b":"b_value", "my_data":{"c&...
0
votes
1
answer
97
views
mariadb issue with create table select where the select is a union
I have a six-way union select that I am working with that is part of a PHP script. The command works fine in the script. In executing from the SQL client, the command also works fine. However, when I ...
1
vote
1
answer
562
views
PG11 : how can a user (not owner) create table in a schema without grant create on schema
I've been trying for an hour to understand why my odi role, which is neither the owner of the public schema nor the database, can create tables in this schema.
| | odi=U/eos ...
-1
votes
2
answers
619
views
Error while trying to connect PostgreSQL to the database?
I tried connecting my Postgres database Employees to a SQL Server, however, whenever I try, I get an error saying the request was ignored.
Trying to create database on sql server
I tried to create a ...
0
votes
1
answer
164
views
How to create the same table in 2 SQLite databases without typing schema twice?
I have SQLite databases db1 and db2. I need identical tables in each: publications. How can I write a .sql file where I don't need to duplicate create table? Something like this:
CREATE TABLE
IF NOT ...
0
votes
4
answers
103
views
Unique row no matter the column
Is there a way to make an entire row unique no matter what value the column is in?
So, if 1 is in col a, and 2 is in col b, then if you were to insert 2 into col a and 1 into col b an error would be ...
-1
votes
1
answer
90
views
Parse error: near "employee_id": syntax error [duplicate]
A foreign key is not created when a table is created, although a reference for it exists in another table
Table customers:
CREATE TABLE customers (
customer_id INTEGER PRIMARY KEY AUTOINCREMENT,
...