... to clearify: we are talking about ArdGate
- just follow the examples in the distribution, there you will find:
* Create Command is important!!!
* additional features:
* Parameter Markers for prepared statements
* insert update delete without null indicators
D*B CRTSQLRPGI TESTARDTYP
D*B+ OBJTYPE(*MODULE)
D*B+ COMMIT(*CS)
D*B+ OPTION(*SQL *PERIOD *CVTDT)
D*B+ DBGVIEW(*NONE)
D*B+ DATFMT(*ISO)
D*B+ TIMFMT(*ISO)
D*B+ TOSRCFILE(*CURLIB/QSQLTEMP1)
D*B+ RDB(*LOCAL)
D*B+ COMPILEOPT('DBGVIEW(*SOURCE)')
D*B CRTPGM TESTARDTYP
D*B+ ACTGRP(TESTARDTYP)
* username case sensitive in MYSQL has to be upper case
d myuser s 10 inz('TEST400')
d mypwd s 10 inz('denkste')
d prepareString s 200
d rec e ds extname(testtyp)
d n1 s 4b 0
d n2 s 4b 0
d n3 s 4b 0
d n4 s 4b 0
d n5 s 4b 0
d n6 s 4b 0
d n7 s 4b 0
d n8 s 4b 0
c/exec sql
c+ connect to ardmysql
c+ user :myuser
c+ using :mypwd
c/end-exec
c/exec sql
c+ declare C1
c+ cursor for S1
c/end-exec
/free
prepareString =
'select INTNN, CHARNN, DECNN, NUMERICNN, VARCHARNN'
+ ' , DATENN, TIMENN'
// timestamp works in DB2, does not work with mysql (has no
microseconds)
// + ' , TIMESTAMPNN'
+ ' , INTN, CHARN, DECN, NUMERICN, VARCHARN'
+ ' , DATEN, TIMEN'
// + ' , TIMESTAMPN'
+ ' from testtyp';
/end-free
c/exec sql
c+ prepare S1 from :PrepareString
c/end-exec
c/exec sql
c+ open C1
c/end-exec
c/exec sql
c+ fetch next from C1
c+ into :INTNN, :CHARNN, :DECNN, :NUMERICNN, :VARCHARNN
c+ , :DATENN, :TIMENN
c* , :TIMES00001
c+ , :INTN :N1, :CHARN :N2, :DECN :N3
c+ , :NUMERICN :N4, :VARCHARN :N5
c+ , :DATEN :N6, :TIMEN :N7
c* , :TIMESTAMPN :N8
c/end-exec
* just for adding break point to debugger
c eval user = user
c/exec sql
c+ fetch next from C1
c+ into :INTNN, :CHARNN, :DECNN, :NUMERICNN, :VARCHARNN
c+ , :DATENN, :TIMENN
c* , :TIMES00001
c+ , :INTN :N1, :CHARN :N2, :DECN :N3
c+ , :NUMERICN :N4, :VARCHARN :N5
c+ , :DATEN :N6, :TIMEN :N7
c* , :TIMESTAMPN :N8
c/end-exec
c eval name = name
c/exec sql
c+ commit
c/end-exec
c/exec sql
c+ close C1
c/end-exec
C return
just use the create command, from the beginning in the source, or you could
use the little programm CRTCPP, it will pull teh create commands out of the
source and execute. You could make your own pdm option, or configer the
create command in RDI.
As I stated before, not all parts of embedded SQL are supported, there are
some hints in the docs to be found at SourceForge.
Have fun with ArdGate
Dieter
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: Using SQL CONNECT problem to MS SQL database, (continued)
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.