Questions tagged [fetchall]
165 questions
2
votes
1 answer
How can I speed up fetching the results after running an sqlite query?
As an answer on my question: Is it normal that sqlite.fetchall() is so slow? it seems that fetch-all and fetch-one can be incredibly slow for sqlite.
As I mentioned there, I have the following query:
time0 = time.time()
self.cursor.execute("SELECT…

Niek de Klein
- 8,524
- 20
- 72
- 143
2
votes
2 answers
Is it normal sqlite.fetchall() is slow?
I have an SQL query that selects from two inner joined tables. The select statement takes about 50 seconds. However, the fetchall() takes 788 seconds for only 981 results:
time0 = time.time()
self.cursor.execute("SELECT spectrum_id, feature_table_id…

Niek de Klein
- 8,524
- 20
- 72
- 143
1
vote
3 answers
Zend_Db fetchAll() to return values as keys, not as key => value
Is there a way to change the default functionality in Zend_Db fetchall() method, so that it doesn't return this:
[0] => 100000055944231
[1] => 100000089064543
[2] => 100000145893011
[3] => 100000160760965
but…

Osvaldo Mercado
- 960
- 3
- 13
- 24
1
vote
1 answer
How to only take 1 value in one row in fetchall()
Is there any way to take 1 value in fetchall() without displaying the other values?
import mysql.connector
import hashlib
#connect to database
cnx = mysql.connector.connect(
host = '127.0.0.1',
user = 'root',
password =…

Francis Laon
- 13
- 2
1
vote
2 answers
Is combining FETCH_OBJ And FETCH_ASSOC in PDO fetchAll() possible?
I am trying to migrate from mysqli procedural to PDO because my website was halfway, half in pdo, and the rest in mysqli procedural, now I want to shift to PDO completely. Here is an example of the code I run
$rowNum = 0;
foreach…

WIVINA ISILIMURA
- 11
- 2
1
vote
1 answer
Snowflake python connector error when fetching data - SSLError: HTTPSConnectionPool
I was able to connect to the Snowflacke database and ran queries in Python via Snowflake python connector.
The problem was when I was fetching data by cursor.fetch(), it gave me this error when I did not limit the queries:
SSLError:…

Wren
- 11
- 2
1
vote
0 answers
Bookshelf.js fetchAll() performance
I have +20k records in my MySQL table that uses InnoDB engine and utf8_general comparison.
When I am trying to fetch all the data using Bookshelf.js fetchAll() it takes around 6 seconds.
I tried using knex directly which takes ~200ms. Does anyone…

Rent0
- 11
- 1
1
vote
3 answers
Python and MySQL - fetchall() doesn't show any result
I have a problem getting the query results from my Python-Code. The connection to the database seems to work, but i always get the error:
"InterfaceError: No result set to fetch from."
Can somebody help me with my problem? Thank you!!!
cnx =…

D. P.
- 11
- 1
- 2
1
vote
1 answer
cursor.fetchall() brings only one row in Python with PostgreSQL
I am trying to create a training app in python to work with a database of movies, adding movie details via a text menu prompting user input for all fields (movie name, actors, company, etc.). I am using PostgreSQL as the database and import psycopg2…

Edmond
- 59
- 2
- 15
1
vote
0 answers
the most fast way to select/load data from mysql to memory/pandas
I have an application which do mysql reads intensively and usually it needs to read lots of data from mysql(e.g. ~100K rows one time); but i found it's very slow, especially when read it to pandas. here is what i tried:
option-1: pure…

dingx
- 1,621
- 3
- 20
- 38
1
vote
1 answer
Iterating the results returned from fetchall_arrayref
I have a sql wherein I am fetching few records, sorted by full name.
My requirement is to extract chunks of similar names and then do some operation on it.
Say, the sql returns some records containing names like [name1,name1,name2,name3,name3]
I…

Soumya
- 885
- 3
- 14
- 29
1
vote
2 answers
How do you fetch all rows with pdo?
I am making a blog and I want to fetch all rows using a pdo statement but no matter what I do only one row comes back even though there are two rows in my database.
Here's the code sample where I connect:

Babydoll
- 29
- 3
1
vote
2 answers
cx_Oracle: fetchall() stops working with big SELECT statements
I'm trying to read data from an oracle db.
I have to read on python the results of a simple select that returns a million of rows.
I use the fetchall() function, changing the arraysize property of the cursor.
select_qry =…

paolof89
- 1,319
- 5
- 17
- 31
1
vote
1 answer
Perl dbi (select) fetches empy strings in array
I have a perl script that connect to a postgres db and fetches a couple select statements that it runs on it. This output have the purpose to print in word afterword. While i was building my project i didn't notice something that happens with the…

achahbar
- 901
- 3
- 21
- 47
1
vote
1 answer
How to fetch data using PDO in the format [col1=>[col2=>col3,col2=>col3]]?
I have a MySQL table called bid_lvl_descs with columns bid_type, lvl, desc
Bid_type and lvl together are always unique, and desc for the purposes will be, but technically can be not unique.
Example data:
+----------+-----+---------------------+
|…

Moe Epo
- 92
- 9