×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Below is part of my SQLRPGLE program.
I am getting SQLSTATE 42703 on the PREPARE statement.
What could it be?
The two ? (dynamic selections) SSAN is numeric and PLANID is char. I have
tried putting quotes around the ? for PLANID, but did not work.
I have copied this SQL into ACS-RSS and it runs fine.
Dcl-C SELECT_ActPlan CONST(' Select e.cobret, +
e.qbnum, e.cobrarnum, e.ssan, +
p.cvglevl, p.cvgtype, p.status, p.planid, +
p.planstrt, p.evntdate3, +
p.fdoc, p.ldoc, +
p.cbrstrt, p.cbrstop, +
p.termdate +
from lib1/cobraE e +
join lib1/cobraP p +
on e.qbnum = p.idnum +
where +
(e.ssan = ? ) +
and (p.planid = ? ) +
and (p.status in ( ''E '', ''ED'', ''E4'', ''TE'')) +
and (to_char(current date,''YYYYMMDD'') between p.PlanStrt +
and (case when p.EvntDAte3 = 0 then 20991231 else p.EvntDate3 end)
+
) +
and (to_char(current date,''YYYYMMDD'') between p.fdoc and p.ldoc) +
AND (to_char(current date,''YYYYMMDD'') between +
p.cbrstrt and p.cbrstop) +
AND ((to_char(current date,''YYYYMMDD'') between +
p.cbrstrt and p.TERMDATE) +
or (p.termdate = 0))');
SqlStmt1 = SELECT_ActPlan;
// Prepare the statement
exec sql
prepare dynStmt1 from SqlStmt1;
// Declare a cursor for the prepared statement
Exec SQL
DECLARE dynCursor1 CURSOR FOR dynStmt1;
// Open the cursor with parameters
Exec SQL
OPEN dynCursor1 USING :w_ssan
,:w_planid;
// Fetch the data into your data structure
Exec SQL
FETCH dynCursor1
INTO :ActPlanDS;
// Check if successful
If SQLSTATE = '00000';
// Process your data
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2026 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.