<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;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 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.EmailStyle21
        {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><span style='mso-fareast-language:EN-US'>Hi,<o:p></o:p></span></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'>Marty; I just tried your suggested syntax and it fails the same way as mine.<o:p></o:p></span></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'>Karl; The columns all match for type (integer2 in this case):<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>Column Name Type Length Nulls Defaults Seq<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dl_no char 9 no no 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dlc_code char 3 no no 2<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dly_prov_cnt integer 2 no no<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dlc_start_dt ingresdate no no<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dlc_end_dt ingresdate no no<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>mto_code integer 1 no no<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dlc_audit_us char 32 no yes<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dlc_audit_dt ingresdate no yes<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>opt_lock_cnt integer 1 no yes<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>agne_code integer 2 no yes<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>dlc_aud_agne integer 2 no yes<o:p></o:p></span></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'>This is the provoking statement:<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";mso-fareast-language:EN-US'>insert into driving_lic_cat values ('16645875','A', 1, date('today'), date('14-may-2020') , 0, 'DRIVERWS',date('now'),0,55,55);\g<o:p></o:p></span></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'>There is a non-updateable view which makes reference to this table but other than that it is uncomplicated.<o:p></o:p></span></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'>Marty, I’ll drop you over a create table statement if you want?<o:p></o:p></span></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'>Karl, is there something I can switch on so I can try and narrow down where it is getting upset?<o:p></o:p></span></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'>Cheers<o:p></o:p></span></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'>Adrian<o:p></o:p></span></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'><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 [</span><a href="mailto:adrian.williamson@rationalcommerce.com"><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma",sans-serif'>mailto:adrian.williamson@rationalcommerce.com</span></a><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma",sans-serif'>] <br><b>Sent:</b> 15 May 2018 14:06<br><b>To:</b> </span><a href="mailto:info-ingres@lists.planetingres.org"><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma",sans-serif'>info-ingres@lists.planetingres.org</span></a><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma",sans-serif'><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>