How do I UPDATE a row in a table or INSERT it if it doesn't exist?

I have the following table of counters: CREATE TABLE cache ( key text PRIMARY KEY, generation int ); I would like to increment one of the counters, or set it to zero if the corresponding...

PostgreSQL: Modify OWNER on all tables simultaneously in PostgreSQL

How do I modify the owner of all tables in a PostgreSQL database? I tried ALTER TABLE * OWNER TO new_owner but it doesn't support the asterisk syntax.

How can I read MYSQL Database from Android?

I want to read a data from MYSQL database via PHP, JSON from Android. I've been trying many different examples, but my Android phone wasn't able to read any data. When I run the application my...

SQL Server: "a connection was successfully established with server....existing connection was forcibly closed by the remote host."

Yes folks, it's this one again. "A connection was successfully established with the server, but then an error occurred during the login process (provider: TCP Provider, error: 0 - An existing...

display data from SQL database into php/ html table

I have a database on MySQL and I want to display one of my SQL tables on a HTML or PHP table. I have searched online and cannot implement this feature. Could someone please help me with the...

how to change the collate to all the columns of the database?

I would like to change the collation of all the columns of all the tables of my database. In stack overflow, I have found this script: (post) SELECT 'ALTER TABLE [' + SYSOBJECTS.Name + '] ALTER...

How do you create a "reverse pivot" in Google Sheets?

I am trying to produce a "reverse pivot" function. I have searched long and hard for such a function, but cannot find one that is already out there. I have a summary table with anywhere up to 20...

Entity Framework async operation takes ten times as long to complete

I’ve got an MVC site that’s using Entity Framework 6 to handle the database, and I’ve been experimenting with changing it so that everything runs as async controllers and calls to the...

The binding status was "DT_NTEXT". The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION"

I have the following query in Access: SELECT Field1, Field2, Field3, "2015" As TestYear FROM Table1 I use this query in SQL Server Import/Export tool to get data from Access database into SQL...

comparing a input string to string in a database

I'm studying Android studio and started with databases this week. I would like a little help with this app. It is simple. The user enters a string and presses a button in the first activity. This...

pandas.to_sql with new columns to existing table, add automatically new columns?

I want to write a dataframe to an existing sqlite (or mysql) table and sometimes the dataframe will contain a new column that is not yet present in the database. What do I need to do to avoid this...

Create column with duplicate data in same table psql

Postgres database I'm trying to find a faster way to create a new column in a table which is a copy of the tables primary key column, so if I have the following columns in a table named...

Use AJAX in CodeIgniter to write data to a file and return its success/failure

I am trying to make a very simple php chat for my website with CodeIgniter and Ajax. The messages are saved in a html file, not in a database table. Whenever I click the send button, the page...

Spring Boot exception "java.lang.IllegalArgumentException: Not a managed type:"

Using IntelliJ IDEA, I connected to a MySQL database so that I will be able to use the tables as classes. With a module I've done that. But when I am trying to run an empty Controller the...

Spring how to limit requests by ip from exact controller

Is there any easy way to limit the requests from an exact Spring RESTful controller by IP address? For example: @RequestMapping(value="/user/create",method = RequestMethod.POST) I would like to...

Correct way of streaming a CSV of unknown size from memory

I have a database that has a table with just over 2 million records of about 20 columns. The user is able to query the database and limit the number of records returned so the recordset may be...

How to split .csv into multiple .csv by columns using R?

I have a huge .CSV file with more than 3000 columns and need to load these into the database and because the table limitation is 1024 columns I want to split these .CSV files into multiple files...

(C++) Writing a database in HDF5

Hello this is my first time with HDF5, I am trying to create a database table using a manually created dataset. The File is already created and it is deployed, however everytime I try to insert a...

Is ASP.NET Core Identity needed for Intranet app using Windows Authentication

Using Windows Authentication in an Intranet web application I want to achieve the following: Gather additional attributes from AD (name, employee number) Gather additional attributes from a...

Permanently delete unused / orphaned files in Drupal 8

We had some serious mistakes in a PDF uploaded to one of our websites. But after "deleting" it from Drupal, it is still accessible through direct links. Drupal doesn't seem to delete it on its...

Add autoincrement column that is not primary key Alembic

I want to add a column that is autoincrement that is not primary key to an existing MySQL database. The command issued on the server required for this operation is the following: ALTER TABLE...

Dexie.js index lost on reload

I have an Electron app that uses Dexie.js on top of IndexedDb. Following the instructions here for Typescript, I've subclassed Dexie and am defining my Db in my...

How to create and login a frontend user (feuser) in typo3 manually/programmatically?

I want to create and login a frontend user in typo3 and I should be able to see user logged-in in login form. FYI Users are getting added to fe_user table in database but are not getting logged...

How to determine if a table has Timescale enabled and on which columns?

I have a Timescale database that someone else created. How do I determine if create_hypertable was called on a table ? For now I use this, but there must be a better way: SELECT * FROM...

Flask-SQLAlchemy SQL Server Using strings as primary keys

I'm building a webpage which uses SQL Server as the database + Flask for the web framework. I want to be able to add users to my webpage, and created a SQLAlchemy class as below: from datetime...

flask db init leads to "KeyError: 'migrate'

I created already a database and added 2 tables (venue, artist). This is a party from my app.py: import json import dateutil.parser import babel from flask import Flask, render_template, request,...

How to pass object to modal dialog in Thymeleaf?

I have a thymeleaf page that shows database content (persons) in a table. <tr id="tableBody"> <td th:text="${row.id}"/> <td th:text="${row.firstname}"/> <td...

Keyerror 'include' on migrating models to sql server

I have a django application and have backend as Microsoft sql server. For that, i have installed "pip install django-mssql-backend". I have extended User model and added one additional field of...

How to create Table and Ingestion Mapping in Azure Data Explorer via PowerShell or ARM Template

We want to automate the creation and setup of our Azure Data Explorer Cluster. Provisioning the Cluster and creating a database is no problem via ARM Templates. Creating a data connection to...

Problem with inserting records and the for loop. Only a few records are saved in the database, not all of them

After a successful scraping (only and exclusively for study and personal purposes), I try to insert the records into a database. But I have a problem: not all records are inserted in the database...