Knowledge Base

Welcome to The Carlisle Group's Knowledge Base.

Search or Ask a Question

This is a keyword search that looks for matching articles that contain one or more words specifically by a user in articles’ tags, title and content. Admin writes brief intro content here via admin end. If you are unable to find an answer to your issue, please submit an issue here.

Back to Articles List

Sample Script - Create a SQLExport from scratch | CAS 6 64-Bit

Added: 11/19/2015; Last Modified: 11/19/2015; Visits:1,199

⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
⍝⍝ Description = 
⍝⍝
⍝⍝ Written By  = The Carlisle Group
⍝⍝ Date        = Nov 19, 2015 12:27
⍝⍝ CAS         = 6.0.346+
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝

 rs←CasSession.GetCurrentFile''
 it←rs.GetItem'\New SQL Export'
 sql←SQLExport.New''

 cfn←StringList.New''
 cfn.Add CharString.New'LOANNUMBER'
 cfn.Add CharString.New'makenum LOANNUMBER'
 cfn.Add CharString.New'RATE'
 cfn.Add CharString.New'makechar RATE'
 cfn.Add CharString.New'UID'

 dt←StringList.New''
 dt.Add CharString.New'char(12)'
 dt.Add CharString.New'int'
 dt.Add CharString.New'decimal(10,2)'
 dt.Add CharString.New'char(10)'
 dt.Add CharString.New'varchar(6)'

 sql.CASFieldNames←cfn
 sql.SQLDataTypes←StringList.New dt
 sql.SQLFieldNames←StringList.New'LOANNUM,LOANNUM_N,RATE,RATE_C,UID'

 sql.RecordSet←rs
 sql.DateAsNull←Boolean.New 0
 sql.UserName←'Username goes here'
 sql.Password←'Password goes here'
 sql.Provider←'{SQL Server Native Client 11.0 - [SQLNCLI11]}'
 sql.DataSource←'Initial Catalog=Database;Data Source=tcp:127.0.0.1'
 sql.Table←'SampleTable'

 l←sql.Execute'Create'