Ignore:
Timestamp:
02/03/2008 08:14:49 PM (18 years ago)
Author:
raverkamp
revision id:
svn-v3-trunk1:1c22b0a8-4d0b-0410-a296-af6a2e6f35e3:plain-odbc%2Ftrunk:10
Message:

adding exec-sql, changes to documentation, more tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cffi/src/test/test-sql-server.lisp

    r1 r5  
    469469
    470470
    471 
    472    
    473      
    474              
     471(defun ss-test23 (con)
     472  (ss-drop-test-proc con "test99")
     473  (exec-command con "
     474     create procedure test99
     475     @p1 integer,
     476     @p2 varchar(200),
     477    @p3 int out,
     478    @p4  varchar(2000) out as
     479   begin
     480      set @p3=3*@p1;
     481      set @p4='a'+ @p2 + '#'+ @p2 +'x'
     482      select @p3 as a,@p4 as b;
     483      select @p4 as bb,@p3 as aa;
     484   end")
     485  (let* ((teststr "abcdefghijklmnopqrstuvwxyz")
     486        (testint 12345678)
     487        (p4 (format nil "a~A#~Ax" teststr teststr))
     488        (p3 (* 3 testint)))
     489   (multiple-value-bind (c resultsets params)
     490       (exec-sql con "{call test99 (?,?,?,?)}"
     491                 testint teststr '(nil :integer :out) '(nil :string :out))
     492     (assert (equal params (list p3 p4)))
     493     (let* ((res1 (first resultsets))
     494            (res2 (second resultsets))
     495            (row1 (first (first res1)))
     496            (row2 (first (first res2))))
     497
     498       (assert (equal row1 (list p3 p4)))
     499       (assert (equal row2 (list p4 p3)))
     500       (assert (equal (second res1) '("a" "b")))
     501       (assert (equal (second res2) '("bb" "aa")))))))
     502
     503
     504
Note: See TracChangeset for help on using the changeset viewer.