Download Free Tools for Tally ERP
FREE utilities for Tally Accounting Software

Sunday, July 1, 2007

Creating Procedures in TDL

This post illustrates how to create Procedures in TDL.

TDL Procedures are different from the procedures/functions used in other programming languages. A TDL proceedure is basically a collection of SQL-Columns that is returned to the calling program.

To create a Procedure, you define a Collection that starts with an underscore. Next, SQLValues attribute defines the columns that you require to be returned to the calling program.

Download TDL29
;; PRODUCT: TDL29.TXT
;; PRODUCT-ID: dr205cfa-1e7f-3f9a-32h8-acr50a55436e
;; AUTHOR: Shweta Computers
;;=========================================================================

;; Procedures must begin with _ (underscore) in TDL
;; Procedures return data to the calling program
[Collection: _MyVouchers]
;;This collection is based on the pre-defined type Voucher
Type : Voucher

SQLValues : Voucher Date : $Date
SQLValues : Voucher Type : $VoucherTypeName
SQLValues : Voucher Number : $VoucherNumber
SQLValues : Voucher Reference : $VoucherReference
SQLValues : Voucher Amount : $Amount

Notes:-
1) SQLValues is an attribute that can be used with Collection
definition
2) SQLValues requires TWO parameters
1st Parameter : Column Name
2nd Parameter : Column Value (usually this is a Method/Field Name)

3) Procedures can be invoked using SQLRequest() function of RTSlink DLL
as given below:

Syntax:-
SQLRequest("Call _MyVouchers")

4) For more information on how to use the SQLRequest() function, refer link www.rtslink.com

Tally; Tally Developer and Tally Definition Language are trademarks or registered trademarks of "Tally Solutions", Bangalore.