Friday, September 6, 2019

Re: how to pass user input into raw sql query ?

Hi Lev dev,

Write your query like this 


sqlRawQuery = "Your query ... Field name= {}".format (userInput)

Thanks
Bhoopesh Kumar
 


On Fri, Sep 6, 2019, 4:29 PM leb dev <testdevleb@gmail.com> wrote:
i have a django project that is connected to sql server  database i am trying to write a select query   #convert the Django ORM into SQL query
    print("sql query  = ",FilterQuery.query)
 
select * from table name where filed name = user input 


can anyone help me with this?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fa888770-2a9a-4ff6-951b-be085c15cda8%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAk3c1OMymAb68VPSh%3DJjwhuM1Zx%2BoX9XJborLWYQiULD5BPZg%40mail.gmail.com.

No comments:

Post a Comment