Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OracleGenerator "GenerateConstraints" creates null parameters for "IS NULL" constraints #271

Open
stackwave opened this issue Jul 13, 2011 · 0 comments
Labels

Comments

@stackwave
Copy link

At the top of OracleGenerator.GenerateConstraints, a parameter is created for every constraint. However, if the constraint is an "IS NULL" constraint, the correct syntax is appended to the query string, but the parameter is kept around with a null value. When the command is then prepared and executed, Oracle throws error ORA-01036, "illegal variable name/number." I've fixed this on my end by checking for null before adding parameters in SqlQuery.SetConstraintParams. What used to be

else
    cmd.Parameters.Add(c.ParameterName, c.ParameterValue, c.DbType);

is now

else
{
    if (c.ParameterValue != null)
    {
        cmd.Parameters.Add(c.ParameterName, c.ParameterValue, c.DbType);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant