postgresql7.1
update sec_session_properties
set property_value = :value,
secure_p = :secure,
last_hit = :last_hit
where session_id = :session_id and
module = :module and
property_name = :name
update users
set second_to_last_visit = last_visit,
last_visit = now(),
n_sessions = n_sessions + 1
where user_id = :user_id
select test_sql('select 1 where 1=[DoubleApos $value]')
select test_sql('select 1 where 1=[DoubleApos "'$value'"]')
insert into secret_tokens(token_id, token, token_timestamp)
values(sec_security_token_id_seq.nextval, :random_token, now())
select token_id, token
from secret_tokens,
(select trunc(random()*(select count(*)-15 from secret_tokens))::integer as first) r
where token_id >= r.first and r.first+15 > token_id;
update users
set password = :new_password,
salt = :salt,
password_changed_date = current_timestamp
where user_id = :user_id