<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">E_OP0897is an internal OPF error. You may be able to rework your syntax to avoid this but it looks like a bug. I suggest you raise an issue with support.<o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Alex<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> info-ingres-bounces@lists.planetingres.org <info-ingres-bounces@lists.planetingres.org>
<b>On Behalf Of </b>Martin Bowes<br>
<b>Sent:</b> 15 May 2018 14:15<br>
<b>To:</b> Adrian Williamson <adrian.williamson@rationalcommerce.com>; info-ingres@lists.planetingres.org<br>
<b>Subject:</b> Re: [Info-ingres] E_OP0897 Consistency Check?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Hi Adrian,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">My first guess would be something like…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">create procedure incrementprvcnt(<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> INOUT provcnt integer2 not null not default<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">as<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">begin<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> provcnt=2;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">end;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">create rule proccntpatch<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">before insert into driving_lic_cat referencing new as newcat<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">where newcat.dlc_audit_us = ‘DRIVERWS’ and newcat.dly_prov_cnt = 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">for each row execute procedure incrementprvcnt(provcnt = newcat.dly_prov_cnt)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">If that doesn’t work send me your table structure and I’ll see what I can do.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Marty<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> Adrian Williamson [<a href="mailto:adrian.williamson@rationalcommerce.com">mailto:adrian.williamson@rationalcommerce.com</a>]
<br>
<b>Sent:</b> 15 May 2018 14:06<br>
<b>To:</b> <a href="mailto:info-ingres@lists.planetingres.org">info-ingres@lists.planetingres.org</a><br>
<b>Subject:</b> [Info-ingres] E_OP0897 Consistency Check?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My goto database ape (DBA) is off driving around Spain at the moment so I was hoping someone could shed some light on how I managed to get this lovely response after I created a rule fired procedure and then provoked it with an insert statement:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">E_OP0897 Consistency Check: a query tree constant or resdom node uses a<o:p></o:p></p>
<p class="MsoNormal"> source/destination type.<o:p></o:p></p>
<p class="MsoNormal"> (Tue May 15 13:54:25 2018)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve not written too many rules in the past, and the trouble is it was in the past. So I fully expect this to be user error somewhere.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is syntax which I got the database to agree to:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">create or replace procedure IncrementPrvCnt(provcnt = i2 not null) as begin provcnt = 2 ;end;\g<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">create rule PrvCntPatch before insert into driving_lic_cat referencing new as newcat
<o:p></o:p></p>
<p class="MsoNormal">where newcat.dlc_audit_us = 'DRIVERWS' and newcat.dly_prov_cnt = 1<o:p></o:p></p>
<p class="MsoNormal">for each row execute procedure IncrementPrvCnt(provcnt = byref(newcat.dly_prov_cnt));<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What have I done wrong?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">i.e. could someone translate the error message into something useful?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Adrian<o:p></o:p></p>
</div>
</body>
</html>