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



Hello,

I have a problem with the combination of JDBC and SQL:

A before-update trigger is triggered via JDBC. Within the trigger, a
SELECT to another file is executed via an SQLRPG program.

This dynamic SQL always results in SQLCode -204 for PREPARE.

The library list is set correctly by the trigger at the time of the
SQL-PREPARE.

I have already checked this several times

all other accesses, whether SQL or native to other files, work without me
specifying a library.

It works with named ACTGRP

ACTGRP(*NEW) also works.

And it gets even crazier:

In the two programs, a dynamic SQL is used because there are different
WHERE conditions depending on

PREPARE sSQLFS1 FROM :wksql

DECLARE cSQLFS1 CURSOR FOR sSQLFS1

OPEN cSQLFS1

FETCH NEXT FROM cSQLFS1 INTO :record

CLOSE cSQLFS1

When I read with a static SQL, it works

C/EXEC SQL

C+ select *

C+ into : record

C+ from FILEB

c+ where field1 = :wkfield1

c/end-exec

What is the difference between these two SQL with respect to the LIBL

To me it looks like some circumstance is causing the SQL to revert back to
the LIBL of the JDBC.

Best regards

Jana Reimer

Herzliche Grüße

Jana Reimer

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.