Unable to INSERT record but inserting. Forms 4.5 error through Apps 10.7

Hi All,
I have written the following code on save button on form 4.5 which has been used from APPS. I created the master-detail relation also.
It suppose to insert a row into header and then into lines.
Its inserting the row into both the tables but getting the following error in betweeen.
===========
FRM-40508: ORACLE error: unable to INSERT record.
ORA-01400: cannot insert NULL into ("VFI"."VFI_PC_DEFINITION_LINES"."LINE_ID")
===========
I am thinking problem is some where in some default triigers or on insert triggers
but unable to trace it. CAN anybody through a light on this ?
================================================
PROCEDURE VFI_INVPCS IS
i          number;
v_item_id     number;
v_item_id1     number;
v_temp      varchar2;
v_user_id NUMBER := 1111; --fnd_global.user_id;
Lv_ChkFlag VARCHAR2(1);
Lv_UnChkFlag VARCHAR2(1);
ln_header_seq NUMBER;
ln_lines_seq NUMBER;
BEGIN
BEGIN
SELECT inventory_item_id
INTO v_item_id
FROM inv.mtl_system_items
WHERE organization_id = 103
and segment1 = :VFI_PC_DEFINITION_HEADER.parent_inventory_item_id;
SELECT VFI_PC_DEFINITION_HEADER_SEQ.nextval
INTO ln_header_seq
FROM DUAL;
SELECT VFI_PC_DEFINITION_LINES_SEQ.nextval
INTO ln_lines_seq
FROM DUAL;
INSERT INTO VFI_PC_DEFINITION_HEADER( HEADER_ID
,PARENT_INVENTORY_ITEM_ID
,START_DATE
,END_DATE
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE)
VALUES ( ln_header_seq
     ,v_item_id
     ,:VFI_PC_DEFINITION_HEADER.start_Date
     ,:VFI_PC_DEFINITION_HEADER.end_date
,v_user_id
     ,sysdate
     ,v_user_id
     ,SYSDATE
COMMIT; -- header
GO_BLOCK('VFI_PC_DEFINITION_LINES');
LOOP
SELECT inventory_item_id
INTO v_item_id1
FROM inv.mtl_system_items
WHERE organization_id = 103
AND segment1 = :VFI_PC_DEFINITION_LINES.child_inventory_item_id;
First_record;
IF :VFI_PC_DEFINITION_LINES.child_inventory_item_id is not null then
IF :CFY_PTID_FLAG='Y' THEN
Lv_ChkFlag:=:CFY_PTID_FLAG;
INSERT INTO VFI_PC_DEFINITION_LINES( LINE_ID
,HEADER_ID
,PARENT_INVENTORY_ITEM_ID
,CHILD_INVENTORY_ITEM_ID
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,CFY_PTID_FLAG)
VALUES ( ln_lines_seq
,ln_header_seq
,v_item_id
,v_item_id1
,v_user_id
,SYSDATE
,v_user_id
,SYSDATE
,Lv_ChkFlag
END IF;
END if;
NEXT_RECORD;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';      
END LOOP;
message('After Insert Child');
message('After Insert Child');
COMMIT;
END;
================================================

not sure on the block structure of your forms.
one would question why you seem to be doing a lot of the default insert work on the press of a button (when-button-pressed).
also if you have a master-detail relationship in the form - why you don't let forms handle the master-detail insert.
seems like you have database database blocks but are almost coding as if they are non-base table blocks.

Similar Messages

  • Unable to update record in web Form

    Hi, i am unable to update record in a form. I am building a custom form using forms 6i and putting it on the web in oracle applications 11.5.9
    I used template.fmb as a starting point for my form. I have one datablock based on a table. Insert, update and delete properties are set to yes on the property pallete of data block. The table against which i am running the form has a primary key which is a combination of two fields. I am able to update a record with pure SQL running against the table.
    My form now brings back a record from the db like it should but whenever I try to update that record either by pressing Action Save or by clicking button that has update statement in it, instead of doing an update, it does an insert and tells me that this record already exists and that i entered value(s) that must be unique for each record. It thinks I want to insert but I want to update. What am i doing wrong???
    Update allowed value is set to Yes in all the items in the data block and at the data block level as well. Querly_only is set to no.
    What's even more frustratinng is that I've ran the form manually before starting with template.fmb and have been able to update the table but when I put it on the web and used template.fmb it stopped working!
    I am very new to forms, can anybody suggest anything? Please help!!!

    When you populate the 2nd block with a select into query, it's the same as just typing the data into the block. The record is treated as one needing to be inserted, not as one that is queried.
    To populate it using a true query, but with data from the LOV, you can do this:
    Programmatically set the default_where clause of the block based on the LOV. For example, if a name is chosen from the LOV in an item called LOV1, you could do:
    set_block_property('block2','default_where','name='''||:block1.lov1||'''');
    or if the LOV is a number, like a department number:
    set_block_property('block2','default_where','deptno='||:block1.lov1);
    The tricky part when you build your where clause is that you must surround strings with single quotes, and the way to do this is to use two single quotes to represent an actual single quote in the where clause. Otherwise a single quote is interpreted as part of the PL/SQL syntax.
    Then, just navigate to block 2 and execute a query:
    go_block('block2');
    do_key('execute_query');
    I hope this works for you. I didn't have time to test this, so I hope I didn't make any syntax errors when typing.

  • CS4 Insert Record behavior when form spans pages

    Hello!!
    I have a form that spans pages, carrying the values via the session from page to page.
    The insert record behavior only picks up the values from the page in which I am inserting the behaviour (which I understand)
    Can I use the behavior "wizards" to create an insert that will use my session variables or do I have to do it through a script?
    I am relatively new to web coding (php) so any help would be appreciated.
    Thanks to all!! Have a great day...
    Rich

    I think I discovered the answer, but I would appreciate if someone can confirm if it's the right way or wrong way.
    I made hidden input fields, and made the default value the contents of the session variable for each field I brought over from previous pages.
    Seems to work, but is this a good way of doing it or a n00b way?
    Thanks,
    Rich

  • Insert record AND post form

    Hi,
    I'm sure this is a common problem, I could not find anything
    relating to it in search here so...
    I have a form, which I insert data into database, fine.
    I then want to post the same form to paypal payment page.
    I've got paypal set-up fine with hidden fields in the form
    etc. However, how can I make the insert into database and then post
    the form to paypal ? should I use onClick event to trigger insert
    and action to post to paypal ?
    using asp vb
    Any advise appreciated.

    It'd be a 2 page process. On page 1, you submit the form and
    insert record
    into database. Then redirect to page 2. On page 2, you'd
    submit the form on
    load and post it to paypal.
    Jules
    http://www.charon.co.uk/charoncart
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004

  • Inserting records from Infopath forms library to a SQL table

    Hi,
    I have a requirement where i need to populate records from a Infopath forms library to a SQL table in a database. We have written a console app to achive the same. However we are encountering performance issues when inserting records in the database. The
    way we retreive information from Infopath forms library is through a CAML query and then insert record by record in database. Is their a better and faster way to acheive this?
    Can someone pls help? 
    thanks,
    Anand
    Thanks and Regards, Anand R. Deshpande

    Hello Anand,
    Could you share you console application code? Also tell us when you face performance issue. I mean is there any problem in accessing infopath form or you are facing problem with only console application.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Problem inserting record using INSERT INTO

    I am an amateur web builder using some ColdFusion functionality to access information on an Access database. I know very little about ColdFusion syntax, but I'm using Dreamweaver CS3 to help generate most of the code. I'm working on an insert record page to create a user database with login information. I'm not sure what the problem is, but I'm getting a syntax error referencing this particular portion of the code:
    Syntax error in INSERT INTO statement.
    The error occurred in C:\ColdFusion9\wwwroot\Everett\register.cfm: line 22
    Below is the entire page with line 22 (referenced in the error message) in red. Any ideas?
    <cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
    <cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "register">
      <cfquery datasource="everettweb">  
        INSERT INTO Users ([First Name], [Last Name], [Email Address], Password)
    VALUES (<cfif IsDefined("FORM.first_name") AND #FORM.first_name# NEQ "">
    <cfqueryparam value="#FORM.first_name#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.last_name") AND #FORM.last_name# NEQ "">
    <cfqueryparam value="#FORM.last_name#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.email") AND #FORM.email# NEQ "">
    <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.password") AND #FORM.password# NEQ "">
    <cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
      </cfquery>
      <cflocation url="register_success.cfm">
    </cfif>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Main.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <link href="main.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Everett Music Department, Everett, MA</title>
    <!-- InstanceEndEditable -->
    <style type="text/css">
    <!--
    body {
    background-color: #660000;
    -->
    </style>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    //-->
    </script>
    <!-- InstanceBeginEditable name="head" -->
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
    <!-- InstanceEndEditable -->
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    a:link {
    color: #660000;
    a:visited {
    color: #A01D22;
    a:hover {
    color: #FFCC00;
    -->
    </style>
    <link href="main.css" rel="stylesheet" type="text/css" />
    </head>
    <body onload="MM_preloadImages('menu_about_over','menu_ensembles_over.jpg','menu_schools_over.j pg','menu_events_over.jpg','menu_faculty_over.jpg','menu_contacts_over.jpg','menu_home_ove r.jpg','menu_about_over.jpg','menu_links_over.jpg','menu_login_over.jpg')">
    <table width="960" align="center" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="3"><img src="top_border.jpg" width="960" height="20" align="top" /></td>
      </tr>
      <tr align="center">
        <td colspan="3"><a href="index.php"><img src="e_oval_top.jpg" height="100" width="270" border="0" /></a><a href="index.php"><img src="header.jpg" height="100" width="690" border="0" /></a></td>
      </tr>
      <tr>
        <td height="35" width="301"><a href="index.php"><img src="e_oval_bottom.jpg" height="35" width="234" border="0" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','menu_home_over.jpg',1)"><img src="menu_home.jpg" width="67" height="35" name="home" border="0" id="home" /></a></td>
        <td width="251"><ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a class="MenuBarItemSubmenu" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','menu_about_over.jpg',1)"><img src="menu_about.jpg" width="71" height="35" name="about" border="0" id="about" /></a>
            <ul>
              <li><a href="#">News</a></li>
              <li><a href="#">History</a></li>
              <li><a href="#">Media</a></li>
            </ul>
          </li>
          <li><a class="MenuBarHorizontal" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('ensembles','','menu_ensembles_over.jpg',1)"><img src="menu_ensembles.jpg" width="98" height="35" name="ensembles" border="0" id="ensembles" /></a>
            <ul>
              <li><a href="#">Band</a></li>
              <li><a href="#">Chorus</a></li>
              <li><a href="#">Strings</a></li>
            </ul>
          </li>
          <li><a class="MenuBarItemSubmenu" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('schools','','menu_schools_over.jpg',1)"><img src="menu_schools.jpg" width="82" height="35" name="schools" border="0" id="schools" /></a>
            <ul>
              <li><a href="#">Everett High School</a></li>
              <li><a href="#">English School</a></li>
              <li><a href="#">Keverian School</a></li>
              <li><a href="#">Lafayette School</a></li>
              <li><a href="#">Parlin School</a></li>
              <li><a href="#">Webster School</a></li>
              <li><a href="#">Whittier School</a></li>
            </ul>
          </li>
        </ul>
        </td>
               <td width="408"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('events','','menu_events_over.jpg',1)"><img src="menu_events.jpg" width="74" height="35" name="events" border="0" id="events" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('faculty','','menu_faculty_over.jpg',1)"><img src="menu_faculty.jpg" width="79" height="35" name="faculty" border="0" id="faculty" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('links','','menu_links_over.jpg',1)"><img src="menu_links.jpg" width="66" height="35" name="links" border="0" id="links" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('login','','menu_login_over.jpg',1)"><img src="menu_login.jpg" name="login" width="69" height="35" border="0" id="login" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','menu_contact_over.jpg',1)"><img src="menu_contact.jpg" width="100" height="35" name="contact" border="0" id="contact" /></a><img src="menu_spacer_end.jpg" width="20" height="35" /></td>
      </tr>
      <tr height="10">
        <td colspan="3"><img src="menu_bottom_spacer.jpg" height="10" width="960" /></td>
      </tr>
    </table>
    <table width="960" cellpadding="0" cellspacing="0" align="center">
      <tr height="50">
        <td width="30" background="left_border.jpg"><img src="clear.gif" width="30" height="50" /></td>
        <td width="900" bgcolor="#FFFFFF">
          <table width="900" cellpadding="0" cellspacing="0">
            <tr>
              <td width="900" height="350" valign="top"><!-- InstanceBeginEditable name="PageBody" -->
          <form action="<cfoutput>#CurrentPage#</cfoutput>" method="POST" name="register" preloader="no" id="register">
                <table width="100%">
                  <tr>
                    <td colspan="2" class="heading1">Fill in the information below to register for this site:</td>
                  </tr>
                  <tr>
                    <td colspan="2"><img src="clear.gif" height="15" /></td>
                  </tr>
                  <tr>
                    <td width="50%" class="form" align="right">First Name:</td>
                    <td width="50%"><span id="sprytextfield1">
                      <input type="text" name="first_name" required="yes" id="first_name" width="150" typeahead="no" showautosuggestloadingicon="true" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Last Name:</td>
                    <td><span id="sprytextfield2">
                      <input type="text" name="last_name" required="yes" id="last_name" width="150" typeahead="no" showautosuggestloadingicon="true" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Email Address:</td>
                    <td><span id="sprytextfield3">
                    <input type="text" name="email" validate="email" required="yes" id="email" width="150" typeahead="no" showautosuggestloadingicon="true" />
                    <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Confirm Email Address:</td>
                    <td><span id="sprytextfield4"><span id="ConfirmWidget">
                    <input type="text" name="email_confirm" validate="email" required="yes" id="email_confirm" width="150" typeahead="no" showautosuggestloadingicon="true" />
                    <span class="confirmInvalidMsg">The values do not match</span></span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Password:</td>
                    <td><span id="sprytextfield5">
                      <input type="password" name="password" required="yes" id="password" width="150" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Confirm Password:</td>
                    <td><span id="sprytextfield6"><span id="ConfirmWidget">
                      <input type="password" name="password_confirm" required="yes" id="password_confirm" width="150" />
                      <span class="confirmInvalidMsg">The values do not match</span></span></span></td>
                  </tr>
                  <tr>
                    <td> </td>
                    <td><input name="submit" type="submit" id="submit" value="Register" /></td>
                  </tr>
                </table>
          <input type="hidden" name="MM_InsertRecord" value="register" />
          </form>
          <script type="text/javascript">
    <!--
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "email");
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
    var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
    //-->
    </script>
    <script type="text/javascript">
    var ConfirmWidgetObject = new Spry.Widget.ValidationConfirm("sprytextfield4", "email");
    var ConfirmWidgetObject = new Spry.Widget.ValidationConfirm("sprytextfield6", "password");
    </script>
              <!-- InstanceEndEditable --></td>
            </tr>
          </table>
        </td>
        <td width="30" background="right_border.jpg"><img src="clear.gif" width="30" height="50" /></td>
      </tr>
      <tr>
        <td colspan="3" background="footer.jpg" class="footer" height="80"/>This website best viewed using:<br /><a href="http://www.firefox.com"><img src="firefox_logo.gif" width="110" height="40" border="0" /></a></td>
      </tr>
    </table>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    <!-- InstanceEnd --></html>

    Syntax error in INSERT INTO statement.  INSERT INTO Users ([First Name], [Last Name], [Email Address], Password)
    That oh-so-uninformative error is because "Password" is a reserved word with your database driver.  Either escape it by putting square brackets around it too, or rename the column permanently. It is best to avoid using reserved words whenever possible. So renaming the column is the better option.  Also, I would try and avoid using invalid characters like spaces in column names ie "First Name". It is technically allowed, but it requires special handling everywhere which adds unecessary complexity.
    I'm not sure what the problem is, but I'm getting a syntax error referencing this particular portion of the code:
    Do not take the error line numbers as gospel. Sometimes they just indicate that the error is within the vincinty of that line.
    I'm using Dreamweaver CS3 to help generate most of the code
    Unforutnately, DW wizards generate some truly awful and verbose code.  To give you an idea, here is what the query should look like, without all the wizard nonsense.
      <cfparam name="FORM.first_name" default="">
      <cfparam name="FORM.last_name" default="">
      <cfparam name="FORM.email" default="">
      <cfparam name="FORM.FORM.password" default="">
      <cfquery datasource="YourDSNName"> 
        INSERT INTO Users ([First Name], [Last Name], [Email Address], [Password])
        VALUES (
          <cfqueryparam value="#FORM.first_name#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.last_name#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_varchar">
      </cfquery>
    CF is pretty easy to learn. You might want to begin perusing the CF documentation and a few tutorials to get more familiar with the language. Since you are working with a database, I would also recommend a  SQL tutorial.

  • Data source using Fn.Mod. in R/3 shows 53 records but in BW side show error

    Hello gurus,
    I have created a data source in R/3 , when tested showed 53 records, but in BW side when i did extraction it failed, & put me an error message saying
    " error occured in source system"
    Points will be awarded for any kind of response.
    Thanks and regards,
    Anurupa.

    Hi,
    Try what is given above.
    Also check SM37 job log (In source system if load is from R/3) (give request name) and it should give you the details about the request. If its active make sure that the job log is getting updated at frequent intervals.
    Also see if there is any 'sysfail' or cpicerror for any datapacket in SM37.
    SM21 - System log can also be helpful.
    If you are 3.5 try this also
    1) Reduce the IDOC size to 8000 and number of data packets per IDOC as 10. This can be done in info package settings.
    2) Run the load only to PSA.
    3) Once the load is succesfull , then push the data to targets.
    In this way you should be able to overcome this issue.
    Hope this helps.
    Thanks,
    JituK

  • Insert records from user form to multiple tables in same database

    Hi Experts, I need your help. I have a form that has multiple text fields that I need to insert the records to their each respective table. For example: The first name field needs to go the the name table, address goes to a seperate table, phone goes to a seperate table and so on.
    Is this possible to do?
    Thanks Much
    Sham

    The same for ASP, JSP or PHP.  Just the code syntax is different for each language.  Are you using MySQL, Access or ?
    In any case, create the three recordsets on the database and use insert queries.  If you don't know what one is, google insert query and you will see the syntax. 
    Here is a good example out on the web
    http://www.stardeveloper.com/articles/display.html?article=2000032601&page=1
    In your case you would get the values for the inserts from the form data and only need to open the database connection once.
    Good luck.
    Walt
    B & B Photography

  • Problem inserting date in oracle forms

    I have a data block called CUSTOMER and a TEXT ITEM called
    DOB which is used to enter the Date of birth (date).
    I have a SAVE button, on its trigger WHEN-BUTTON-PRESSED,
    I have the following code
    insert into test values
    (to_date(:customer.dob,'dd-mon-yyyy'));
    commit;
    When i run the form it gives the error
    FRM-40508: Oracle error: unable to INSERT record
    But when i run the same trigger with sysdate (as shown below)
    it runs perfectly, i mean the row is inserted into the database.
    insert into test values
    (to_date(sysdate,'dd-mon-yyyy'));
    commit;
    If someone can offer some assistance regarding this problem,
    I will appreciate that.
    Dalbir

    Whenever you get an "Oracle Error" it means the form is happy but the database is complaining about something. You can select help > display error from the menu to see the sql it is trying to run and what the problem is.
    Incidentally, why are you going to the trouble of trying to write code to do something which a forms block does automatically ?

  • Find the latest updated or the latest inserted record  in a table

    Hi All,
    Thanks in advance
    Just a simple question
    How do we find the latest updated or the latest inserted record in a table ?
    Provide some queries in SQL?

    You can order by rowid desc to get lately inserted records, but I'm not sure about updated records.That is incorrect, Oracle might use old rowid's even in inserts and you cannot assure that the max(rowid) refers to the latest record.
    If the table is created with rowdependencies one can use ORA_ROWSCN pseudo column to check on date/time when the last dml has been performed over that table. But, that has some limitations too, Old snapshots will be erased hence one can check the last dml with a time frame of few days.
    Regards,
    Prazy

  • Unable to complete Recording, then Crash

    I have e-tester ver 8.20.555 running on IE6. I am doing a simple recording but keep getting the following error: e-tester Failed to finish Transition (Object Variable or With block variable not set)
    It then gives the display can't stop here and e-tester shuts down.
    There is no VBA code in this script.
    Any help would be appreciated.

    Yes, it happens with IE7 it was happening so much I removed IE7 and went back to IE6.
    The application is Financial, and is this site is not open to the public. There is a field, which is a required textinput field;
    window(index=0).frame(name="ifMain" | index=0).frame(index=0).Tag[TEXTINPUT](index=2)
    when recording, I fill in the field, with the correct, verified, value then stop the recording. There are other fields on this dialog box but I am trying, after so many crashes, to record one field at a time. It does not matter what field is selected the result is the same. The required field input is verified by an element that was created in Java script.

  • Oracle forms error frm-40508: unable to insert record

    Hi Everyone,
    I have been having this problem for 2 weeks and I realize that I spent alot of time I couldn't get to fix the problem so I need your help.
    Here is my situation. First, I installed Oracle 10g in my laptop with Oracle forms10g and Oracle forms904i. I had oracle_home folder as the top level structure then I have inside oracle folder, Oracle10g in it own folder, Oracle9i release2 in it own folder. then I created the user account "student" using the system/manager account finally I granted privilleges as follow:
    GRANT ALL PRIVILLEGES
    TO student
    WITH ADMIN OPTION;
    this was working perfecty I didn't need to grant objects privilleges such as
    GRANT INSERT, UPDATE, DELETE
    ON customers
    TO student;
    Then I created a form Application prototype and it works well I could Insert, Update and Delete but now I am creating an e-commerce application prototype I created an new account using a system/manager account as I did previously and grant all privilleges. When I try to grant object privileges the message that I receive says ORA-01919 : role 'INSERT' doesn't exist
    When I run the application I am unable to insert the record through forms I get message frm-40508 Orcle error: unable to insert record.
    I deinstall the Oracle and clean my laptop and did a clean installation using only Oracle Server10g and Oracle Developer10g I am getting the same message frm-40508.
    Can someone please help me on this. the insert command that I am running is a simple one such as
    INSERT INTO customers
    VALUES( block_name.field_name, ....);
    COMMIT;

    frm 40735:When button pressed trigger raised unhanded exceptionplease help me to solve this>
    The FRM-40735 is a generic Unhandled Exception. Please post the full error message so we can better help you.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Unable to Insert record In forms: error -ORA-01779 :cannot modify a column

    Hi,
    I have created one form with two block.
    Block-1 : Based on View
    Block-2 : Based on table
    There is is relationship between Block-1 and Block-2.
    Block-1 is populating from LOV.
    I just need to insert /update record Block-2 based on data from Block-1
    So Block-1 I have made read only at runtime (Inser/update all properties are false).
    Now when I insert record in Block-2 based on record from block-1, and getting below error.
    "ORA-01779: cannot modify a column which maps to a non key-preserved table"
    It is not allowing to insert record.
    Please help me.
    Subir

    The error states that there is some operation on a view, not an a table.
    Now when I insert record in Block-2 based on record from block-1What does that mean? How do you insert records in block 2?
    When exactly occurs the error?

  • [SOLVED] FRM-40508:ORACLE error: unable to INSERT record

    Hi all,
    I have migrated this form from 4.5 to 10g (Version 10.1.2.0.2 ). This form inserts a record into the database table when all the fields in the form are filled and a button Save is presed.
    At the time when I press the Save button, I get this error. FRM-40508:ORACLE error: unable to INSERT record
    So I went on to see the "Display Error" from help and found to be the database error, inserting into a table.
    The error message is ORA-00932: inconsistent datatypes: expected DATE got NUMBER
    The form where I press Save button has 3 date fields and I checked the properties of them and they are Date only.
    I also generated to object list report and tried to find some answer, but no use.
    Please help me in debugging this form.
    Edited by: Charan on Aug 18, 2011 4:05 PM

    I think you need to get a description of the table and compare all the "database" columns in the form with the ones in the database table to see that the types match. Somewhere there's a mismatch. Also check the block(s) "query data source columns" and see if there's any
    columns in there that the type does not match the table. (check the sizes of things too while you're at it.)

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

Maybe you are looking for

  • Unable To Pass Input Page Parameter Using PageDef File.

    Dear All, I am currently exploring task flows as I dont have that much knowledge in it. Here's my use case 1. I setup a taskflow which has a Method Call and a View Activity in it. 2. The method call is a default activity which just calls a web servic

  • Raw workflow in Aperture 3

    I just switched to shooting raw. I'm trying to figure out how to export my raw files after I've tweaked them in Aperture 3. When I export masters, I get the raw version but not the changes. When I export versions, they're jpegs. I'd like to be able t

  • F.01 drilldown report

    Dear Friends, Can anyone advise me on how we create drilldown reporting for F.01. Currently in our system when we execute transaction F.01, we are unable to drilldown any figures. Our objective is to know further details of each GL account amount fro

  • Transport of infoset query urgent ?

    Hi , any one can help me on this topic.. i want to transport the infoset query .. please any body give the steps....regarding this topic.. regards, goodyear,

  • Making a fade effect on dreamweaver

    okay, what i want to do is make a fade effect on the pictures that i have. what i have in the website are 4 pictures, positioned like this: |................| |................| |......1........| |.....3.........| |_______| |_______| |...............