Jbo error on multi records insertion
using jdev 11.6 .
error:..Too Many object matchs primary key oracle.job.key[10,1000].
i have scenario ,have composite parimary key's on table . second parimary key genrating programatically upon when i clik on create opeartion. i m able to save records sccessfully when insert records one by one .
in vo imple genrating the 2nd primay key and setting value to ---->this.getCurrentRow.SetAttribute("euid",pk2value);
getting error only when i create a multiple records on table and then click on commit . seems when i commit all records taking latest 2nd pk as 1000 ,
thanks i any suggestion on this ?
how to resolve above error
table have create and commit operation . new records insertion ll happen on popup -window .
upon click on ok in dialog windows records get added to table and seting the pk value iin vo imple .. this.getCurrentRow.SetAttribute("euid",pk2value);
how to set and retain value in voimple ?
Similar Messages
-
Errors not logged when IKM Oracle Multi Record Insert is selected
Dear All,
I am new in ODI 11g and I am facing the following problem:
I created a package with 3 Interfaces with Oracle Multi Record Insert.
In the first interface I load the source data to a temporary target
In the second interface target#1 table is loaded using interface#1
In the third interface target#2 is loaded using interface#1 and the multiple insert is executed and committed.
This works correctly, but when a data error occurs (e.g. mandatory column is null), instead of the error being logged in the Error table, execution of the last interface fails with the following error:
Caused By: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into (<schema>.<table>.<column>)
I noticed that when I use Oracle Incremental Update instead, the errors get logged correctly in the error table.
Does anyone know what could be causing this?Hi Bhabani,
Thanks for the reply.
I am afraid that this is a major issue for me, I do not want to re-query the source table for each target table, but on the other hand I cannot fail the process for each invalid record and I need the logging.
Can you think of a workaround for my use case?
Thank you! -
SQL syntax error when creating record insertion form
Good day,
I was hoping someone could help me. I am trying to create a record insertion form on a website to insert data into a database table. When attempting to create the form, I am getting the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMaili' at line 1
Not sure what is going on. I am running windows 8 and DW cs5 w/ MYSQL. I am testing on a local server prior to pushing to the remote server.
Thank you for your assistance and please advise any code you would like me to send.Here is all the code from this particular webpage. I apologize, I am too stupid to realize which parts are SQL vice PHP vice HTML:
<?php require_once('Connections/group4.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO individual (Grade, LastName, FirstName, M.I., Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMailing Address`, Citizenship, Designation, IATrainingComplete, IADate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Grade'], "text"),
GetSQLValueString($_POST['LastName'], "text"),
GetSQLValueString($_POST['FirstName'], "text"),
GetSQLValueString($_POST['MI'], "text"),
GetSQLValueString($_POST['Organization'], "text"),
GetSQLValueString($_POST['Office'], "text"),
GetSQLValueString($_POST['Department'], "text"),
GetSQLValueString($_POST['Phone'], "double"),
GetSQLValueString($_POST['EmailAddress'], "text"),
GetSQLValueString($_POST['JobTitle'], "text"),
GetSQLValueString($_POST['OfficialMailing_Address'], "text"),
GetSQLValueString($_POST['Citizenship'], "text"),
GetSQLValueString($_POST['Designation'], "text"),
GetSQLValueString($_POST['IATrainingComplete'], "text"),
GetSQLValueString($_POST['IADate'], "text"));
mysql_select_db($database_group4, $group4);
$Result1 = mysql_query($insertSQL, $group4) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
mysql_select_db($database_group4, $group4);
$query_rsIndividual = "SELECT * FROM individual ORDER BY IndividualNumber ASC";
$rsIndividual = mysql_query($query_rsIndividual, $group4) or die(mysql_error());
$row_rsIndividual = mysql_fetch_assoc($rsIndividual);
$totalRows_rsIndividual = mysql_num_rows($rsIndividual);
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Us</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.header {
font-size: 36px;
text-decoration: underline;
.quote {
font-size: 18px;
font-style: italic;
.tablethisone {
margin: 5px;
padding: 25px;
border: medium none #000;
text-align: center;
</style>
</head>
<body>
<p><img src="Images/EGA.png" width="227" height="222" alt="EGA" /><span class="header">SAAR Tracking System
</span></p>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="index.php">Home</a> </li>
<li><a href="search.php">Search</a></li>
<li><a href="contact.php">Contact Us</a> </li>
</ul>
<p> </p>
<p>PRIVACY ACT STATEMENT</p>
<p>Executive Order 10450, 9397; and Public Law 99-474, the Computer Fraud and Abuse Act.
To record names, signatures, and other identifiers for the purpose of validating the trustworthiness of individuals requesting
access to Department of Defense (DoD) systems and information. NOTE: Records may be maintained in both electronic
and/or paper form.</p>
<p> </p>
<p> </p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Grade:</td>
<td><input type="text" name="Grade" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">LastName:</td>
<td><input type="text" name="LastName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">FirstName:</td>
<td><input type="text" name="FirstName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">M.I.:</td>
<td><input type="text" name="MI" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Organization:</td>
<td><input type="text" name="Organization" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Office:</td>
<td><input type="text" name="Office" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Department:</td>
<td><input type="text" name="Department" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Phone:</td>
<td><input type="text" name="Phone" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">EmailAddress:</td>
<td><input type="text" name="EmailAddress" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">JobTitle:</td>
<td><input type="text" name="JobTitle" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">OfficialMailing Address:</td>
<td><input type="text" name="OfficialMailing_Address" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Citizenship:</td>
<td><input type="text" name="Citizenship" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Designation:</td>
<td><input type="text" name="Designation" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">IATrainingComplete:</td>
<td><input type="text" name="IATrainingComplete" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">IADate:</td>
<td><input type="text" name="IADate" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Insert record" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Disclosure of this information is voluntary; however, failure to provide the requested information may impede, delay or
prevent further processing of this request.</p>
<p class="quote">"Be polite, be professional, but have a plan to kill everybody you meet" General James Mattis</p>
<p> </p>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
<?php
mysql_free_result($rsIndividual);
?> -
Dreamweaver Error when using Record Insertion Form Wizard
This is the error I'm getting:
While executing onLoad in ServerObject-InsRecPHP.htm, the following JavaScript error(s) occured:
At line 283 of file "C:Program Files (x86)\Adobe\Adobe Dreamweaver CS4\Configuration\Commands\ServerObject-FormCmnPHP.js":
invalid array length
The strange thing is, that I've added a form using the wizard before and had no problems. But I deleted the form and wanted to create a new one using the wizard again. And that's when I got the error. I tried this on another computer and got the same error.
Please help, this is very aggrevating.
*Also, I've done the same thing on multiple computers and get the same error.
I've tried deleting the file cache in the configuration folder as instructed by an individual who was talking about JavaScript errors and it still doesn't work.
Message was edited by: PJP2123I know its 4 years later but I just got the same error. after several hours of debugging i found the issue was in my database.
I have fields named - length, width, height, weight.
I fixed it by changing them to Lamplength, lampwi etc
hope that helps anyone else in the future. -
Error in Multi Record Form. Record has been updated by another User?
Hi,
I ma developing Form with 3 blocks (Control Block, Database Block, Button Block). In the Button Block i am updating one Row by calling Program Units as shown below
Select Print Id into Flag From <Table Name> Where <Conditions> For Update of <Column Name>. after calling this , i created another Program Unit as
Update <Table Name>I assume that the table in your update statement is the same table as the one you based your block on.
You are manually updating the table, and Forms see this as an update "by another user" (even though it's you). To see the changes you made in your update statement, you have to re-query.
So, don't update yourself, let Forms do it. If you base a block on a table, everything is done for you by Forms. -
Dreamweaver CS4 - Record Insertion Form js error
Hi
I'm dreamweaver cs4 and started using the Record Insertion form, I was mainly experimenting with it and just seeing what it could do.
However when I get to the wizard i have to wait a few seconds for it to connect to the database and then I get an error message that says:
While executing onLoad in ServerObject-InsRecPHP.htm, the following Javascript error(s) occured:
At line 283 of the file "Macintosh HD:Application:Adobe Dreamweaver
CS4:Configuration:Commands:ServerObject-FormCmnPHP.js":
invalid array length
I was just wondering if this was a common problem, or I've messed something up either in Dreamweaver, or in the SQL database that I'm using.
I've also noticed that its the same for Update and Delete Records Wizards aswell.
Any help would be greatly appreciated
Aaron KennedyI see it's your first post. Welcome to the forum.
A good place to start looking for answers is the Dreamweaver FAQ. You'll find the answer to your question under "Crashes, installation, JavaScript, and unexplained problems". -
Error: Data cannot be inserted as there is no matching record
Hi,
I have migrated SharePoint 2010 site to SharePoint 2013.
I have a custom list, which i was able to do edit multiple records after "opening in Access" in SharePoint 2010.
After the migration, when i open the list in "open with Access", and try to modify any data, I am getting the error "Data cannot be inserted as there is no matching record". The custom list has columns which are taken from lookup list.
I have tried the re-link the list, which has not helped.
Found this: For some of the lookup colums, for which the data is empty, it is getting shown as 0.
This is causing the issue.
How to fix this?
ThanksHi Venkatzeus,
According to your description, my understanding is that the error occurred when you open the list with Access after migrating SharePoint 2010 to SharePoint 2013.
Did this issue occur with other lists?
I recommend to create a new blank database in Access and then import the list into the new one to see if the issue still occurs.
For test, I recommend to test the same scenario with a new list to narrow the issue scope.
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
How to get count of records inserted and errored out in an email
Hi
I have following question
I want to send report statics of scenario i.e Number of rows inserted during the scenario and
Number of rows in error in the scenario in an email.Here in my scenario I am trying to insert data into Essbase database and when i try to use getNbInserts() and getNbErrors functions of ODI in an email body,its giving zero value even though there 140 records inserted and 10 errored out.Can any one let me know how we get this number of records inserted and number of records errored in email.
Thanks in advance
Regards
BajiHi
I have following question
I want to send report statics of scenario i.e Number of rows inserted during the scenario and
Number of rows in error in the scenario in an email.Here in my scenario I am trying to insert data into Essbase database and when i try to use getNbInserts() and getNbErrors functions of ODI in an email body,its giving zero value even though there 140 records inserted and 10 errored out.Can any one let me know how we get this number of records inserted and number of records errored in email.
Thanks in advance
Regards
Baji -
Issue with trigger, multi-table insert and error logging
I find that if I try to perform a multi-table insert with error logging on a table that has a trigger, then some constraint violations result in an exception being raised as well as logged:
<pre>
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> create table t1 (id integer primary key);
Table created.
SQL> create table t2 (id integer primary key, t1_id integer,
2 constraint t2_t1_fk foreign key (t1_id) references t1);
Table created.
SQL> exec dbms_errlog.create_error_log ('T2');
PL/SQL procedure successfully completed.
SQL> insert all
2 into t2 (id, t1_id)
3 values (x, y)
4 log errors into err$_t2 reject limit unlimited
5 select 1 x, 2 y from dual;
0 rows created.
SQL> create or replace trigger t2_trg
2 before insert or update on t2
3 for each row
4 begin
5 null;
6 end;
7 /
Trigger created.
SQL> insert all
2 into t2 (id, t1_id)
3 values (x, y)
4 log errors into err$_t2 reject limit unlimited
5 select 1 x, 2 y from dual;
insert all
ERROR at line 1:
ORA-02291: integrity constraint (EOR.T2_T1_FK) violated - parent key not found
</code>
This doesn't appear to be a documented restriction. Does anyone know if it is a bug?Tony Andrews wrote:
This doesn't appear to be a documented restriction. Does anyone know if it is a bug?Check The Execution Model for Triggers and Integrity Constraint Checking.
SY. -
Number of record with multi-table insert
Hi,
I need to insert into 3 different tables from one big source table so I decided to use multi-table insert. I could use three inserts statements but the source table is an external table and I would prefer not reading it three times.
I wonder if there is a way to get the exact number of records inserted in each one of the tables?
I tried using rowcount but I all I get is the number of rows inserted in all three tables. Is there a way to get this info without having to execute a "select count" in each table afterward?
Thanks
INSERT /*+ APPEND */
WHEN RES_ENS='PU' THEN
INTO TABLE1
VALUES(CD_ORGNS, NO_ORGNS, DT_DEB, SYSDATE)
WHEN RES_ENS='PR' THEN
INTO TABLE2
VALUES(CD_ORGNS, UNO_ORGNS, DT_DEB, SYSDATE)
ELSE
INTO TABLE3
VALUES(CD_ORGNS, NO_ORGNS, DT_DEB, SYSDATE)
SELECT ES.CD_ORGNS CD_ORGNS, ES.RES_ENS RES_ENS, ES.DT_DEB DT_DEB, ES.NO_ORGNS NO_ORGNS
FROM ETABL_ENSGN_SUP ESI have a large number of data to load in those three tables. I do not want to use PL/SQL (with loops and lines of codes) because I can do the insert directly from the source table and it saves a lot of time.
INSERT /*+APPEND*/
WHEN condition1 THEN
INTO table1
WHEN condition2 THEN
INTO table2
SELECT xx FROM my_table
For example, if my_table has 750000000 rows, I only need to read it once and the INSERT..SELECT is a really fast way to load data.
As I was saying, the only problem I've got, is that I cannot get the number of rows in each table. Do you know a way to get it? -
Check duplicate data entry in multi record block,which is a mandatory field
Dear all,
I have a situation where i have to check duplicate data entry(on a particular field,which is a mandatory field,i.e. it cannot be skipped by user without entering value) while data key-in in a Multi Record block.
As for reference I have used a logic,such as
1>In a When-Validate-Record trigger of that block I am assigning the value of that current item in Table type variable(collection type)
as this trigger fire every time as soon as i leave that record,so its assigning the value of that current time.And this process continues
then
2>In a When-Validate-Item trigger of that corresponding item(i.e. the trigger is at item level) has been written,where it compares the value of that current item and the value stored in Table type variable(collection type) of When-Validate-Record trigger.If the current item value is matched with any value stored in Table type variable I am showing a message of ('Duplicate Record') following by raise_form_trigger failure
This code is working fine for checking duplicate value of that multi record field
The problem is that,if user enter the value in that field,and then goes to next field,enter value to that field and then press 'Enter Query 'icon,the bolth Validate trigger fires.As result first when-validate record fires,which stores that value,and then when-validate-item fires,as a result it shows duplicate record message
Please give me a meaningful logic or code for solving this problem
Any other logic to solve this problem is also welcome@Ammad Ahmed
first of all thanks .your logic worked,but still i have some little bit of problem,
now the requirement is a master detail form where both master and detail is multirecord ,where detail cannot have duplicate record,
such as..........
MASTER:--
A code
A1
A2
DETAIL:--
D code
d1
d2 <-valid as for master A1 , detail d1 ,d2 are not duplicate
d2 <--invalid as as for master A1 , detail d2 ,d2 are duplicate
validation rule: A Code –D Code combination is unique. The system will stop users from entering duplicate D Code for a A Code. Appropriate error message will be displayed.*
actually i am facing a typical problem,the same logic i have been applied in detail section ,its working fine when i am inserting new records.problem starts when i query,after query in ' a ' field say 2 records (i.e. which has been earlier saved) has been pasted,now if i insert a new record with the value exactly same with the already present value in the screen(i.e. value populated after query) its not showing duplicate.................could u tell me the reason?and help me out...............its urgent plzzzzzzzzz
Edited by: sushovan on Nov 22, 2010 4:34 AM
Edited by: sushovan on Nov 22, 2010 4:36 AM
Edited by: sushovan on Nov 22, 2010 8:58 AM -
Saving the record in multi-record block while updating
Hi gurus
I have a table name PT . Its is master table where PT_TYPE IS unique
desc PT
PT_TYPE VARCHAR2(2) unique,
PT_CODE VARCHAR2(4),This is the detail table on which the form is being designed is meant for insert/update/delete.Insert and delete are working fine.
desc PST
PST_PT_type varchar2(2) unique,
PST_A_code Varchar2(3) unique,
PST_A_desc varchar2(10) The form layout is a multi-record form as below and based on PST table with PT_CODE as non-base table item & PST_PT_TYPE
not displayed but its there in the block.
FORM_LAYOUT
PT_CODE PST_A_CODE PST_A_DESC
ASD AS TESTAS
ASD AD TESTAD
ASD DS TESTDS.
Now the problem is when I am querying record through enter-query mode (say by entering PT_CODE 'ASD') and
change one of the base table items(PST_A_CODE or PST_A_DESC) values and commit it. its says '1 records applied and save'
but when I change ONE OF THE PT_CODE(non-base table item) values it says 3 records applied and saved. as the 3 records
are currently displayed when queryingHi Craig,
Both below program unit is in the WHEN-VALIDATE-ITEM of NBT item PT_CODE
--this is to check that valid pt_code is entered
PROCEDURE val_pt_code IS
cursor val_cur is
select pt_code
from pt
where pt_code =:pst.pt_code;
v_dummy varchar2(12);
BEGIN
open val_cur;
fetch val_cur into v_dummy;
if val_cur%notfound then
close val_cur;
warn_alert('Error:The Product Code entered does not exists');
raise form_trigger_failure;
end if;
close val_cur;
END;
--this is to check that particular pt_type value is for the pt_code is selected
PROCEDURE get_pt_type IS
v_pt_type varchar2(2);
begin
select pt_type into v_pt_type
from pt
where pt_code = :pst.pt_code;
:pst.pt_type := v_pt_type;
exception
when no_data_found then
warn_alert('Error:The Syllabus Type does not exists');
raise form_trigger_failure;
end;
-- -
Multi-record stacked itemgroups
Hello,
I have a problem with Designer6, using Headstart6.
I want to generate a multi-record stacked item-group with overflow below. This far everything goes all right. Designer generates a content canvas with a tab-canvas on it. On each tab-page, it generates an item-group. But when I want to compute a sum-function over an item in that item-group, designer decreases the number of records displayed from 10 to 1. (CGEN-1381: Warning: component GRM1 required number of rows 10 reduced to 1)
Can someone help me with this problem?
Martine Vanderveken,
Stienstra.Hi Gerd,
UNDER WHEN-NEW-RECORD-INSTANCE
i used this code
DECLARE
blk_id Block;
BEGIN
/* Lookup the block's internal ID */
blk_id := Find_Block('CURRENCY_MASTER');
/* ** If the block exists (ie the ID is Not NULL) then set
** the three properties for this block. Otherwise signal
** an error. */
IF NOT Id_Null(blk_id) THEN
Set_Block_Property(blk_id,INSERT_ALLOWED,PROPERTY_FALSE);
Set_Block_Property(blk_id,UPDATE_ALLOWED,PROPERTY_FALSE);
Set_Block_Property(blk_id,DELETE_ALLOWED,PROPERTY_FALSE);
ELSE
Message('Block '||'CURRENCY_MASTER'||' does not exist.');
RAISE Form_Trigger_Failure;
END IF;
END;
when queried it restrict from insert/update/delete to all rows
but i want the last record to be enable and can be update/delete
or can insert another record at last.which is not possible with the above code.
help me out pls.! -
Multi table insert and ....tricky problem
I have three account related table
--staging table where all raw records exist
acc_event_stage
(acc_id NUMBER(22) NOT NULL,
event_code varchar2(50) NOT NULL,
event_date date not null);
--production table where valid record are moved from staging table
acc_event
(acc_id NUMBER(22) NOT NULL,
event_code varchar2(50) NOT NULL,
event_date date not null);
--error records from staging are moved in here
err_file
(acc_id NUMBER(22) NOT NULL,
error_code varchar2(50) NOT NULL);
--summary records from production account table
acc_event_summary
(acc_id NUMBER(22) NOT NULL,
event_date date NOT NULL,
instance_flag char(1) not null);
records in the staging table may look like this(I have put it in simple english for ease)
open account A on June 12 8 am
close account A on June 12 9 am
open account A on June 12 11 am
Rules
Account cannot be closed if an open account doesnt exist
account cannot be updated if an open account doesnt exist
account cannot be opened if an open account already exist.
Since I am using
Insert all
when open account record and account already exist
into ...error table
when close account record and open account doesnt exist
into ...error table
else
into account_event table.
select * from acc_event_stage order by ..
wondering if the staging table has records like this
open account A on June 12 8 am
close account A on June 12 9 am
open account A on June 12 11 am
then how can I validate some of the records given the rule above.I can do the validation from existing records (before the staging table data arrived) without any problem.But the tricky part is the new records in the staging table.
This can be easily achieved if I do cursor loop method,but doing a multi table insert looks like a problem
any opinion.?
thx
mIn short,in simple example,
through multi table insert if I insert record in production account event table from
staging account event table,making sure that the record doesnt exist in the production table.This will bomb if 2 open account exist in the current staging table.
It will also bomb if an open account and then close account exist.
etc. -
Cursor Jumping to last record when query mode for Multi-record block.
I have a multi-record block. the seq field has this validation to check that there should not be a gap
in sequence for S_type and cer_dl field.The program unit is as below.
PROCEDURE seq_validation IS
--Validation to check that there is no gaps in sequence for S_TYPE and cer_dl fields
l_value_to_check varchar2(100);
l_seq_found number;
l_curr_sequence number;
l_new_value varchar2(100);
l_found boolean:=FALSE;
l_new_set boolean := FALSE; --s_type and cer_dl are different from previous set.
begin
if trim(:b1.s_type) is not null
or trim(:b1.cer_dl) is not null
then
-- Program continues here only if all the items are not null
-- Get information from record that needs to be validated
l_value_to_check := trim(:b1.s_type) || ':'|| trim(:b1.cer_dl) ;
l_curr_sequence := :sequence;
if :SYSTEM.CURSOR_RECORD = '1' then
---to check sequence is entered as 1 in the first record
message('Error:Sequence should start with 1');
raise form_trigger_failure;
end if;
go_item('b1.XYZ');
else
FIRST_RECORD;
while :SYSTEM.LAST_RECORD != 'TRUE'
loop
l_found := FALSE;
l_new_value := trim(:b1.S_type) || ':'|| trim(:cer_dl) ;
if l_new_value = l_value_to_check then --
l_new_set:= FALSE;
l_seq_found := :seq;
if l_seq_found >= l_curr_sequence then
go_item('b1.seq');
l_new_set := FALSE;
elsif l_seq_found < l_curr_sequence - 1 then
go_item('b1.sequence');
l_found := FALSE;
elsif l_seq_found = l_curr_sequence - 1 then
l_found:= TRUE;
go_item('b1.xyz); --go to next item
end if;
else
l_new_set := TRUE;
end if;
NEXT_RECORD;
end loop;
if l_new_set then
go_item('b1.xyz'); -- go to next item
else
if not l_found then
message('Error:Sequence should be in order.');
go_item('b1.seq');
raise form_trigger_failure;
end if;
end if;
go_item('b1.xyz'); ---go to next item
end if;
end if;
end;
In the insert mode its working fine(unless you gurus feel to change to make it more perfect.
When I say enter-query and put 'IAS' in the s_type field and then do a execute query it brings all the records of 'IAS'.
Now as I want to update the records, and when I navigate across field(s_type,cer_dl,Seq,xyz) using tab and move the cursor down on second
record(IAS N 2 N), what happens is when I navigate to sequence field the cursor jumps to LAST RECORD( IAS Y 3 N ) of LAST field XYZ.
I am putting the sample record
s_type cer_dl seq xyz
IAS N 1 N
IAS N 2 N
IAS N 3 N
IAS N 4 N
IAS Y 1 N
IAS Y 2 N
IAS Y 3 N
The cursor moves to last record --IAS -Y -3-N when I tab across the second record.When I say enter-query and put 'IAS' in the s_type field...For your validation to work you must not allow users to enter records in the middle of a block, clear records from the block or query specific records. If you allow the users to enter a query then you are allowing 2 of the rules to be broken.
Maybe you are looking for
-
HP LaserJet P3015 Creating its own copy in Control Panel
Hi Everyone, I am new here.I've a HP LaserJet P3015 printer which is connected with my laptop via USB cable. Whenever i connect the cable to another port of the laptop it creates the copy of the printer naming with (Copy 1). Cna anyone help me immedi
-
I have a Pavilion dv6 laptop running MS7pro. The screen recently went black. I am running it using an attached monitor. The backlight is working. I suspect it needs to be re-plugged ie unplugged and then plugged back in. Any suggestions?
-
Hi, I am facing some problem in SFP - Layout it is showing some error "Could not start Layout Designer (see long text)" I have reinstalled the layout designer but still facing the same problem Please help me to sort out this problem. Thanks Krishna.
-
Auto disappearing content using Refresh header?
Hi, We're pushing a CiscoIPPhoneExecute to a phone. The phone requests the page (CiscoIPPhoneText) in the execute request. The requested page needs to allow the user to respond to a question. If the user doesn't answer to the question, the question s
-
So Mavericks reduced some of the Messages app functionality. Specifically, notifcations if my name is used in a chatroom or with direct messages. Now it simply reads "play sound effect when message is recieved." In a large chat room with many partici