Hello!

Is there way to careate view such as

db eval {
CREATE TABLE view_report_01 AS
?SELECT s.name ?AS service_name,
? t_l_r.cost AS cost
?FROM work.users ? AS u,
? work.user_contracts ?AS u_c,
? work.user_services ?AS u_s,
? work.services ? AS s,
? telephony.telephony_log_rating AS t_l_r,
? telephony.telephony_log ?AS t_l
?WHERE u.id = $user_id
?AND u.id = u_c.user_id
?AND u_c.id = u_s.owner_id
?AND u_s.service_id = s.id
?AND u_s.id = t_l_r.user_service_id
?AND t_l_r.log_id = t_l.rowid
?AND ($date_from = '' OR julianday(date2iso($date_from)) < t_l.date_start)
?AND ($date_to = '' OR (julianday(date2iso($date_to)) + 1) > t_l.date_start)
}

I have params $user_id, $date_from, $date_to. There are a lot of queries to 
this view and is needed to place params in the view.

Best regards.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to