Questions tagged [fetchall]

The tag has no usage guidance.

fetchall
Filter by
Sorted by
Tagged with
-1 votes
0 answers
12 views

PHP fetchAll on JOIN [duplicate]

When I try to fetch from a query on a single table I get an associated array where Key is a name of column. But when I try to JOIN another table's columns on a query I get an array which only contains ...
15 votes
2 answers
33k views

PDO looping through and printing fetchAll [duplicate]

I'm having trouble getting my data from fetchAll to print selectively. In normal mysql I do it this way: $rs = mysql_query($sql); while ($row = mysql_fetch_array($rs)){ $id = $row['id']; $n = ...
0 votes
1 answer
3k views

TypeError: The view function did not return a valid response tuple. The tuple must have the form (body, status, headers), (body, status),

This is the pic of Mysql DB[Here is the code] https://i.stack.imgur.com/muX0s.png after this i am expecting Mathew to be the output but error is coming 2 https://i.stack.imgur.com/taUgq.png
0 votes
0 answers
56 views

pymssql, fetchall for table with many colnames couse error: (20047, b'DB-Lib error message 20047, severity 9:\nDBPROCESS is dead or not enabled\n')

I call pymssql, fetchall for table "CDN.Kontrahenci", and where I enter many columns names, as: "Knt_KntId,Knt_Kod,Knt_Nazwa1,Knt_Nazwa2,Knt_Nazwa3,Knt_Kraj,Knt_Wojewodztwo,Knt_Ulica,...
1 vote
3 answers
4k views

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] =>...
1 vote
1 answer
41 views

PHP PDO fetchAll only returning result on localhost

Ok I'm hoping someone can help me past this and I think it's gotta be something simple. I'm building a website using Apache, PHP, and MySQL. The code runs great on localhost, but not when I make a ...
0 votes
0 answers
118 views

Python. pymssql.fetchall() performance slows down when using Thread, threading

I have a problem that I just can't solve on my own. There is a Python script that looks something like: from threading import Thread import threading import pymssql lock = threading.Lock() global_list ...
0 votes
3 answers
3k views

pymysql connection select query and fetchall return tuple that has byte literals like b'25.00' rather than strings like '25.00'

I have a python script that runs fine when only connecting to my local test machine having MySQL 5.6database on Windows 8.1, using pymysql connection. Select query / fetchal() returns tuples like ('1'...
0 votes
1 answer
60 views

Why fetchall always results none?

I just need help to solve this, when I execute my code, the result of the fetchall is 'None', but these are the expected results (https://i.stack.imgur.com/OZL5R.png) this is my code def ...
1 vote
1 answer
169 views

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', ...
0 votes
0 answers
49 views

how to fetch request which has multiple queries inside using aiopg?

I use python aiopg package and want to group requests into big one using semicolons. I tried Cursor.nextset(), but it marked as "Not supported" It should be something like Query = ''' ...
0 votes
0 answers
99 views

PHP fetchAll() returning empty array

I have a prepared query with 3 result sets. I used fetch() for the first two since they only have one row each and they are appearing correctly in the View. For the 3rd result set, it consists of ...
1 vote
2 answers
196 views

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 ...
0 votes
0 answers
908 views

aiogram, fetch all from database and message in telegram bot by 5 rows with labeks

Good day,Everyone I am trying to build a telegram bot that fetchs all rows from database and shows message by 5 rows in tg bot with next page inline_keybord here is my code from aiogram import Bot, ...
36 votes
6 answers
58k views

python postgres can I fetchall() 1 million rows?

I am using psycopg2 module in python to read from postgres database, I need to some operation on all rows in a column, that has more than 1 million rows. I would like to know would cur.fetchall() ...
0 votes
2 answers
3k views

must be compatible with PDOStatement::fetchAll(int $mode = PDO::FETCH_DEFAULT, mixed ...$args)

Our client has a drupal website, but the host has forced all clients from PHP 7.4 to PHP version 8, causing a PDO fatal error preventing the site from loading. Error Received: Fatal error: ...
2 votes
2 answers
5k views

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....
0 votes
1 answer
239 views

Fetching data in Jupyter Notebook is taking too long

I want to fetch all rows from a table, using the following code: table_row_count = 1000000 batch_size = 10000 sql = """SELECT t.* FROM ( SELECT ROWNUM AS row_num, sub_t.*...
0 votes
0 answers
53 views

Making Messagebox show results

(using python) In my section "Def display_record():" I can not get the messagebox.showinfo(results) to pop up and show the result. The error I get is "Expected type 'str | None', got '...
1 vote
1 answer
2k views

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 ...
0 votes
3 answers
858 views

how handle a variable if it's returning none [duplicate]

Hi I have the following function to get sql from my template. variable row is fetching the query which is input by the user. If the user input an invalid sql am getting an error as UnboundLocalError: ...
0 votes
1 answer
93 views

Fetchall() is excluding one row which is stored in fetchrow()

I am trying to create a code where i would get all the rows from the existing table if the condition matches otherwise return "Record is not there". Below fetchall() excludes one row which ...
4 votes
1 answer
3k views

python cx_Oracle cursor returns no rows for valid query

Beating my head against my desk on this one. My cx_Oracle cursor is returning no rows for a valid query and I cannot figure out why. The same connection returns expected results from other tables in ...
0 votes
0 answers
15 views

Fatal error: Uncaught Error: Call to a member function fetchAll() [duplicate]

I know this question has been asked before but the answers found don't help me to find why my code is not working. I specify that I use WAMP under Windows, that the name of my database is "myapp&...
2 votes
1 answer
5k views

Difference between cursor.fetchall() and pandas Dataframe

I know there are a few ways to retrieve data from RDB table. One with pandas as read_sql, the other with cursore.fetchall(). What are the main differences between both ways in terms of: memory usage -...
6 votes
0 answers
2k views

Python is slow when iterating over a MySQL connector cursor

I have the following code that runs very slowly (6.5sec for iterating over 57,390 rows) : import mysql.connector cnx=mysql.connector.connect(host=***, ***) cursorSQL = cnx.cursor() for dt in ...
0 votes
1 answer
2k views

pyodbc fetchall() not fetching all

I have Azure serverless functions which are connecting to a SQL database. One of the functions executes a stored procedure which in turn executes sub procedures, each of which produce a results set. ...
24 votes
1 answer
21k views

About mysql cursor and iterator

Imagine I have a mysql cursor and data read. The amount of data might be very big that I want to deal with one line each time. An easy and straight forward way might be like this: while True: row =...
0 votes
1 answer
2k views

SQLAlchemy giving TypeError reading strings from SQLite database

Here is code to read the data out of the tables in a SQLite database: db_path = 'test.db' import sqlalchemy as db engine = db.create_engine('sqlite:///'+db_path) inspector = db.inspect(engine) ...
0 votes
0 answers
61 views

fetchAll from database using PDO

So I've been working on this website a long time but the problem is most of it is MYSQL, which of course isnt very secure, so now I'm trying to update all the PHP to PDO, so far I've only managed to ...
0 votes
0 answers
67 views

Result set retrieved with some dbms of postgresql database does not match with php or python result set

I have a strange problem I'm using a postgresql database, so i've created a function with that return a query with the following data. Resultset of DBMS When i want retrieve the data from a ...
2 votes
1 answer
411 views

Python SQL cursor/fetch: When does the database query complete running?

I had a question regarding the python IBM_DB package (but I think it could be applied to any of the packages that employ the connection/cursor logic i.e. pyodbc). When the cursor.execute() method is ...
0 votes
1 answer
47 views

Get Column names of MySQL table with PDO

I'm trying to write a function that returns an array of column names for a MySQL table. When I use something like this in HeidiSQL SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE table_schema ...
2 votes
2 answers
4k views

What is an optimum way to read huge data from oracle table and fetch into a data frame

I am going to read data from a table in my oracle database and fetch it in a data frame in python. The table has 22 million records and using fetchall() takes a long time without any result. (the ...
0 votes
2 answers
5k views

How to make faster to get large size data from SQL

I am trying to make faster to get large size data from SQL. Here is my system info. OS: Linux Language: python3 SQL library: pymssql sample code msg= "SELECT TAG_CODE, UI_X, UI_Y, INSERT_TIME ...
1 vote
0 answers
98 views

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 ...
24 votes
3 answers
60k views

Fatal error: Call to undefined method mysqli_result::fetch_all()

I have problems with PHP in Ubuntu 10.04. When I try use mysqli_result::fetch_all this error appears: Call to undefined method mysqli_result::fetch_all() However, it works in Windows XP. The Code: ...
1 vote
3 answers
4k views

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 ...
3 votes
4 answers
3k views

pdo fetchAll() returns empty array() [duplicate]

I have been trying for over a day now to get FetchAll() method to help me display array from database. But all my efforts have failed. Instead of the print_r() returning an array, it gives me this ...
0 votes
0 answers
205 views

MySQL PDO fetchAll Fetch_Assoc losing some columns

I am returning a short array via: return $stmt->fetchAll( PDO::FETCH_ASSOC ); and running into a very strange issue. In my test case, I have three rows of data. Each row has a unique ID, a ...
0 votes
1 answer
37 views

Python3 sqlite3 query issues: no erros, but c.fetchall and rowcount is null

mport sqlite3 from itertools import groupby aes_fault_db = r'C:\Users\Desktop\Jetwave Cases\9V-SHD_20200313_0007\AES\Maintenance\AESFault_1.sqlite3' def create_connection(aes_fault_db): try: ...
0 votes
1 answer
253 views

(Flask) How to modify list after a fetchall

(sorry for my very bad english !... ^^) Hello everyone I make a def in my flask to keep with my fetchall a list. But i need to add a parameters in my list to do something. I need to add in list[4] ...
0 votes
1 answer
290 views

Python mysql fetchall() returns additional characters

I am trying to retrieve values from a table to use in a calculation. The code below mycursor = mydb.cursor() mycursor.execute("SELECT number FROM info") rows = mycursor.fetchall() print (rows) ...
0 votes
1 answer
22 views

Through python when connecting MySQL and assign vales to variables, datatype changed from 'int' to 'tuple'

Comparatively new in both python and mysql. I have solved the issue, but want to know the reason. If I use 'comma' after assigning the values to the variables, then it is changing the next datatype ...
3 votes
3 answers
2k views

Out of memory error in php

I am on php 5.2.5 and executing a script from command line. In this script I am manipulating the data fetched from db. To fetch data from db I am using Zend Adapter. I notice an increase in memory(...
1 vote
1 answer
3k views

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 ...
1 vote
2 answers
7k views

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 ...
1 vote
0 answers
248 views

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. ...
3 votes
2 answers
8k views

How do I make a list out of rows from a database using cursor.fetchall with pyodbc?

I have a script that works fine on a simple list. It removes some unwanted characters from a list of words, make them match with each other and returns several lists of similar words (with a 0.6 ratio)...
0 votes
1 answer
348 views

django print all record in the cmd but display the last one on template

i have a function that retrieve data from sql server database where i am using fetchall() then for loop the retrieved data are all printed on the cmd console but when i tried to display these result ...