Midrange News for the IBM i Community


Posted by: petemets
RPGLE , Java Oracle problem
has no ratings.
Published: 07 May 2012
Revised: 23 Jan 2013 - 2494 days ago
Last viewed on: 21 Nov 2019 (4766 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

RPGLE , Java Oracle problem Published by: petemets on 07 May 2012 view comments(1)

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: DaleB
Premium member *
Reading, PA
Comment on: RPGLE , Java Oracle problem
Posted: 7 years 6 months 16 days 14 hours 44 minutes ago

Focusing on the line

0268.00                                where from_lic = "licplt"');

Double quotes are used around an identifier. The line, as written, means where the column named from_lic is equal to the value in a column named licplt. If you omit the quotes, where from_lic = licplt, it means the same thing; it assumes licplt is a column name. You typically only need double quotes when your name has embedded spaces, or other special characters.

If you want to compare to the text literal licplt, you need single quotes, where from_lic = 'licplt'. If you need the single quotes, because it's a literal value, you'll need to double them, because they're embedded in an RPG character literal:

0266.00     count = JDBC_ExecUpd(conn:'update sonica.v_host_ship_info +

0267.00                                set upld = "Y" +

0268.00                                where from_lic = ''licplt''');


btw, you might also consider adding OPTION(*SRCSTMT) to your H-spec. Your error message would point to line 26600 instead of the mysterious 3084. [Unless you have a compiler listing handy, or you're in the debugger and you've also used DBGVIEW with *LIST, *COPY, or *ALL.]