Python Forum
SQLALCHEMY - Not selecting data from table
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQLALCHEMY - Not selecting data from table
#1
Hi all,

I thought it best to create a new thread instead of replying to the old one. Basically I'm querying a Postgresql server using SQLAlchemy. The issue I have is that for some reason it's not pulling through any results. Now this issue isn't exactly python related as I've tried it using the query tool on PGAdmin 4 and it also pulls no results.

Data example:
Output:
style_no style_no_size 12-2408-08 12-2408-08:10 12-2408-08 12-2408-08:20 12-2408-08 12-2408-08:29
The code is running

Output:
select style_no where style_no_size = '12-2408-08:29'
and it's pulling nothing through, even when I try the opposite.

If anyone can help then I would really appreciate it.

Thanks,
James
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply
#2
try: select style_no where style_no_size like '12-2048-08%29';
also: select style_no where style_no_size like '%12-2048-08%';
see if you get a result
Reply
#3
(Nov-01-2021, 11:39 AM)jamesaarr Wrote: select style_no where style_no_size = '12-2408-08:29'
Where is the "from" clause? Should there not be "from <tablename>" in the query?
Reply
#4
(Nov-02-2021, 08:24 AM)ibreeden Wrote:
(Nov-01-2021, 11:39 AM)jamesaarr Wrote: select style_no where style_no_size = '12-2408-08:29'
Where is the "from" clause? Should there not be "from <tablename>" in the query?

Hi,

Yeah I just didn't write the from in on this thread.

I got it fixed in the end by doing:

select data from table where column = '%%data%%';
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply
#5
jamesaarr Wrote:Yeah I just didn't write the from in on this thread.
And I copied your error, sorry
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using pyodbc&pandas to load a Table data to df tester_V 3 819 Sep-09-2023, 08:55 PM
Last Post: tester_V
Question Using SQLAlchemy, prevent SQLite3 table update by multiple program instances Calab 3 748 Aug-09-2023, 05:51 PM
Last Post: Calab
  sqlalchemy could not find table 3lnyn0 4 6,650 Mar-30-2022, 12:36 PM
Last Post: Larz60+
  panda table data kucingkembar 0 1,126 Mar-01-2022, 10:38 PM
Last Post: kucingkembar
  Sorting table data Blacktime2 1 1,327 Feb-26-2022, 07:05 PM
Last Post: ibreeden
  Strategy on updating edits back to data table and object variables hammer 0 1,198 Dec-11-2021, 02:58 PM
Last Post: hammer
  SaltStack: MySQL returner save less data into Database table columns xtc14 2 2,165 Jul-02-2021, 02:19 PM
Last Post: xtc14
  Need help on extract dynamic table data Dr_Strange 0 2,491 Apr-30-2021, 07:03 AM
Last Post: Dr_Strange
  Load the data from multiple source files to one table amy83 2 2,588 Apr-27-2021, 12:33 AM
Last Post: Pedroski55
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 7,777 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020