1 Reply Latest reply on Apr 6, 2008 10:54 PM by anirudhs

    js typeerror when using sql data as sql parameters

    pawzlion Level 1
      I get a list of categories from sql using javascript and air's SQLStatement command.
      This results in sql data being accessible as javascript objects like "item.ID".
      I can print or trace the values ok, but when I start a second SQLStatement, and try and pass the value as a parameter, I get "TypeError: Null value" when I use statements like:

      stmt2.text = "SELECT * FROM categories WHERE childOf = :itemID";
      stmt2.parameters[":itemID"] = item.ID;

      I can set the value of item.ID manually to a fixed value and the statement will evaluate fine, but if I try and assign the value of the item.ID object from the first statement, it fails with the aforementioned error.

      What am I doing wrong ?