{"id":11314,"date":"2018-01-11T08:55:10","date_gmt":"2018-01-11T08:55:10","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=11314"},"modified":"2018-01-11T08:55:10","modified_gmt":"2018-01-11T08:55:10","slug":"how-to-fetch-data-quickly-from-tables","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2018\/01\/11\/how-to-fetch-data-quickly-from-tables\/","title":{"rendered":"How to Fetch Data Quickly From Tables"},"content":{"rendered":"<p>While coding in any programming language, we often use loops like for,while etc. Basically, loops are performed in two cases:<\/p>\n<p>* Read loops on database tables or joins.<br \/>\n* Loops on index values or on a list of values.<\/p>\n<p>Sage X3 provides two special key words to fetch the required data more quickly. Two of them are as follows:<\/p>\n<p><strong>1. First <\/strong><strong>:<\/strong> It is used as a read or update option to define the <strong><em>first<\/em><\/strong> record in the key order.<\/p>\n<p>For eg., Below Sales order &#8216;SONDE0110031&#8217; has three lines. We have fetched first line.<\/p>\n<p>Kindly refer <em>fig. FirstRecordOut <\/em>for the same.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-11315\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/01\/Fetch-Data-Quickly-From-Tables.png\" alt=\"Fetch Data Quickly From Tables\" width=\"474\" height=\"154\" \/><\/p>\n<p style=\"text-align: center\"><em>fig. FirstRecord\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/em><\/p>\n<p>Output:<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/01\/First-Record-Output-1.png\"><img decoding=\"async\" class=\"size-full wp-image-11335 aligncenter\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/01\/First-Record-Output-1.png\" alt=\"First Record Output\" width=\"385\" height=\"139\" \/><\/a><\/p>\n<p><strong>2. Last : <\/strong>\u00a0It is used as a read or update option to define the <strong><em>Last<\/em><\/strong> record in the key order.<\/p>\n<p>For eg., Here, we have fetched the last record from the same sales order as above.<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/01\/LastRecord.png\"><img decoding=\"async\" class=\"size-full wp-image-11336 aligncenter\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/01\/LastRecord.png\" alt=\"Last Record\" width=\"470\" height=\"154\" \/><\/a><\/p>\n<p>Output:<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/01\/Last-Record-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-11338 aligncenter\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/01\/Last-Record-output.png\" alt=\"Last Record output\" width=\"383\" height=\"141\" \/><\/a><\/p>\n<p>Thus, we can fetch the very first and last record from the table using respective key words.<\/p>\n<p><strong>Hope this helps!<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>About Us<\/strong><\/p>\n<p>Greytrix is a one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.<\/p>\n<p><a href=\"http:\/\/www.greytrix.com\/\">Greytrix<\/a>\u00a0has some unique solutions of\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\">Sage X3 integration with Sage CRM<\/a>,\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Salesforce.com<\/a>\u00a0and\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\">Magento eCommerce<\/a> along with Sage X3 migration from Sage 50 US, Sage Pro and QuickBooks. \u00a0We also offer best-in-class\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\">Sage X3 customization and development services<\/a>\u00a0to Sage business partners, end users and Sage PSG worldwide.<\/p>\n<p>For more information on Sage X3 Integration and Services, please contact us at\u00a0<a href=\"mailto:x3@greytrix.com\">x3@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While coding in any programming language, we often use loops like for,while etc. Basically, loops are performed in two cases: * Read loops on database tables or joins. * Loops on index values or on a list of values. Sage X3 provides two special key words to fetch the required data more quickly. Two of\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2018\/01\/11\/how-to-fetch-data-quickly-from-tables\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,8],"tags":[790,794],"class_list":["post-11314","post","type-post","status-publish","format-standard","hentry","category-features","category-sage-erp-x3","tag-fetch-data-quickly-from-tables","tag-fetch-the-required-data"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/11314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=11314"}],"version-history":[{"count":0,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/11314\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=11314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=11314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=11314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}