aaron3481 / assql

Automatically exported from code.google.com/p/assql
0 stars 0 forks source link

Statement can´t handle null values #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Statement
2. Set a null value ( setString(1, null) )

What is the expected output? What do you see instead?
Statement does not have setNull method, so each set method should handle 
null values. You got an error if you try statement.setString(1,null)

What version of the product are you using? On what operating system?
windows xp, asSQL-Beta2.7.swc

Please provide any additional information below.

Original issue reported on code.google.com by tiagohen...@gmail.com on 28 Dec 2009 at 2:37

GoogleCodeExporter commented 9 years ago
I found the bug ...

At Statement Class the method:

private function addParametersToSql():BinaryQuery {         
            var parts:Array = Util.splitIgnoreQuotedDelim(this.sql, "?");
            var binq:BinaryQuery = new BinaryQuery(con.connectionCharSet);
            for ( var i:int = 0; i<parts.length; i++ ) {
                binq.append(parts[i]);

                // IF PARAMS[i+1] VALUE EQUALS NULL IT WILL NOT GET INTO THE 
IF STATEMENT ...

                if ( params[i+1] ) { 
                    var value:* = params[i+1];

                    if ( value == null ) {
                        binq.append("NULL");
                    }

Original comment by tiagohen...@gmail.com on 28 Dec 2009 at 4:19