HI SET, PK is GUID type.
On Wednesday, 14 October 2015 10:51 PM, "setysvar setys...@gmail.com [firebird-support]" <firebird-support@yahoogroups.com> wrote: >>1. EXECUTE BLOCK and there for select and delete >I am completely unaware about execute block. Would you offer any help, so I could learn from it. If PK is your integer primary key for MY_BOOK, then you should be able to do something like this: execute block returns(Changes integer) as declare variable mbPK integer; begin Changes = 0; for select distinct MB.PK from MY_BOOK MB join MY_BOOK_HEADER MBH on MBH.PK_BOOK_HEADER = MB.SK_BOOK_HEADER where MB.BOOK_TYPE = 4 and Upper(Trim(MBH.HEADER_BOOK_CODE)) = Upper(Trim('127518010109038')) --UPPER and TRIM doesn't make any difference to a constant containing only digits and no whitespace... And MBH.FK_BOOK_GROUP = '{79B79C33-CE56-4084-912B-6DD9F70B3DC4}' into :mbPK do begin update My_Book SET BOOK_NAME = 'Book Name1', BOOK_DESCRIPTION = 'Book Description1' where PK = :mbPK; Changes = Changes + ROW_COUNT; end suspend; end 'Changes' and 'suspend' is not required, but whenever I use EXECUTE BLOCK myself, I prefer to add such a variable to ascertain that I only update the ten records I want to update and not one million due to forgetting something important in the JOIN or WHERE clauses. I think execute block can particularly improve performance if a) You only want to reduce a small fraction of the records in My_Book, and/or b) the EXISTS clause is complicated and time consuming If both My_Book and My_Book_Header are small tables with sensible indexing, using execute block may be of little or no help. HTH, Set #yiv2304734592 #yiv2304734592 -- #yiv2304734592ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv2304734592 #yiv2304734592ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv2304734592 #yiv2304734592ygrp-mkp #yiv2304734592hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv2304734592 #yiv2304734592ygrp-mkp #yiv2304734592ads {margin-bottom:10px;}#yiv2304734592 #yiv2304734592ygrp-mkp .yiv2304734592ad {padding:0 0;}#yiv2304734592 #yiv2304734592ygrp-mkp .yiv2304734592ad p {margin:0;}#yiv2304734592 #yiv2304734592ygrp-mkp .yiv2304734592ad a {color:#0000ff;text-decoration:none;}#yiv2304734592 #yiv2304734592ygrp-sponsor #yiv2304734592ygrp-lc {font-family:Arial;}#yiv2304734592 #yiv2304734592ygrp-sponsor #yiv2304734592ygrp-lc #yiv2304734592hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv2304734592 #yiv2304734592ygrp-sponsor #yiv2304734592ygrp-lc .yiv2304734592ad {margin-bottom:10px;padding:0 0;}#yiv2304734592 #yiv2304734592actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv2304734592 #yiv2304734592activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv2304734592 #yiv2304734592activity span {font-weight:700;}#yiv2304734592 #yiv2304734592activity span:first-child {text-transform:uppercase;}#yiv2304734592 #yiv2304734592activity span a {color:#5085b6;text-decoration:none;}#yiv2304734592 #yiv2304734592activity span span {color:#ff7900;}#yiv2304734592 #yiv2304734592activity span .yiv2304734592underline {text-decoration:underline;}#yiv2304734592 .yiv2304734592attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv2304734592 .yiv2304734592attach div a {text-decoration:none;}#yiv2304734592 .yiv2304734592attach img {border:none;padding-right:5px;}#yiv2304734592 .yiv2304734592attach label {display:block;margin-bottom:5px;}#yiv2304734592 .yiv2304734592attach label a {text-decoration:none;}#yiv2304734592 blockquote {margin:0 0 0 4px;}#yiv2304734592 .yiv2304734592bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv2304734592 .yiv2304734592bold a {text-decoration:none;}#yiv2304734592 dd.yiv2304734592last p a {font-family:Verdana;font-weight:700;}#yiv2304734592 dd.yiv2304734592last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv2304734592 dd.yiv2304734592last p span.yiv2304734592yshortcuts {margin-right:0;}#yiv2304734592 div.yiv2304734592attach-table div div a {text-decoration:none;}#yiv2304734592 div.yiv2304734592attach-table {width:400px;}#yiv2304734592 div.yiv2304734592file-title a, #yiv2304734592 div.yiv2304734592file-title a:active, #yiv2304734592 div.yiv2304734592file-title a:hover, #yiv2304734592 div.yiv2304734592file-title a:visited {text-decoration:none;}#yiv2304734592 div.yiv2304734592photo-title a, #yiv2304734592 div.yiv2304734592photo-title a:active, #yiv2304734592 div.yiv2304734592photo-title a:hover, #yiv2304734592 div.yiv2304734592photo-title a:visited {text-decoration:none;}#yiv2304734592 div#yiv2304734592ygrp-mlmsg #yiv2304734592ygrp-msg p a span.yiv2304734592yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv2304734592 .yiv2304734592green {color:#628c2a;}#yiv2304734592 .yiv2304734592MsoNormal {margin:0 0 0 0;}#yiv2304734592 o {font-size:0;}#yiv2304734592 #yiv2304734592photos div {float:left;width:72px;}#yiv2304734592 #yiv2304734592photos div div {border:1px solid #666666;height:62px;overflow:hidden;width:62px;}#yiv2304734592 #yiv2304734592photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv2304734592 #yiv2304734592reco-category {font-size:77%;}#yiv2304734592 #yiv2304734592reco-desc {font-size:77%;}#yiv2304734592 .yiv2304734592replbq {margin:4px;}#yiv2304734592 #yiv2304734592ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv2304734592 #yiv2304734592ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv2304734592 #yiv2304734592ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv2304734592 #yiv2304734592ygrp-mlmsg select, #yiv2304734592 input, #yiv2304734592 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv2304734592 #yiv2304734592ygrp-mlmsg pre, #yiv2304734592 code {font:115% monospace;}#yiv2304734592 #yiv2304734592ygrp-mlmsg * {line-height:1.22em;}#yiv2304734592 #yiv2304734592ygrp-mlmsg #yiv2304734592logo {padding-bottom:10px;}#yiv2304734592 #yiv2304734592ygrp-msg p a {font-family:Verdana;}#yiv2304734592 #yiv2304734592ygrp-msg p#yiv2304734592attach-count span {color:#1E66AE;font-weight:700;}#yiv2304734592 #yiv2304734592ygrp-reco #yiv2304734592reco-head {color:#ff7900;font-weight:700;}#yiv2304734592 #yiv2304734592ygrp-reco {margin-bottom:20px;padding:0px;}#yiv2304734592 #yiv2304734592ygrp-sponsor #yiv2304734592ov li a {font-size:130%;text-decoration:none;}#yiv2304734592 #yiv2304734592ygrp-sponsor #yiv2304734592ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv2304734592 #yiv2304734592ygrp-sponsor #yiv2304734592ov ul {margin:0;padding:0 0 0 8px;}#yiv2304734592 #yiv2304734592ygrp-text {font-family:Georgia;}#yiv2304734592 #yiv2304734592ygrp-text p {margin:0 0 1em 0;}#yiv2304734592 #yiv2304734592ygrp-text tt {font-size:120%;}#yiv2304734592 #yiv2304734592ygrp-vital ul li:last-child {border-right:none !important;}#yiv2304734592