{"id":20723,"date":"2020-09-18T14:26:00","date_gmt":"2020-09-18T14:26:00","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=20723"},"modified":"2020-09-18T14:26:02","modified_gmt":"2020-09-18T14:26:02","slug":"how-to-store-clob-variable-data-to-the-table-through-webservice","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/09\/18\/how-to-store-clob-variable-data-to-the-table-through-webservice\/","title":{"rendered":"How to store CLOB variable data to the table through webservice"},"content":{"rendered":"<p>CLOB stands for Character Large Object, CLOB stores large amounts of character data ,up to 4GB in size. CLOB data may be very large, some database management systems do not store the text directly in the table. Instead, the CLOB field serves as an address, which references the location of the data.<\/p>\n<p>New Stuff:- <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/09\/18\/how-to-increase-no-of-characters-in-line-text-entry-using-import-template\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to increase no. of characters in Line text entry using import template<\/a><\/p>\n<p><strong><u>How to address CLOB in X3 Script file and Screen, tables and reports:<\/u><\/strong><\/p>\n<p>In X3,Clbfile is the keyword used to declare the variables of the type CLOB.<\/p>\n<p><u>Syntax:<\/u><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Local Clbfile Name_of_the_Variable(Length)<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Local Clbfile Name_of_the_Variable(Length)(Dimensions)<\/p>\n<p><strong><u>Example:<\/u><\/strong><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Local Clbfile YMYCLOB(200)<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Local Clbfile YMYCLOB(200)(1..10)<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Dimension: having index range 1 to 10<\/p>\n<p>In X3 ,ACB is the data types that can be used in all the dictionaries where the CLOB data is defined\u00a0 in screen fields, table fields, report setups, etc.<\/p>\n<p>ACB data type stores the information more than 250 characters in the database.<\/p>\n<p>When saving file date to the field of table if you find any &#8220;Text file length too long error&#8221;, then declare the field as ACB to rectify the error.<\/p>\n<p><strong><u>Create Subprogram based Web service:<\/u><\/strong><\/p>\n<p><strong><u>STEP 1: Create a script with subprogram for storing input data to the table.<\/u><\/strong><\/p>\n<p>Create a table named YCLOBTAB with following fields<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"160\">\n<p>S.No<\/p>\n<\/td>\n<td width=\"160\">\n<p>Name of the Field<\/p>\n<\/td>\n<td width=\"160\">\n<p>Datatype<\/p>\n<\/td>\n<td width=\"160\">\n<p>Length<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"160\">\n<p>1<\/p>\n<\/td>\n<td width=\"160\">\n<p>YLEG<\/p>\n<\/td>\n<td width=\"160\">\n<p>A<\/p>\n<\/td>\n<td width=\"160\">\n<p>10<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"160\">\n<p>2<\/p>\n<\/td>\n<td width=\"160\">\n<p>YFILENAM<\/p>\n<\/td>\n<td width=\"160\">\n<p>A<\/p>\n<\/td>\n<td width=\"160\">\n<p>50<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"160\">\n<p>3<\/p>\n<\/td>\n<td width=\"160\">\n<p>YFILESTR<\/p>\n<\/td>\n<td width=\"160\">\n<p>ACB<\/p>\n<\/td>\n<td width=\"160\">\u00a0<\/td>\n<\/tr>\n<tr>\n<td width=\"160\">\n<p>4<\/p>\n<\/td>\n<td width=\"160\">\n<p>YSTA<\/p>\n<\/td>\n<td width=\"160\">\n<p>A<\/p>\n<\/td>\n<td width=\"160\">\n<p>50<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Click on Create and Validate the table in X3.<\/p>\n<p>Create the Script file name: YSAVEENCRYPT and write the subprogram below:<\/p>\n<p>Subprog\u00a0 YSAVECLOB(YLEG,YFILENAM,YFILESTR,YSTA)\u00a0<\/p>\n<p>Value\u00a0\u00a0\u00a0 Char\u00a0\u00a0\u00a0\u00a0 YLEG<\/p>\n<p>Value\u00a0\u00a0\u00a0 Char\u00a0\u00a0\u00a0\u00a0 YFILENAM<\/p>\n<p>Value\u00a0\u00a0\u00a0 Clbfile\u00a0\u00a0 YFILESTR<\/p>\n<p>Variable Char\u00a0\u00a0\u00a0\u00a0 YSTA<\/p>\n<p>##OPENING Table for storing CLOB data FILE<\/p>\n<p>If !clalev([F:YCLB]) Local File YCLOBTAB[F: YCLB] :Endif<\/p>\n<p>####ERROR HANDLING<\/p>\n<p>ONERRGO YCATCH<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[F: YCLB]YLEG \u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0= YLEG<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [F: YCLB]YFILENAM = YFILENAM<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [F: YCLB]YFILESTR \u00a0= YFILESTR<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 WRITE[F: YCLB]\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 YSTA = &#8220;SUCCESS&#8221;<\/p>\n<p>ONERRGO<\/p>\n<p>#####<\/p>\n<p>Close File[F: YCLB]\n<p>End<\/p>\n<p>## ERROR HANDLING CATCH METHOD<\/p>\n<p>$YCATCH<\/p>\n<p>\u00a0\u00a0 YSTA = &#8220;FAIL&#8221;<\/p>\n<p>Resume<\/p>\n<p><strong><u>STEP 2: Create Subprograms by referring script file and subprogram created on step 1<\/u><\/strong><\/p>\n<p>Navigational Path: Development&gt;Script dictionary&gt;Subprograms.<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"932\" height=\"381\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Subprograms.png\" alt=\"Creating Subprograms\" class=\"wp-image-20724\" srcset=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Subprograms.png 932w, https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Subprograms-300x123.png 300w, https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Subprograms-768x314.png 768w, https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Subprograms-660x270.png 660w\" sizes=\"(max-width: 932px) 100vw, 932px\" \/><figcaption>Creating Subprograms<\/figcaption><\/figure>\n\n\n<p>Enter the Script file name in File field &#8220;YSAVEENCRYPT&#8221;<\/p>\n<p>Enter the subprogram name in Subprograms field &#8220;YSAVECLOB&#8221;<\/p>\n<p>Enter the appropriate description in Description field &#8220;Save CLOB data&#8221;<\/p>\n<p>Then click on Create button, then publication button gets enabled then click on publication button to create web service.<\/p>\n<p><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"913\" height=\"395\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Webservices.png\" alt=\"Creating Webservices\" class=\"wp-image-20725\" srcset=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Webservices.png 913w, https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Webservices-300x130.png 300w, https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Webservices-768x332.png 768w, https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/09\/Webservices-660x286.png 660w\" sizes=\"(max-width: 913px) 100vw, 913px\" \/><figcaption>Creating Webservices<\/figcaption><\/figure>\n\n\n<p><strong><u>STEP 4:Invoking the Web service by XML input<\/u><\/strong><\/p>\n<p>For Invoking Webservices, Please refer the blog &#8220;How to invoke Import\/Export Template through Webservices&#8221;<\/p>\n<p>Place the below XML in\u00a0 Input XML\/JSON field<\/p>\n<p>&lt;PARAM&gt;<\/p>\n<p>&lt;GRP ID=&#8221;GRP1&#8243;&gt;<\/p>\n<p>&lt;FLD NAM=&#8221;YSLEG&#8221;\u00a0 TYP=&#8221;Char&#8221;&gt;AUS&lt;\/FLD&gt;<\/p>\n<p>&lt;FLD NAM=&#8221;YSFILENAM&#8221;\u00a0 TYP=&#8221;Char&#8221;&gt;FIL002&lt;\/FLD&gt;<\/p>\n<p>&lt;FLD NAM=&#8221;YSFILESTR&#8221;\u00a0 TYP=&#8221;Clob&#8221;&gt;<\/p>\n<p>hQEMA\/KwatWd7FffAQf\/Zh\/GVgozLWaVOVzVrJT9KZvjJ0QKs4p698zA2oCb9LhK<\/p>\n<p>QRprExhgALKZp7qdtnK5LRC9P1VNt0lKduZ23BjxXWlaxY5V+TwxdAcVXEonWhB2<\/p>\n<p>3SbK9wDjgB1w0zItOC+dz5TEYvzXJMlb9mGqVKwVWqRYYaKgjg3AHF4+iu4VSUns<\/p>\n<p>sImvvOvnNDQ\/3KPX3NE3F3RS9XeTajU4zozbYkry+mcxGbj9wAsNASMLWqBTb2sN<\/p>\n<p>NGG5EAqkqTBxsIbHv+m5J8GZbpTrJgIkiek+shVrH0nNnIGyz6I7bedxIupFY5xQ<\/p>\n<p>lYAuupvuIuSK4DcOuiXazUvKx81kSFGvKTnsadMCcsnBHaOE6dEW9crEd5itDsWE<\/p>\n<p>yJflofoO2WR7B1vQ5O2Vd8pBLJ7xxtt3SVzQToO4921wRd99BROeMfUDVLXwqR5\/<\/p>\n<p>AGUbyw+Y383AFSfdjYvxK2XSW3Fit6JVNZ1SqXVVuMzpyA9+nchkffzL4WiI+p7m<\/p>\n<p>I7VnuAjrltUqTcC+7cd1viTVcH6GD9liaElQnbwVJt12FYOe0JYio9FWOdFPBeIJ<\/p>\n<p>Vhm0RjPm\/fDffbGhPm\/mzkbhJLskRFXek1e\/\/wt9SEmSgJ6U\/erYerfxwOYPDE2n<\/p>\n<p>y3qrP7Kz5ROQn15cU8Fh8zoTBJT53pvAH6GFvpzoQoPyv35Oy1YWulHTRkWoCRoG<\/p>\n<p>kJVbvL2pUftyxZBWc1tufQKZ9VO7s+WqiS1BJWvwj2U1JdbLgbt+1mQXU+T86KHg<\/p>\n<p>xfKTjMBnjZFLKXJxvyn+efx6zfQ5EDiaw7SmsLoQe4stA9RHQcYRuN0UAGR4qxVS<\/p>\n<p>Lm6QAPQImLnz+17Uqt449w5s9OEOlRAva+6aN9tJmp+roeQOT813Mn6BPz51KX65<\/p>\n<p>\/gbPUDRgPp30NQsEDbqusrqLVCCEikYGwLteNNShbz2+IR1mDtsEsDsRFJPNOaaL<\/p>\n<p>t05eLvB4DPjCZWL27lKkOXMeXuj3kzYdXDVyl0YHyw===Z1hp<\/p>\n<p>&lt;\/FLD&gt;<\/p>\n<p>&lt;FLD NAM=&#8221;YSTA&#8221;\u00a0 TYP=&#8221;Char&#8221;&gt;&lt;\/FLD&gt;<\/p>\n<p>&lt;\/GRP&gt;<\/p>\n<p>&lt;\/PARAM&gt;<\/p>\n<p>The field YSFILESTR contains more than 255 characters.<\/p>\n<p><strong><u>STEP 5: Response after invoking Web services<\/u><\/strong><\/p>\n<p>&lt;RESULT&gt;<\/p>\n<p>&lt;GRP ID=&#8221;GRP1&#8243;&gt;<\/p>\n<p>&lt;FLD NAME=&#8221;YSLEG&#8221; TYPE=&#8221;Char&#8221;&gt;AUS&lt;\/FLD&gt;<\/p>\n<p>&lt;FLD NAME=&#8221;YSFILENAM&#8221; TYPE=&#8221;Char&#8221;&gt;FIL002&lt;\/FLD&gt;<\/p>\n<p>&lt;FLD NAME=&#8221;YSFILESTR&#8221; TYPE=&#8221;Clob&#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YPE=&#8221;Char&#8221;&gt;SUCCESS&lt;\/FLD&gt;<\/p>\n<p>&lt;\/GRP&gt;<\/p>\n<p>&lt;\/RESULT&gt;<\/p>\n<p>This blog helps us to understand what is CLOB, what is the keyword used in script and database in X3 and how to store the CLOB data to the table using subprogram based web service.<\/p>\n\n\n<h2 class=\"wp-block-heading\"><strong>About Us<\/strong><\/h2>\n\n\n\n<p>Greytrix \u2013 a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.<\/p>\n\n\n\n<p id=\"block-28013e99-0882-44c6-b705-7b16c85053b2\">Greytrix&nbsp;has some unique integration solutions developed for&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-crm\/\">Sage CRM<\/a>&nbsp;with Sage ERPs&nbsp;namely&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/\">Sage X3<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-intacct\/\">Sage Intacct<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-100-erp\/\">Sage 100<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-500-erp\/\">Sage 500<\/a>,&nbsp;and&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-300-erp\/\">Sage 300<\/a>. We also offer best-in-class&nbsp;Sage ERP&nbsp;and&nbsp;Sage CRM&nbsp;customization and development services&nbsp;to&nbsp;Business&nbsp;Partners,&nbsp;End&nbsp;Users, and Sage PSG worldwide. Greytrix&nbsp;helps in&nbsp;the migration of Sage CRM from&nbsp;Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes&nbsp;addons like&nbsp;&nbsp;Greytrix Business Manager,&nbsp;Sage CRM Project Manager,&nbsp;Sage CRM Resource Planner,&nbsp;Sage CRM Contract Manager,&nbsp;Sage CRM Event Manager,&nbsp;Sage CRM Budget Planner,&nbsp;Gmail Integration,&nbsp;Sage CRM Mobile Service Signature,&nbsp;Sage CRM CTI Framework.<\/p>\n\n\n\n<p id=\"block-4bc42a09-fb13-4598-8137-ce5f7b91ce28\">Greytrix is a recognized&nbsp;Sage Champion Partner&nbsp;for GUMU&#x2122; Sage X3 \u2013 Sage CRM integration listed on&nbsp;<a href=\"https:\/\/www.sage.com\/marketplace\/asb_ListingDetail?listingId=a1h24000007PC3aAAG\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Marketplace<\/a>&nbsp;and Sage CRM \u2013 Sage Intacct integration listed on&nbsp;<a href=\"https:\/\/marketplace.intacct.com\/MPListing?lid=a2D0H000007kiHyUAI\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Intacct Marketplace<\/a>. The&nbsp;<a href=\"https:\/\/www.greytrix.com\/gumu\/\" target=\"_blank\" rel=\"noreferrer noopener\">GUMU&#x2122; Cloud framework<\/a>&nbsp;by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.<\/p>\n\n\n\n<p id=\"block-76376301-1c3e-4250-8a09-727595a606f0\">For more information on our integration solutions, please contact us at&nbsp;<a href=\"mailto:sage@greytrix.com\">sage@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CLOB stands for Character Large Object, CLOB stores large amounts of character data ,up to 4GB in size. CLOB data may be very large, some database management systems do not store the text directly in the table. Instead, the CLOB field serves as an address, which references the location of the data. New Stuff:- How\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/09\/18\/how-to-store-clob-variable-data-to-the-table-through-webservice\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2796],"tags":[3093,3095,333,3096,2409],"class_list":["post-20723","post","type-post","status-publish","format-standard","hentry","category-technical","tag-acb","tag-clbfile","tag-clob","tag-subprogra","tag-webservice"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/20723","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=20723"}],"version-history":[{"count":3,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/20723\/revisions"}],"predecessor-version":[{"id":20747,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/20723\/revisions\/20747"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=20723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=20723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=20723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}