How to print a parametrized SQL query?

eLearner

How can I get a String with a parametrized SQL query, once parameters inserted ?

Jon Skeet

I think you're assuming that the parameter values will be injected into the SQL and that what ends up being sent to the server is a single string. There's no reason why that needs to be the case - although it could be in some cases.

Generally it would make more sense to send the parameters to the database alongside the SQL but distinct from it. That way there's less work for the SQL engine to do (e.g. parsing numeric values which have been convered into strings), less work for the client to do, less risk of SQL injection attacks due to a failure to escape everything perfectly.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Parametrized Linq to SQL query causes performance issues

From Dev

Postgre SQL parametrized query for C#

From Dev

How can I build a parametrized query without concatenation?

From Dev

Parametrized Query Using JDBC

From Dev

Parametrized Query Using JDBC

From Dev

How to format and print a result of sql query

From Dev

how to print counted sql query using php

From Dev

Parametrized SQL query returns no results, String formatted query returns correct results

From Dev

Conversion to recommended parametrized query method

From Dev

Parametrized query unknown total params

From Dev

MySQL parametrized query with like operator

From Dev

How to print out the current sql query in php with sqlsrv?

From Dev

how to print the result of an SQL Query from a PDO Object

From Dev

How to print out the current sql query in php with sqlsrv?

From Dev

How do I print SQL query using MessageBox in C#

From Dev

Print name of test function in nose_parametrized

From Java

Print SQL Query in Java (JTextPane)

From Dev

Print Prime Numbers with SQL query

From Dev

Print Prime Numbers with SQL query

From Dev

How to call parametrized method in Java?

From Dev

How to use parametrized FirstOrDefault() method?

From Dev

How to call parametrized method in Java?

From Dev

Parametrized like query in neo4j

From Dev

C# SQLCommand - Parametrized query is cut short

From Dev

SQL - parametrized procedure with multiple parameters as array

From Dev

How to print the sql exceptions?

From Dev

How to print to console in SQL?

From Dev

How to print the sql exceptions?

From Dev

Is there a way to print out SQL query sentence in phpstorm?

Related Related

HotTag

Archive