Simple code to fetch data - but sqlprepare loses my
fetch: Procedure Expose sqlca. sqlconnect.
EventExecutableLog db os TrackingID
query1 = 'select * from EventExecutableLog where
TrackingID = "TrackingID" order by SequenceID'
rc = sqlvariable('NULLSTRINGOUT','<null>')
If sqlprepare('p1',query1) < 0 Then Call Abort 'fetch:
If sqlopen('p1') < 0 Then Call Abort 'fetch: opening'
rc = sqlfetch('p1')
If rc < 0 then Call Abort 'fetch: fetching'
I have reviewed the value in query1 just after it was
defined. At the time the sqlprepare occurs, the value of
query1 looks like the defined code above instead of the
numeric value of TrackingID. If I take the value in
SQLCA.SQLTEXT at the time query1 is created and use
it in the sqlprepare statement - it works.
Am I doing something obviously wrong?