Does anyone know why the code below compiles ok on v4r2 but does not compile on v5r1? The error msg is below the code.
It seems to require a USING clause now, when before it did not. BTW, the last else stmt passes compile, ie, you can connect without a user or pw, so the security reason does not make sense.
It seems to require a USING clause now, when before it did not. BTW, the last else stmt passes compile, ie, you can connect without a user or pw, so the security reason does not make sense.
Code:
SqlConnect:
EXEC SQL WHENEVER SQLERROR goto SqlCleanup;
if (gServerName[0] != '\0)
{
/* Explicit Connection */
if (gPassword[0] != '\0')
{
EXEC SQL CONNECT TO :gServerName
USER :gUserName
USING :gPassword;
}
else if (gUserName[0] != '\0')
{
EXEC SQL CONNECT TO :gServerName
USER :gUserName; /* <-- error here */
}
else
{
EXEC SQL CONNECT TO :gServerName;
}
}
else
{
/* Implicit Connection */
lRetVal = eConnRetCdNone;
}
}
DIAGNOSTIC MESSAGES
MSG ID SEV RECORD TEXT
SQL0104 30 111 Position 32 Token <END-OF-STATEMENT> was not valid.
Valid tokens: USING.
Message Summary
Total Info Warning Error Severe Terminal
1 0 0 0 1 0
30 level severity errors found in source
341 Source records processed
* * * * * E N D O F L I S T I N G * * * * *
LPAR3 - C10608ZM