A BIG THANK YOU SET AGAIN....... YOU ARE A INDIGENOUS.....
On Thursday, 15 October 2015 1:17 PM, "Vishal Tiwari vishuals...@yahoo.co.in [firebird-support]" <firebird-support@yahoogroups.com> wrote: 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 #yiv3103858295 #yiv3103858295 -- #yiv3103858295ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv3103858295 #yiv3103858295ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv3103858295 #yiv3103858295ygrp-mkp #yiv3103858295hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv3103858295 #yiv3103858295ygrp-mkp #yiv3103858295ads {margin-bottom:10px;}#yiv3103858295 #yiv3103858295ygrp-mkp .yiv3103858295ad {padding:0 0;}#yiv3103858295 #yiv3103858295ygrp-mkp .yiv3103858295ad p {margin:0;}#yiv3103858295 #yiv3103858295ygrp-mkp .yiv3103858295ad a {color:#0000ff;text-decoration:none;}#yiv3103858295 #yiv3103858295ygrp-sponsor #yiv3103858295ygrp-lc {font-family:Arial;}#yiv3103858295 #yiv3103858295ygrp-sponsor #yiv3103858295ygrp-lc #yiv3103858295hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv3103858295 #yiv3103858295ygrp-sponsor #yiv3103858295ygrp-lc .yiv3103858295ad {margin-bottom:10px;padding:0 0;}#yiv3103858295 #yiv3103858295actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv3103858295 #yiv3103858295activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv3103858295 #yiv3103858295activity span {font-weight:700;}#yiv3103858295 #yiv3103858295activity span:first-child {text-transform:uppercase;}#yiv3103858295 #yiv3103858295activity span a {color:#5085b6;text-decoration:none;}#yiv3103858295 #yiv3103858295activity span span {color:#ff7900;}#yiv3103858295 #yiv3103858295activity span .yiv3103858295underline {text-decoration:underline;}#yiv3103858295 .yiv3103858295attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv3103858295 .yiv3103858295attach div a {text-decoration:none;}#yiv3103858295 .yiv3103858295attach img {border:none;padding-right:5px;}#yiv3103858295 .yiv3103858295attach label {display:block;margin-bottom:5px;}#yiv3103858295 .yiv3103858295attach label a {text-decoration:none;}#yiv3103858295 blockquote {margin:0 0 0 4px;}#yiv3103858295 .yiv3103858295bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv3103858295 .yiv3103858295bold a {text-decoration:none;}#yiv3103858295 dd.yiv3103858295last p a {font-family:Verdana;font-weight:700;}#yiv3103858295 dd.yiv3103858295last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv3103858295 dd.yiv3103858295last p span.yiv3103858295yshortcuts {margin-right:0;}#yiv3103858295 div.yiv3103858295attach-table div div a {text-decoration:none;}#yiv3103858295 div.yiv3103858295attach-table {width:400px;}#yiv3103858295 div.yiv3103858295file-title a, #yiv3103858295 div.yiv3103858295file-title a:active, #yiv3103858295 div.yiv3103858295file-title a:hover, #yiv3103858295 div.yiv3103858295file-title a:visited {text-decoration:none;}#yiv3103858295 div.yiv3103858295photo-title a, #yiv3103858295 div.yiv3103858295photo-title a:active, #yiv3103858295 div.yiv3103858295photo-title a:hover, #yiv3103858295 div.yiv3103858295photo-title a:visited {text-decoration:none;}#yiv3103858295 div#yiv3103858295ygrp-mlmsg #yiv3103858295ygrp-msg p a span.yiv3103858295yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv3103858295 .yiv3103858295green {color:#628c2a;}#yiv3103858295 .yiv3103858295MsoNormal {margin:0 0 0 0;}#yiv3103858295 o {font-size:0;}#yiv3103858295 #yiv3103858295photos div {float:left;width:72px;}#yiv3103858295 #yiv3103858295photos div div {border:1px solid #666666;height:62px;overflow:hidden;width:62px;}#yiv3103858295 #yiv3103858295photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv3103858295 #yiv3103858295reco-category {font-size:77%;}#yiv3103858295 #yiv3103858295reco-desc {font-size:77%;}#yiv3103858295 .yiv3103858295replbq {margin:4px;}#yiv3103858295 #yiv3103858295ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv3103858295 #yiv3103858295ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv3103858295 #yiv3103858295ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv3103858295 #yiv3103858295ygrp-mlmsg select, #yiv3103858295 input, #yiv3103858295 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv3103858295 #yiv3103858295ygrp-mlmsg pre, #yiv3103858295 code {font:115% monospace;}#yiv3103858295 #yiv3103858295ygrp-mlmsg * {line-height:1.22em;}#yiv3103858295 #yiv3103858295ygrp-mlmsg #yiv3103858295logo {padding-bottom:10px;}#yiv3103858295 #yiv3103858295ygrp-msg p a {font-family:Verdana;}#yiv3103858295 #yiv3103858295ygrp-msg p#yiv3103858295attach-count span {color:#1E66AE;font-weight:700;}#yiv3103858295 #yiv3103858295ygrp-reco #yiv3103858295reco-head {color:#ff7900;font-weight:700;}#yiv3103858295 #yiv3103858295ygrp-reco {margin-bottom:20px;padding:0px;}#yiv3103858295 #yiv3103858295ygrp-sponsor #yiv3103858295ov li a {font-size:130%;text-decoration:none;}#yiv3103858295 #yiv3103858295ygrp-sponsor #yiv3103858295ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv3103858295 #yiv3103858295ygrp-sponsor #yiv3103858295ov ul {margin:0;padding:0 0 0 8px;}#yiv3103858295 #yiv3103858295ygrp-text {font-family:Georgia;}#yiv3103858295 #yiv3103858295ygrp-text p {margin:0 0 1em 0;}#yiv3103858295 #yiv3103858295ygrp-text tt {font-size:120%;}#yiv3103858295 #yiv3103858295ygrp-vital ul li:last-child {border-right:none !important;}#yiv3103858295