kamiseq
unread,Jan 17, 2009, 1:23:56 PM1/17/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Flex India Community
hej, I read data from my local sqlite file. I created the db in
sqlitespy, db is in 3rd version and I open db in async manner.
then I try to read data like this
var statement :SQLStatement = new SQLStatement
();
statement.sqlConnection = conn;
statement.text = 'select c.id_course,
c.id_student, c.total_hours,
c.discount, c.price, c.date as created, c.id_course_type, ct.descr,
sum
(l.total_hour) as done_hours ' +
'from courses c ' +
'left join lessons l on c.id_course =
l.id_course ' +
'inner join coursetypes ct on
c.id_course_type = ct.id_course_type
' +
'where c.id_student = :id_student ' +
'group by c.id_course, c.id_student,
c.total_hours, c.discount,
c.price, c.date, c.id_course_type, ct.descr';
the statement is trivial and I dont have any problem with it when I
run it in sqlite admin ajak
statement.parameters[':id_student'] = 11;
statement.execute(-1, new Responder
(hndLoadSuccess, hndFail));
when statement is executed the hndLoadSuccess is fired
private function hndLoadSuccess(event:SQLResult):void{
var cs : Course;
for each(var c : Object in event.data){
cs = new Course();
cs.id_course = c.id_course;
cs.id_student = c.id_student;
cs.id_course_type = c.id_course_type;
cs.course_type = c.descr;
cs.total_hours = c.total_hours;
cs.done_hours = c.done_hours;
..
so the problem is that c and event.data objects has all data I asked
for (when I investigate in debugger)but assigning values to cs object
fails and all I have are NaNs and nulls. what s more trace() i
Alert.show also throws nullable values :(
I have no idea what I do wrong here I have other select and insert
statement that works great ....
I tried casting and getting values directly from event.data[i] with
same result......
help :)