× 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.



Colin -

Thanks so much! We'll try creating the object somewhere globally accessible.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of colin williams
Sent: Thursday, August 19, 2004 7:20 PM
To: Java Programming on and around the iSeries / AS400
Subject: Re: Error calling QSYS.QCMDEXC

jessica,

the problem is that your command and your SQL run in different background
server jobs, with seperate QTEMPs.
You will have to create your object in a standard library.

cheers
Colin.W
----- Original Message ----- 
From: "Jessica King" <jking@xxxxxxxxxxxxxx>
To: <java400-l@xxxxxxxxxxxx>
Sent: Thursday, August 19, 2004 7:41 PM
Subject: Error calling QSYS.QCMDEXC


> I'm trying to call a CL using QCMDEXC and cannot figure out where my error
> is coming from.
>
>
>
> Code:
>
> AS400 sys = new AS400(system,userId,password);
>
> AS400JDBCDataSource d = new AS400JDBCDataSource(sys);
>
> Connection connection = d.getConnection();
>
> Statement statement = connection.createStatement();
>
> String commandCall = "CLSITE01";
>
> java.text.DecimalFormat formatter = new
> java.text.DecimalFormat("0000000000.00000");
>
> String formattedLength = formatter.format((double)commandCall.length());
>
> String strSQL = "CALL QSYS.QCMDEXC ("; //beginning of string
>
> strSQL = strSQL + "'" + commandCall+ "'";//command call in single quotes
>
> strSQL = strSQL + "," + formattedLength + ")";
>
> System.out.println("Attempting to run sql: " + strSQL);
>
> try {
>
>     // Run the command
>
>     boolean successful = statement.execute(strSQL);
>      //that was line 374
>
> }.
>
>
>
> Output:
>
> Attempting to run sql: CALL QSYS.QCMDEXC ('CLSITE01',0000000008.00000)
>
> SQL issued an exception!
>
> SQLState: 38501
>
> java.sql.SQLException: [CPF0006] Errors occurred in command.
>
>         at
com.ibm.as400.access.JDError.throwSQLException(JDError.java:594)
>
>         at
com.ibm.as400.access.JDError.throwSQLException(JDError.java:565)
>
>         at
>
com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.jav
> a:1269)
>
>         at
>
com.ibm.as400.access.AS400JDBCStatement.execute(AS400JDBCStatement.java:1606
> )
>
>         at
> com.phelon.Global.AS400.CommandRunner.main(CommandRunner.java:374)
>
>
>
> The command executes fine on the AS400 and even works when I use the
> CommandCall object in JTOpen. However, the command creates a table in
QTEMP,
> and if I use a CommandCall object, the table isn't there when I go back
for
> it using SQL. Any ideas?
>
>
>
> Thanks,
>
> Jessica
>
> Client/Server Programmer
>
> MPS-Phelon
>
>
>
****************************************************************************
**********************
> The contents of this email and any attachments are confidential.
> It is intended for the named recipient(s) only.
> If you have received this email in error please notify the system manager
or the
> sender immediately and do not disclose the contents to anyone or make
copies.
>
> ** eSafe scanned this email for viruses, vandals and malicious content **
>
****************************************************************************
**********************
> --
> This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
> To post a message email: JAVA400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.
>
>


This e-mail has been sent by a company of Bertram Group Ltd, whose
registered office is 1 Broadland Business Park, Norwich, NR7 0WF. 
This message, and any attachments, are intended solely for the addressee and
may contain privileged or confidential information.  If you are not the
intended recipient, any disclosure, copying, distribution or any action
taken or omitted to be taken in reliance on it, is prohibited and may be
unlawful.  If you believe that you have received this email in error, please
contact the sender immediately. Opinions, conclusions and statements of
intent in this e-mail are those of the sender and will not bind a Bertram
Group Ltd company unless confirmed in writing by a director independently of
this message. 
Although we have taken steps to ensure that this email and any attachments
are free from any virus, we advise that in keeping with good computing
practice the recipient should ensure they are actually virus free.

--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.

**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or 
the 
sender immediately and do not disclose the contents to anyone or make copies.

** eSafe scanned this email for viruses, vandals and malicious content **
**************************************************************************************************

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.