I am trying to insert data into Mysql in python using the below statements Here id =”75″, plantcode=”2″, pcode=”FG” But my values in database are inserted with single quote in mysql database i.e ’75’,’2′,’FG’ I do not why the values are inserted with single quotes. The syntax of sql query seems to be right. Answer %s means the value you’re
Tag: python
AttributeError: ‘Catalog’ object has no attribute ‘component’
I got this code written But I get always error which says: AttributeError: ‘Catalog’ object has no attribute ‘component’. the problem is that I cannot see where is the problem. Is there something …
Managing multiple categories trees, using Python and PostgreSQL
I have multiple categories, which can have None or one or multiple sub-categories. The process theoretically can go to infinite. So, it is like having multiple trees. Tree example. I have also Item(s). An Item can be in multiple categories. At this moment to connect the categories, in database I use three fields: children (the children of a category), path([1,4,8],
Create SQL command with a query parameter that checks for NULL but also for other values
I am trying to write a dynamic SQL command using Python / Postgres. In my where clause I want to use a query parameter (which is user defined) that has to look for NULL values within a code column (varchar), but in other cases also for specific numbers. If I have to check for a certain value I use this:
peewee : how to filter data in a table based on values across rows in another table
Considering following peewee backed python code, how to filter data in a table based on values across rows in another table e.g. if I want to get a note in Note table having all java, lambda, generics tags in customtags I am really not having idea how to modify my code the get the data above mentioned, I know that
How do I print dynamic sql constraint error statement
I am working on odoo 11 and I want to change the error states of the following SQL constraint and print a dynamic error statement which shows the field “number” inside the error message. from odoo …
Multiple inner joins in pymysql
I am attempting to select multiple columns from three tables in pymysql, and inner join them. I don’t understand what is going wrong when I add the second inner join. I feel like it’s a simple syntax …
Many to many join behaviour
Not really sure how to title this question, but here’s the situation. I have one data frame (dfOrders) that has an order_id and basic information like so: |order_id|full_name|order_date|billing|…
Conditional Join Between SQL Table and Pandas Dataframe
I am working on an application and one step of the processing involves joining drug NDC’s from claim data with a table that contains the NDC along with a variety of other information including unit price, multisource code, and more. The table of claims data looks something like this: It was read into a Pandas dataframe as follows: The SQL
ORA-00942 with cx_Oracle
I’m trying to run any command on an autonomous database from oracle cloud after establishing connection but they don’t seem to work. cursor.execute(“select * from admin.customers”) gives me the …