{"id":69426,"date":"2021-08-20T14:23:05","date_gmt":"2021-08-20T18:23:05","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/firebird-stored-procedure-delphi-2\/"},"modified":"2021-08-20T14:23:05","modified_gmt":"2021-08-20T18:23:05","slug":"firebird-stored-procedure-delphi-2","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=69426","title":{"rendered":"Firebird Stored procedure delphi #2"},"content":{"rendered":"<p>In firebird, the syntax to create TRIGGERs and Stored Procedures is as below:<\/p>\n<p>&#8212;<\/p>\n<p>SET TERM !! ; <br \/>CREATE TRIGGER auto_update_1 FOR DBPATHS <br \/>  after INSERT POSITION 0 <br \/>AS <br \/>BEGIN <br \/>  insert into commission values (100,100); <br \/>END !!  <br \/>SET TERM ; !! <\/p>\n<p>&#8212;<\/p>\n<p>SET TERM !! ;<br \/>CREATE PROCEDURE CountTo10 <br \/>  RETURNS (Cnt INTEGER) <br \/>AS <br \/>BEGIN <br \/>  Cnt = 1;<br \/>   WHILE (Cnt &lt; = 10) DO   <br \/>    Cnt = Cnt + 1; <br \/>END !! <\/p>\n<p>SET TERM ; !!<\/p>\n<p>&#8212;-<br \/>An example how to use stored procedure from delphi is as follows: <br \/>procedure TForm1.Button1Click(Sender: TObject);<br \/>var<\/p>\n<p>result : integer;<br \/>begin<br \/>  if ibdatabase1.Connected = false then<br \/>  begin<\/p>\n<p>    ibdatabase1.Connected := true;<\/p>\n<p>  end;<\/p>\n<p>  with IBStoredProc1 do<br \/>    execproc;<\/p>\n<p>  IBStoredProc1.Transaction.Commit;<\/p>\n<p>  result := IBStoredProc1.Params.ParamValues[&#8216;Cnt&#8217;];<\/p>\n<p>  showmessage(inttostr(result)); <\/p>\n<p>end;<\/p>\n<p> From: http:\/\/sitestree.com\/?p=4727<br \/> Categories:2<br \/>Tags:<br \/> Post Data:2008-07-08 16:53:04<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In firebird, the syntax to create TRIGGERs and Stored Procedures is as below: &#8212; SET TERM !! ; CREATE TRIGGER auto_update_1 FOR DBPATHS after INSERT POSITION 0 AS BEGIN insert into commission values (100,100); END !! SET TERM ; !! &#8212; SET TERM !! ;CREATE PROCEDURE CountTo10 RETURNS (Cnt INTEGER) AS BEGIN Cnt = 1; &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=69426\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-69426","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":69099,"url":"http:\/\/bangla.sitestree.com\/?p=69099","url_meta":{"origin":69426,"position":0},"title":"Stored Procedure in MySql #5","author":"Author-Check- Article-or-Video","date":"August 12, 2021","format":false,"excerpt":"Starting from MySQL 5, you get Stored Procedure in Mysql What is a stored procedure: A stored procedure is simply a procedure that is stored on the database server like MySQL. In programming languages, you write procedures to execute a function\/logic. You can write similar procedure in SQL and store\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69886,"url":"http:\/\/bangla.sitestree.com\/?p=69886","url_meta":{"origin":69426,"position":1},"title":"Random C# and MS SQl Server #19","author":"Author-Check- Article-or-Video","date":"August 21, 2021","format":false,"excerpt":"Foreign Key in Table Declaration CREATE TABLE ORDERS ( ID integer primary key, Order_Date datetime, Customer_ID integer references CUSTOMER(ID), Amount double); ALTER TABLE ORDERS ADD FOREIGN KEY (customer_id) REFERENCES CUSTOMER(ID); Stored Procedure Example CREATE PROCEDURE [dbo].[procedure_name] @param1 VARCHAR(100) ,@param2 VARCHAR(200) OUTPUT AS BEGIN DECLARE @param3 VARCHAR(100) SET @param3 = '\u2026","rel":"","context":"In &quot;C# - Misc&quot;","block_context":{"text":"C# - Misc","link":"http:\/\/bangla.sitestree.com\/?cat=1973"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70287,"url":"http:\/\/bangla.sitestree.com\/?p=70287","url_meta":{"origin":69426,"position":2},"title":"Random C# and MS SQl Server #.Net Web Applications","author":"Author-Check- Article-or-Video","date":"August 31, 2021","format":false,"excerpt":"Brought from: http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=1321&title=Random%20C#%20and%20MS%20SQl%20Server Foreign Key in Table Declaration CREATE TABLE ORDERS ( ID integer primary key, Order_Date datetime, Customer_ID integer references CUSTOMER(ID), Amount double ); ALTER TABLE ORDERS ADD FOREIGN KEY (customer_id) REFERENCES CUSTOMER(ID); Stored Procedure Example CREATE PROCEDURE [dbo].[procedure_name] @param1 VARCHAR(100) ,@param2 VARCHAR(200) OUTPUT AS BEGIN DECLARE @param3 VARCHAR(100)\u2026","rel":"","context":"In &quot;C# - Misc&quot;","block_context":{"text":"C# - Misc","link":"http:\/\/bangla.sitestree.com\/?cat=1973"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":75827,"url":"http:\/\/bangla.sitestree.com\/?p=75827","url_meta":{"origin":69426,"position":3},"title":"MS SQL Server Dynamic SQl, T-SQL","author":"Sayed","date":"June 25, 2023","format":false,"excerpt":"MS SQL Server Dynamic SQl, T-SQL Mostly: Dynamic SQL Stored Procedure Trigger Cursor Function Sayed Ahmed What are the Most Important Most Used Design ERD Convert ERD to database Normalization Indexing SQL Stored Procedure Dynamic SQL These will come, not too frequent Function, User Defined Data Types, Temporary Table Trigger,\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76092,"url":"http:\/\/bangla.sitestree.com\/?p=76092","url_meta":{"origin":69426,"position":4},"title":"Oracle Stored Procedure: Create a simple stored procedure","author":"Sayed","date":"May 20, 2024","format":false,"excerpt":"Ref: https:\/\/docs.oracle.com\/database\/121\/LNPLS\/create_procedure.htm#LNPLS01373","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-46.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":69107,"url":"http:\/\/bangla.sitestree.com\/?p=69107","url_meta":{"origin":69426,"position":5},"title":"MySQL New Features #5","author":"Author-Check- Article-or-Video","date":"August 12, 2021","format":false,"excerpt":"MySQL New Features Cursor Example:CREATE PROCEDURE p25 (OUT return_val INT)BEGINDECLARE a,b INT;DECLARE cur_1 CURSOR FOR SELECT s1 FROM t;DECLARE CONTINUE HANDLER FOR NOT FOUND < --SET b = 1; <--OPEN cur_1;REPEATFETCH cur_1 INTO a;UNTIL b = 1END REPEAT;CLOSE cur_1;SET return_val = a;END;\/\/ Stored procedure in MySQL http:\/\/www.mysqltutorial.org\/stored-procedures-loop.aspx Loop in stored\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/69426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69426"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/69426\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69426"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}