Forum OpenACS Q&A: Re: ad_form and getting around postgres

Collapse
Posted by Jon Griffin on
I have done this before and it works, are you sure that the dml is correct?
Collapse
Posted by Jade Rubick on
Hi Jon, thanks for the response.

Editing seems to work fine. My edit block looks like this:

} -edit_data {

    db_dml brand_update { }

    ad_returnredirect "."
    ad_script_abort

}

Editing seems to work perfectly.

And in add-edit-postgresql.xql

<fullquery name="brand_update">
    <querytext>
      update brand
      set name                = :name,
          notes              = :notes,
      display_name        = :display_name,
          status              = :status,
          tm_first_used      = to_timestamp(:tm_first_used,'YYYY MM DD HH24 MI SS'),
          tm_applied          = to_timestamp(:tm_applied,'YYYY MM DD HH24 MI SS'),
          tm_issued          = to_timestamp(:tm_issued,'YYYY MM DD HH24 MI SS'),
          tm_renewal          = to_timestamp(:tm_renewal,'YYYY MM DD HH24 MI SS'),
          registration_type  = :registration_type,
          bread_p            = :bread_p,
          bread_mixes_p      = :bread_mixes_p,
          cookies_p          = :cookies_p,
          crackers_p          = :crackers_p,
          other_p            = :other_p,
          application_type    = :application_type,
          registration_number = :registration_number,
          sect_8_15_renewal  = to_timestamp(:sect_8_15_renewal,'YYYY MM DD HH24 MI SS'),
          ibr_p              = :ibr_p
      where brand_id = :brand_id
    </querytext>
</fullquery>

The first thing I tried doing was actually copying the line from the edit block (    db_dml brand_update { } ) into the -new_data block so it looks like this:

} -new_data {

    db_exec_plsql new_brand { }

    db_dml brand_update { }

    ad_returnredirect "."
    ad_script_abort

}

That doesn't do anything either. It just seems to be ignored for some reason.