Skip to content
Advertisement

Tag: psycopg2

Any way to pass operators <, , >= into sql-query?

I have such piece of program: What I want to do is write ‘<‘ in command in the same way as {table} and {pkey}, that means I want to pass operators into command from variable. Can I do it? The face of the app looks like this A little bit more of code context. It’s an app, that should get

psycopg2 takes a value as a column

I’m trying to create a table using psycopg2 and then insert outer data from some jsons. For this reason I defined 2 function: create_words_table() and insert_data(): So, attempting to execute them: I got further error: Looking at documentation, I don’t see any mistake applying simple INSERT query and can’t understand why psycopg2 takes a tuple after word VALUE as a

The function processes the sql request

The function processes the sql request. It receives parameters and one of them can be either “null” or a value (uuid), I need to add this value to where. But there is a problem, because with null “where param is null”, but with the value “where param = value” Example Answer In sql, null = null and null <> null

Advertisement