Sage X3 provides a special function Writeb to write into a table. It works similar to Write function but it allows us to optimize the performances when several insertions of database lines must be done.

Syntax:

Writeb

Writeb[CLASS]

where,

CLASS: a classidentifier that corresponds to the abbreviation used to open a database table.

Writeb allows you to buffer the lines written in a database table before sending them globally. This instruction should be used when massive inserts are done in a given table.

  • When [S]adxwrb <= 1, Writeb works exactly as Write.

  • When [S]adxwrb > 1, Writeb stores the lines to be written in a buffer, and flushes the buffer by transmitting the data to the database when reaching the buffer size, or when using the Flush

  • If a CLOB or a BLOB is present on the table, Writeb behaves exactly as Write (no buffering is done).

Writeb updates fstatto indicate the result of the write operation only when transmitting the data to the database. It is therefore not possible to identify the line in which the error occurred. The best practice is to run the transaction again with [S]adxwrb set to 1. The fstat value will then be returned after every Writeb.

The values available for status are the following:

fstat value Description
0 The write operation has been successful (or has only been placed for the moment in the write buffer).
1 Lock error on at least a database line.
3 An attempt to create a duplicate key has been detected.

Hope this helps!

 

About Us:

Greytrix is 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.

Greytrix have some unique solutions of Sage X3’s integration with Sage CRM, Salesforce.com and Magento eCommerce. It also offers best-in-class Sage X3 customization and development services to Sage business partners, end users, and Sage PSG worldwide.

For more information on Sage X3 Integration and Services, please contact us at x3@greytrix.com.We will be glad to assist you.

 

Related Posts:

 

Comments are closed.