Hi Jerry -
This is happening on two servers:
- my development server, running Postgres 7.0.3, RedHat 7.1
- soon-to-be production server, hosted at Thinking-Minds.com, running Postgres 7.1.3, RedHat 6.2
The datamodel: http://jamesthornton.com/misc/wpp-product.sql.txt
insert statements...
set db [ns_db gethandle]
set sql_query "select product_type_id from wpp_product_type
where product_type = '$product_type'"
set selection [ns_db 1row $db $sql_query]
set product_type_id [ns_set value $selection 0]
ns_db dml $db "begin"
ns_db dml $db "lock table wpp_product_question in exclusive mode"
set selection [ns_db 1row $db "select max(product_question_id)+1
from wpp_product_question"]
set question_id [ns_set value $selection 0]
if [empty_string_p $question_id] {
set question_id 1
}
set selection [ns_db 1row $db "select max(sort_order)+1
from wpp_product_question
where product_type_id = $product_type_id"]
set sort_order [ns_set value $selection 0]
if [empty_string_p $sort_order] {
set sort_order 1
}
ns_db dml $db "insert into wpp_product_question (product_question_id,
product_type_id, product_question, sort_order, last_modified,
last_modifying_user, modified_ip_address)
values ('$question_id', '$product_type_id',
'[DoubleApos question]', '$sort_order',sysdate(), '$user_id',
'[DoubleApos [ns_conn peeraddr]]')"
ns_db dml $db "end"
|
update statement...
set db [ns_db gethandle]
set sql_update "update wpp_product_question
set product_question = '[DoubleApos $question]',
editor_notes = '[DoubleApos $q_notes]', approved_p = '$approved_p',
last_modified = sysdate(), last_modifying_user = '$user_id',
modified_ip_address = '[DoubleApos [ns_conn peeraddr]]'
where product_question_id = '$q_id'"
ns_db dml $db "begin"
ns_db dml $db "$sql_update"
ns_db dml $db "end"
|
Here are some possibly relevant usenet postings: