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



Eftimios Pantzopoulos wrote:
I have looked at the documentation and actually lifted the
original code from the IBM site. The error is occurring during the compilation process, and not the syntax parsing
phase.

Which example? An example of dynamic SQL presumably.? Since the statement is not used in PREPARE or EXECUTE IMMEDIATE, is it not static SQL as compiled in the SQL PROCEDURE? If so, the CONNECT statement documents that the delimited character string "literal form of the password is not allowed in static SQL or REXX." The documentation for SQL0084 suggests that a "CONNECT with constants <ed: literals> specified for user ID and password is not allowed in a precompiled program." Of course that same SQL0084 documentation contradicts the above noted /not allowed in static SQL/ [albeit, I believe, incorrectly; STRSQL is dynamic, and CONNECT is allowed].

I have tried it with and without the begin/end block, to no avail.
<<SNIP>>

In this post, the actual source seems to have been omitted. Was a valid routine-body properly defined yet, as a compound-statement? Simply stating "tried it" does not allow for the review of the actual source that was /tried/. Additionally is /myuser/ the actual token being specified, or is perhaps another real *USRPRF name being used? If not the actual source, then giving munged information might be obfuscating the origin of the problem; e.g. a reserved word in a statement could be origin for a problem [if not delimited]. Similarly for the password as delimited literal, an unlike representation of its specification may obfuscate the origin of the problem; e.g. depending on the interface being used, a /long/ password might extend beyond the limits of the script processor, like the 80-bytes limit in RUNSQLSTM.

connect to misi9001 user myuser; causes the syntax parser to throw: SQL0104 30 4 Position 32 Token ; was not valid.
Valid tokens: USING.

The syntax error should be expected. The syntax diagram does not indicate either clause as optional within the "authorization:" part of the statement; either the full /authorization/ is omitted, or both USER and USING are required per the syntax.

It seems like it's not expecting the password in the statement In fact the EXEC statement hasn't just hidden it. It seems to
have omitted the password and the trailing quote. I'm presuming
that a CONNECT is permitted in a script.

For mention of /script/, does that intend to imply the source for the CREATE statement is being processed by a RUNSQLSTM CL command invocation? The CONNECT is presumably not /in a script/ directly, but in a CREATE PROCEDURE which is in a script; quite different really, as the former is executed and the latter is compiled. Regardless of interface, be sure the connection that is established is to the *LOCAL database, when the CREATE executes; e.g. do not issue a CREATE PROCEDURE in an interactive SQL after a request to CONNECT TO RemoteDB, and on RUNSQLSTM perhaps it is not valid to specify an RDB.

FWiW: Since the server name and user name should be upper-case, although the listing shows they were [but possibly only folded to upper as a side-effect of an attempt to eliminate the password appearing in the listing?], there would be no harm in actually upper casing the values in the source.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.