Skip to main content

Questions tagged [qsqlquery]

The QSqlQuery class, part of the Qt framework, provides a means of executing and manipulating SQL statements.

qsqlquery
-2 votes
0 answers
41 views

QSqlQuery is not meant to be copied

I have defined a QSqlDatabase as follows: QSqlDatabase m_db; And use it repeatedly for each new query as follows: QSqlQuery query(m_db); query.prepare(querystring); success = dbquery(query,...
TSG's user avatar
  • 4,506
0 votes
3 answers
53 views

Identify first row with a condition

I have a table like this one: doc_num doc_lin doc_type DOC0001 1000 2 DOC0001 2000 3 DOC0001 3000 3 DOC0001 4000 1 DOC0001 5000 2 DOC0001 6000 3 DOC0001 7000 3 And I need to have a SQL view ...
Marco Vivian's user avatar
0 votes
1 answer
50 views

Is there an equivalent of sqlite3's executemany() in pyside6?

I am trying to read a csv into an sqlite database with Qt SQL (pyside6) but the method I have tried is far too slow. The sqlite3 module in python has an executemany() function which can insert ~1 ...
user15260458's user avatar
0 votes
0 answers
34 views

error closing the connection to the SQL database due to a query in Qt6/C++

my code outputs the error QSqlDatabasePrivate::removeDatabase: connection 'createRequestConnection' is still in use, all queries will cease to work. although there is not even a QSqlQuery query, I ...
zxctatar's user avatar
0 votes
0 answers
37 views

How to create a schema with tables in a single query with PyQT (using Postgres database)?

I'm building a GUI containing a button that creates a database schema with tables, I read the docs in PyQt about QSqlDatabase and QSqlQuery but it looks like it just runs the first line creating the ...
Fahd Jerbi's user avatar
-1 votes
1 answer
23 views

find device control character using sql query

I have data in table with string "BFCTADMG00MB00O7nX5" and I want a find the control or any special character through sql query Please help ? I have tried multiple things to get it but no ...
Vivek Potdar's user avatar
0 votes
1 answer
163 views

Combine Multiple Rows into One Cell Using SQL

Hello guys, maybe this is a basic SQL question. How can I combine multiple rows into one cell using SQL? Expected Result: Thanks in advance!
ÖMER's user avatar
  • 113
0 votes
1 answer
112 views

How to create a variable dependent column name?

I am struggling to name a column based on a variable. I want to create a column with a name including the stock symbol, for example Open_AAPL, Open_MSFT, Open_ORCL. I have tried the following to make ...
homelessmathaddict's user avatar
0 votes
0 answers
59 views

SQL query/view for -> KPI : Total revenue for each genre

Im still quite new to SQL and I cant figure out how to get the total revenue for each specific genre in my database. Relations between tables The problem is that I cant just use SUM(prijs) from the ...
sembae's user avatar
  • 1
0 votes
3 answers
454 views

KDB/q How to use qsql select statement to find item in list where type is empty list in a column of characters?

I have a table and passed it into a function where I use the primary ID to generate a column of characters. However, there are a few areas in this newly-created column where instead of characters it's ...
mmv456's user avatar
  • 23
0 votes
0 answers
55 views

SQL- Twitter First Five who tweeted

Problem Statement Write a Sql query to retrieve the usernames of the users who have tweeted on Twitter, ordered by the earliest tweet creation time, and limited to the first five users? Tables Schema ...
Nivedita Kamble's user avatar
0 votes
0 answers
21 views

Get the ID of inserted rows from QSqlQuery [duplicate]

I am using QSqlQuery to insert multiple entries in one query. I need to get the IDs of all elements that were inserted with my query : QString queryContent = "INSERT INTO table (field1, field2) ...
Mickaël C. Guimarães's user avatar
-3 votes
1 answer
78 views

Converting Tableau statement to SQL query for calculations

Good mortning, I tried to conver the statement in Tableau in SQL server, but I received an error.Could you help me how to return 2 values in the CASE statement in SQL based on certain criteria and ...
Jen's user avatar
  • 1
0 votes
2 answers
861 views

How to find entire string using typeORM, Nestjs, SQL Server, just like LIKE clause in mysql

I have database called Beta and table called Keys. In that table I have a column licenseKey: string. I want to find the entire licenseKey from the portion of licenseKey. Just like SQL below query: ...
Ronak Kansagra's user avatar
0 votes
2 answers
85 views

Default row values if returned row is blank

I have a sample query below: Select column1, column2, column3 from table1 where column1 = 3 and the result is blank Question: How to update the query that it will return this default result instead ...
Dion's user avatar
  • 59

15 30 50 per page
1
2 3 4 5
28