Scott,
Thanks for the help. I have to remember it when I next need it.
The SP was supposed to return a result set and that is why it was a problem. Turns out that it would work when messaging was turn off ("SET NOCOUNT = 0"). I don't understand what was happening. To find the problem I asked one of our Java programmers to attempt to access the SP remotely. When he got the same no result set result, it went back to our SQL expert. Then he found that if he turned messaging off, it worked and then I proved that it was working for me also. He moved the turn messaging off to inside of the SP.
Once again, thanks for your help. And thanks for the hint that Java doesn't use null-terminated strings. I'll stop doing that.
Thanks,
Marvin
No trees were killed in the sending of this message, but a large number of electrons were terribly inconvenienced, traumatized, triggered, and crying for their safe spaces.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Thursday, February 01, 2018 12:01 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: Problem in Result Set with No Error
Marvin,
I don't understand why you're manually adding x'00' to your string.
This is not a call to a C routine, so that doesn't make a lot of sense.
(Java does not use null-terminated strings like C does -- unless your application specifically requires this?) Even if it did use null-terminated strings, coding x'00' manually is generally a bad practice unless you're coding for V3r2... you should use
options(*string) instead.
With regards to your question: Errors are printed to the standard error/stdout data streams, not logged somewhere. If you're running this interactively, you'll see them flash on the screen quickly.
You can override them to go to a printer file with commands like these:
OVRPRTF FILE(STDOUT) TOFILE(QSYSPRT) HOLD(*YES) OVRPRTF FILE(STDERR) TOFILE(QSYSPRT) HOLD(*YES)
This would be run before the JVM is started (so start a fresh job if you already loaded Java) and the files won't be closed until the JVM ends, so that'd be at the end of the job.
Having said that... it's also possible that there simply isn't an error.
You say that you're not getting a result set... but many, many, many stored procedures simply don't return result sets, so not having one wouldn't be considered an error.
-SK
On 1/30/2018 10:36 AM, Marvin Radding wrote:
I am trying to execute a stored procedure on a remote system. The request goes through and no error is reported but I have no result set. Where on the AS/400 are the java logs stored or where can I look to see where they are.
Here is the code:
String = 'SP_get_Membership ' + %trim(manager) + x'00';
stmt = JDBC_PrepCall(conn: String);
IsResultSet = jdbc_execCall(stmt);
if not IsResultSet;
return *on;
endif;
return *off;
The connection is good and the stmt has a value but the IsResultSet is zero, which I take to be null and no result set to be retrieve.
I got it to the point there the is no error reported but I get no result set.
Anybody have any ideas where to go now that it seems to work but doesn't?
Thanks,
Marvin
---
This email has been checked for viruses by AVG.
http://www.avg.com
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
Notice: This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. This message may also contain Protected Health Information (PHI) and must be treated confidentially and handled in accordance with HIPAA and other federal and state privacy laws. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately and delete this e-mail (and any accompanying attachments).
As an Amazon Associate we earn from qualifying purchases.