MySQL Forums
Forum List  »  Microsoft SQL Server

Migrate SQL Server SQL statement to MySQL
Posted by: John Chung
Date: March 24, 2011 11:40AM

I tried to migrate the following MS SQL Server SQL statements to MySQL =>

select
':tablename' as table_name,
':pkfieldname' as pk_field_name,
min(:pkfieldname) as min_pk,
max(:pkfieldname) as max_pk,
count(:pkfieldname) as row_count
from
:tablename
WHERE
:tablename.:pkfieldname is not null

/*
the WHERE clause simply makes sure the given
tablename / pkfieldname are just names and not complex SQL
to help minimize the chance of SQL injection.
If they are complex SQL, the final invalid SQL will cause an error to be generated.
*/

<=, but I got the message of "Invalid SQL": The following SQL error occurred: Parameter '?tablename' must be defined.

Does anyone know how to fix this problem ?

Options: ReplyQuote


Subject
Written By
Posted
Migrate SQL Server SQL statement to MySQL
March 24, 2011 11:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.