SQLTeam.com | Weblogs | Forums

Convert SQL to Python

Hello Community,

Can someone let me know if its possible to convert SQL code to Python?

If it is possible, are there any tools that will work well with the conversion/

Thanks

hi

please see the link .. below

i hope it helps you
:slight_smile:
:slight_smile:

https://stackoverflow.com/questions/33556294/translate-sql-to-python-if-possible

harishgg1

Thanks for reaching out. I checked out the link .... basically there is no such tool / application to convert SQL to Python, correct?

Hi

What that means I think is
There is no mention of tool in the link

Does not mean there is no tool
In general
Have to search a lot

One other idea
Is to use search replace
With regular expressions
And use small bits into huge concept

As a substitute

Hope it helps
:+1::+1::grinning::grinning:

As pointed out, this question either needs more detail or doesn’t quite make sense. You wouldn’t really convert SQL into python. You could certainly execute SQL from Python, or you could use an ORM to manipulate data on a DB instead of using straight up SQL. (that’s what I would personally recommend).

If you’re looking to execute SQL from Python, then the type of DB server you have will depend on the route to take. If gain more knowledge through online tutorials in Python or SQL Query.

Hi Carlton,

You could try Studio 3T. The IDE has a Query Code feature that translates from SQL into Python, as well as into C#, PHP, Java, Javascript and mongoShell. But unless you're seriously developing against MongoDB, it might be more than you actually need. Try it out though.

Richard
[Declaration: I work for Studio 3T.]

Looks like Somebody has tried years ago

:+1::+1:

Hi Richard,

This tool is for MongoDB, not Python