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



Figured it out, yet another SQL precompiler bug that I need to report. The 
statement displayed was ok, it was the previous statement that was in 
error.  As this sample from RUNSQLSTM shows better:
      1 CONNECT TO GDWEB USER ROB USING 'keepguessing'; 
      2 INSERT INTO ROB/TESTSQL2 VALUES('c', 'd'); 

MSG ID  SEV  RECORD  TEXT 
SQL0084  30       1  Position 1 SQL statement not allowed.

Soon as I modifed the CONNECT statement in my RPG to use host variables, 
not a problem.  I bet that would be fun with RUNSQLSTM, huh?

Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 




rob@xxxxxxxxx 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
09/23/2003 11:06 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG400-L@xxxxxxxxxxxx
cc

Subject
INSERT generating SQL0084 message






What's wrong with this picture?

     C/EXEC SQL
     C+ INSERT INTO ROB/TESTSQL2 VALUES('c', 'd')
SQL0084S Position 9 SQL statement not allowed.
     C/END-EXEC
      /free
       dsply sqlstate;
       dsply sqlcode;
      /end-free



DSPMSGD RANGE(SQL0084)
        *MSGF(QSYS/QSQLMSG) 

Message . . . . :   SQL statement not allowed. 
Cause . . . . . :   The SQL statement is not allowed for one of the 
following 
  reasons: 
    -- DECLARE CURSOR, DECLARE STATEMENT, FETCH, OPEN, CLOSE, WHENEVER, 
  PREPARE, EXECUTE, EXECUTE IMMEDIATE, INCLUDE, DECLARE TABLE, DECLARE 
  VARIABLE, DECLARE PROCEDURE, and DESCRIBE are not allowed in interactive 

 
  SQL, dynamic SQL, or using the RUNSQLSTM command. 
    -- BEGIN DECLARE SECTION and END DECLARE SECTION are not allowed in 
  interactive SQL, in dynamic SQL, in RPG, or in REXX. 
    -- A blocked INSERT statement is not allowed in interactive SQL or 
dynamic
  SQL. 
    -- The CONNECT, SET CONNECTION, RELEASE, and DISCONNECT statements are 

not
  allowed in dynamic SQL. CONNECT with constants specified for user ID and 

 
password is not allowed in a precompiled program. 
  -- SELECT cannot be issued from an EXECUTE IMMEDIATE statement or the 
RUNSQLSTM command. 
  -- The SET OPTION statement is only allowed in REXX, in a precompiled 
program, or in SQL routines.  In a precompiled program, it must be the 
first
SQL statement in the program. 
  -- DECLARE STATEMENT, DECLARE VARIABLE, DECLARE PROCEDURE, INCLUDE, 
SELECT
INTO, WHENEVER, blocked INSERT, and blocked FETCH statements are not 
allowed
in REXX. 
  -- The SET TRANSACTION statement is not allowed when the current 
connection is to a remote database. 
  -- The SQL statement specified is not a valid statement on the current 
release of DB2 UDB for iSeries.  The statement may be valid on a future 
release of DB2 UDB for iSeries or on a system other than an iSeries.

Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.