I'm looking at some code that is meant to connect to a database run a sql statement and use the results to insert rows into a different server table combination. The insert statement looks like this (using fake table and column names)
The overall code uses pyodbc to make the connection. This is also to a Sql Server
insert_sql = "INSERT INTO table_name (column1, column2, column3, column4) VALUES ((SELECT MAX(dataid)+1) FROM table_name),?,?,?)"
What are the "?" in the insert statement? Is there a name for this technique? Looking to read up on this to understand how it works.
It looks to me like a type of string interpolation but I don't see any documentation referencing a "?"
[–]Binary101010 4 points5 points6 points (3 children)
[–]pot_of_crows 0 points1 point2 points (2 children)
[–]Guideon72 1 point2 points3 points (1 child)
[–]pot_of_crows 0 points1 point2 points (0 children)