System.record_status

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Responder
gr_sp
Rank: Programador Júnior
Rank: Programador Júnior
Mensagens: 24
Registrado em: Qua, 26 Mai 2010 10:17 am
Localização: São Paulo

Boa tarde,

Como faço para trocar o status do System.record_status?

No meu caso está INSERT, quero alterar para CHANGED.

Obrigado!
Avatar do usuário
dr_gori
Moderador
Moderador
Mensagens: 5024
Registrado em: Seg, 03 Mai 2004 3:08 pm
Localização: Portland, OR USA
Contato:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Procure por SET_RECORD_PROPERTY

Selecionar tudo

/* 

** Built-in:  SET_RECORD_PROPERTY 
** Example:   Mark the third record in the EMP block as if it 
**            were a queried record. 
*/ 
BEGIN 
  Set_Record_Property( 3, 'EMP', STATUS, QUERY_STATUS); 
END; 

Parameters

record_number - Specifies the number of the record whose status you want to set. The record number is the record's position in the block. Specify as a whole number.

block_name Specifies the name of the block in which the target record exists. The data type of the name is VARCHAR2.

property Use the following property:

STATUS Specifies that you intend to change the record status. STATUS is a constant.

value Use one of the following values:

CHANGED_STATUS Specifies that the record should be marked for update and should be treated as an update when the next commit action occurs.
INSERT_STATUS Specifies that the record is to be marked as an INSERT and should be inserted into the appropriate table when the next commit action occurs.
NEW_STATUS Specifies that the record is to be treated as a NEW record, that is, a record that has not been marked for insert, update, or query. Changed but uncleared or uncommitted records cannot be assigned a status of NEW.
QUERY_STATUS Specifies that the record is to be treated as a QUERY record, whether it actually is. See also the CREATE_QUERIED_RECORD built-in.
gr_sp
Rank: Programador Júnior
Rank: Programador Júnior
Mensagens: 24
Registrado em: Qua, 26 Mai 2010 10:17 am
Localização: São Paulo

Mas onde eu devo colocar esse código ??

No meu caso, tenho uma trigger "when button pressed"

Selecionar tudo

begin
  if :system.record_status = 'CHANGED' then .....
Coloquei um "message(:system.record_status )" no começo da trigger.

Selecionar tudo

message(:system.record_status )" 
begin
  if :system.record_status = 'CHANGED' then .....
E ele me trouxe um INSERT como mensagem. Ou seja o status está como INSERT.

Como altero para CHANGED?

Obrigado.
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 29 visitantes