Yesssssssss.......................... YOU ROCKS SET AS USUAL...... WORKING ABSOLUTELY FINE........ Five Stars from my side. ***** You know what I tried with Merge statement as well and that is also fine... merge into MY_BOOK MB using MY_BOOK_HEADER MBH on (MB.SK_BOOK_HEADER = MBH.PK_BOOK_HEADER and MB.BOOK_TYPE = 4 and MBH.HEADER_BOOK_CODE = '127518010109038' and MBH.FK_BOOK_GROUP = '{79B79C33-CE56-4084-912B-6DD9F70B3DC4}') when matched then update set MB.BOOK_NAME = 'Book Name1', MB.BOOK_DESCRIPTION = 'Book Desfcription1'; By the way, you always write HTH, at the end of mail. What does it stands for ? Just for curiosity asking.
On Thursday, 15 October 2015 11:46 AM, "Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]" <firebird-support@yahoogroups.com> wrote: 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 #yiv2415843603 #yiv2415843603 -- #yiv2415843603ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv2415843603 #yiv2415843603ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv2415843603 #yiv2415843603ygrp-mkp #yiv2415843603hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv2415843603 #yiv2415843603ygrp-mkp #yiv2415843603ads {margin-bottom:10px;}#yiv2415843603 #yiv2415843603ygrp-mkp .yiv2415843603ad {padding:0 0;}#yiv2415843603 #yiv2415843603ygrp-mkp .yiv2415843603ad p {margin:0;}#yiv2415843603 #yiv2415843603ygrp-mkp .yiv2415843603ad a {color:#0000ff;text-decoration:none;}#yiv2415843603 #yiv2415843603ygrp-sponsor #yiv2415843603ygrp-lc {font-family:Arial;}#yiv2415843603 #yiv2415843603ygrp-sponsor #yiv2415843603ygrp-lc #yiv2415843603hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv2415843603 #yiv2415843603ygrp-sponsor #yiv2415843603ygrp-lc .yiv2415843603ad {margin-bottom:10px;padding:0 0;}#yiv2415843603 #yiv2415843603actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv2415843603 #yiv2415843603activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv2415843603 #yiv2415843603activity span {font-weight:700;}#yiv2415843603 #yiv2415843603activity span:first-child {text-transform:uppercase;}#yiv2415843603 #yiv2415843603activity span a {color:#5085b6;text-decoration:none;}#yiv2415843603 #yiv2415843603activity span span {color:#ff7900;}#yiv2415843603 #yiv2415843603activity span .yiv2415843603underline {text-decoration:underline;}#yiv2415843603 .yiv2415843603attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv2415843603 .yiv2415843603attach div a {text-decoration:none;}#yiv2415843603 .yiv2415843603attach img {border:none;padding-right:5px;}#yiv2415843603 .yiv2415843603attach label {display:block;margin-bottom:5px;}#yiv2415843603 .yiv2415843603attach label a {text-decoration:none;}#yiv2415843603 blockquote {margin:0 0 0 4px;}#yiv2415843603 .yiv2415843603bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv2415843603 .yiv2415843603bold a {text-decoration:none;}#yiv2415843603 dd.yiv2415843603last p a {font-family:Verdana;font-weight:700;}#yiv2415843603 dd.yiv2415843603last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv2415843603 dd.yiv2415843603last p span.yiv2415843603yshortcuts {margin-right:0;}#yiv2415843603 div.yiv2415843603attach-table div div a {text-decoration:none;}#yiv2415843603 div.yiv2415843603attach-table {width:400px;}#yiv2415843603 div.yiv2415843603file-title a, #yiv2415843603 div.yiv2415843603file-title a:active, #yiv2415843603 div.yiv2415843603file-title a:hover, #yiv2415843603 div.yiv2415843603file-title a:visited {text-decoration:none;}#yiv2415843603 div.yiv2415843603photo-title a, #yiv2415843603 div.yiv2415843603photo-title a:active, #yiv2415843603 div.yiv2415843603photo-title a:hover, #yiv2415843603 div.yiv2415843603photo-title a:visited {text-decoration:none;}#yiv2415843603 div#yiv2415843603ygrp-mlmsg #yiv2415843603ygrp-msg p a span.yiv2415843603yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv2415843603 .yiv2415843603green {color:#628c2a;}#yiv2415843603 .yiv2415843603MsoNormal {margin:0 0 0 0;}#yiv2415843603 o {font-size:0;}#yiv2415843603 #yiv2415843603photos div {float:left;width:72px;}#yiv2415843603 #yiv2415843603photos div div {border:1px solid #666666;height:62px;overflow:hidden;width:62px;}#yiv2415843603 #yiv2415843603photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv2415843603 #yiv2415843603reco-category {font-size:77%;}#yiv2415843603 #yiv2415843603reco-desc {font-size:77%;}#yiv2415843603 .yiv2415843603replbq {margin:4px;}#yiv2415843603 #yiv2415843603ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv2415843603 #yiv2415843603ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv2415843603 #yiv2415843603ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv2415843603 #yiv2415843603ygrp-mlmsg select, #yiv2415843603 input, #yiv2415843603 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv2415843603 #yiv2415843603ygrp-mlmsg pre, #yiv2415843603 code {font:115% monospace;}#yiv2415843603 #yiv2415843603ygrp-mlmsg * {line-height:1.22em;}#yiv2415843603 #yiv2415843603ygrp-mlmsg #yiv2415843603logo {padding-bottom:10px;}#yiv2415843603 #yiv2415843603ygrp-msg p a {font-family:Verdana;}#yiv2415843603 #yiv2415843603ygrp-msg p#yiv2415843603attach-count span {color:#1E66AE;font-weight:700;}#yiv2415843603 #yiv2415843603ygrp-reco #yiv2415843603reco-head {color:#ff7900;font-weight:700;}#yiv2415843603 #yiv2415843603ygrp-reco {margin-bottom:20px;padding:0px;}#yiv2415843603 #yiv2415843603ygrp-sponsor #yiv2415843603ov li a {font-size:130%;text-decoration:none;}#yiv2415843603 #yiv2415843603ygrp-sponsor #yiv2415843603ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv2415843603 #yiv2415843603ygrp-sponsor #yiv2415843603ov ul {margin:0;padding:0 0 0 8px;}#yiv2415843603 #yiv2415843603ygrp-text {font-family:Georgia;}#yiv2415843603 #yiv2415843603ygrp-text p {margin:0 0 1em 0;}#yiv2415843603 #yiv2415843603ygrp-text tt {font-size:120%;}#yiv2415843603 #yiv2415843603ygrp-vital ul li:last-child {border-right:none !important;}#yiv2415843603