Questions tagged [qsqlquery]

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

QSqlQuery encapsulates the functionality involved in creating, navigating and retrieving data from SQL queries which are executed on a QSqlDatabase.

Documentation can be found here.

417 questions
0
votes
2 answers

Can I use SQL injection to alter server db?

I need some help please. Say I used sql injection methods to get the database name of a website, and managed to get all the data from the tables, is it possible to alter that data without having to identify on the server using a basic sql…
Zee
  • 824
  • 11
  • 25
0
votes
2 answers

converting rows into columns in sql

How to query to get following result...?!! table 1: MainID col1 col2 1 qq qq 2 qq qq 3 qq qq 4 qq qq 5 qq qq table 2 MainID lineNo Text 1 1 price 1 2 …
Murali Uppangala
  • 884
  • 6
  • 22
  • 49
0
votes
2 answers

QSqlQueryModel dont can open database

When i will view the data from my mysql database " mydb " , from the table "testtable", it cant open the database. this->model = new QSqlQueryModel(); meineView->setModel(model); must i write it so : model->setQuery("SELECT id,…
thelittlePanda
  • 101
  • 2
  • 10
0
votes
3 answers

QSqlQueryModel with a parent - app crash

I am rather new to Qt, maybe that's why I cant fully understand the child-parent concept. I need to perform some sql query. I set the QSqlQuery, perform the "prepare and bind" operation and exec it. Next I pass it to the model and display the data.…
murison
  • 3,640
  • 2
  • 23
  • 36
0
votes
1 answer

How to find specific database on a server

I am trying to locate one database from my database server. I have 22 different databases on the server. I am using: select [name] from sys.databases But this returns all the 22 names. I only need a specific one called "LightBulb". Anyone knows by…
Victor_Tlepshev
  • 478
  • 6
  • 19
0
votes
3 answers

Do not get result for all sqlite pragmas via QSqlQuery

I want to get the current states of sqlite pragma using Qt's QSqlQuery. But I do not get a result for some values from the program but from sqlite console. Qt version 5.2.1, Sqlite version 3.8.4.3, Windows 7, Ubuntu 12.4 LTS Output: …
Th. Thielemann
  • 2,592
  • 1
  • 23
  • 38
0
votes
1 answer

MySql full text search to consider extra s es

I need a full text search query to search a word, also it should consider extra s and es at the end. If I put * at the end it matches with lot of extra characters as well which are not needed. eg; select item_description from…
Ashish
  • 402
  • 2
  • 6
  • 15
0
votes
2 answers

Fetch data from two different tables in one query

On my webserver there is a database with following two tables: tbl_Friend tbl_Colleague | id | Name | First name | Place | | id | Name | First name | Place | ---------------------------------- …
Cilenco
  • 6,951
  • 17
  • 72
  • 152
0
votes
2 answers

two sql query mix for one

I want to combine two pieces of code into one, but I'm getting an error: Part 1 SELECT idstd,namestd, idmajor, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10,c11,c12, c13,c14,c15 FROM (SELECT status, idstd,namestd, idmajor, …
0
votes
2 answers

how to push the one value to last in list of value combo box

I am having one combo box in that I need value in order by alphabetic.but problem is In that list OTHER one value need to come at last. we can achieve this using value number arrange according to our need but it contain lot of value and using the…
Nanda
  • 81
  • 2
  • 9
0
votes
2 answers

Fails to DELETE a statement with GROUP BY and HAVING clauses

I'm trying to delete some records through the following SQL statement but i'm getting the error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY…
peris
  • 943
  • 3
  • 20
  • 33
0
votes
1 answer

Why QSqlQuery query.next() return false

Why query.next() returns false, when query.isSelected() and query.isActive() return true. And datas for column numbers and index of EventNote are correct. Here is the code: QVector DataBase::GetEventNote(int eventId) { QSqlQuery…
0
votes
3 answers

sql query search into two tables, performance issue

I have two tables (I'll list only fields that I want to search) MySQL version: 5.0.96-community Table 1: Clients (860 rows) ID_CLIENT (varcahar 10) ClientName (text) Table 2: Details (22380 rows) ID_CLIENT (varchar 10) Details (varchar 1000) The…
PuiuCristian
  • 163
  • 9
0
votes
2 answers

Weird results NOT IN with NULL query in SQL

Can any one explain to me why I'm getting different results: Table2.Table1ID nullable field SELECT * FROM Table1 WHERE ID NOT IN (SELECT Table1ID FROM Table2) no results SELECT * FROM Table1 WHERE ID NOT IN (SELECT Table1ID FROM Table2 WHERE…
cinek
  • 1,888
  • 2
  • 13
  • 14
0
votes
1 answer

How to query a local QSqlQueryModel?

I am displaying a QSqlTableModel in QSqlTableModel::OnManualSubmit mode. I want to run SQL style queries on my local copy, for example I have a getMax function that changes as I add new rows. If my user locally changes the QSqlTableModel during…
Mikhail
  • 7,749
  • 11
  • 62
  • 136