?
Solved

HELP - FRM-40102: Record must be entered or deleted first

Posted on 2004-12-01
6
Medium Priority
?
3,164 Views
Last Modified: 2012-06-27
Why am i getting this here is a copy of my code

FRM-40102: Record must be entered or deleted first.

declare
  Cursor A1 is select question from SSAP_QUESTS where cat_id = :SSAP_DETS.CAT_ID and spec_id = :SSAP_DETS.spec_id   and action = :SSAP_DETS.det_action;
                  A1_tmp A1%rowtype;
        begin
                  
                  Go_block('SSAP_ANSWERS');

              for A1_tmp in A1 loop
                  
                        Create_Record;

                        :SSAP_ANSWERS.APS_ID := :PARAMETER.P_APS_ID;
                        :SSAP_ANSWERS.QUESTION := A1_tmp.Question;
                        :SSAP_ANSWERS.det := :ssap_dets.det;
                        select quest_seq.nextval into :SSAP_ANSWERS.quest_id from dual;                   
                  end loop;
              first_record;
              
        end;
0
Comment
Question by:Maritimer
  • 2
  • 2
  • 2
6 Comments
 
LVL 5

Expert Comment

by:alexfrl
ID: 12715925
for A1_tmp in A1 loop
               
                    Create_Record;

                    :SSAP_ANSWERS.APS_ID := :PARAMETER.P_APS_ID;
                    :SSAP_ANSWERS.QUESTION := A1_tmp.Question;
                    :SSAP_ANSWERS.det := :ssap_dets.det;
                    select quest_seq.nextval into :SSAP_ANSWERS.quest_id from dual;      
VALIDATE(RECORD_SCOPE);        
               end loop;
            first_record;
0
 
LVL 10

Expert Comment

by:peterside7
ID: 12715969
The problem comes because of the clear_record.
This block probably has values in it already (default values) or values in pre-block or something
generated in the go_block command.


Try this

Solution Description:  A call to the 'CREATE_RECORD' built-in should be made after navigating to the  block based on the database table which will contain the record. For example,  here is a sample code for the WHEN-BUTTON-PRESSED trigger:  

BEGIN      

GO_BLOCK('blockname');    
/** If there are records present in the block, the new record to be inserted after the last record **/    
LAST_RECORD;    
IF :SYSTEM.RECORD_STATUS != 'NEW'    
THEN             
    DO_KEY('CREATE_RECORD');    
END IF;  
END;
0
 

Author Comment

by:Maritimer
ID: 12715992
Still the same thing

declare
        Cursor A1 is select question from SSAP_QUESTS where cat_id = :SSAP_DETS.CAT_ID and spec_id = :SSAP_DETS.spec_id and action = :SSAP_DETS.det_action;
                  A1_tmp A1%rowtype;
        begin
                  
                  Go_block('SSAP_ANSWERS');

              for A1_tmp in A1 loop
                        message('1');message('1');
                        Create_Record;
                        
                        :SSAP_ANSWERS.APS_ID := :PARAMETER.P_APS_ID;
                        :SSAP_ANSWERS.QUESTION := A1_tmp.Question;
                        :SSAP_ANSWERS.det := :ssap_dets.det;
                        select quest_seq.nextval into :SSAP_ANSWERS.quest_id from dual; --GET_BLOCK_PROPERTY('SSAP_ANSWERS', CURRENT_RECORD);
                         VALIDATE(RECORD_SCOPE);
                                 
                  end loop;
              first_record;
              
        end;
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 10

Accepted Solution

by:
peterside7 earned 400 total points
ID: 12716015
Or just try to do a   CLEAR_RECORD;   before the   CREATE_RECORD;
0
 
LVL 5

Expert Comment

by:alexfrl
ID: 12716030
Go_block('SSAP_ANSWERS');

Are you sure that your start block doesn't have some required and EMPTY fields?
0
 

Author Comment

by:Maritimer
ID: 13118017
Sorry I took so long I was DOWNSIZED shortly afyter this just cleaning up some of my Questions.

Thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question