Skip to content

Fix validate_statement to not rely on hardcoded library#552

Merged
sebjulliand merged 2 commits into
mainfrom
fix/hardcoded-name
Jun 12, 2026
Merged

Fix validate_statement to not rely on hardcoded library#552
sebjulliand merged 2 commits into
mainfrom
fix/hardcoded-name

Conversation

@julesyan

Copy link
Copy Markdown
Member

Changes

Fixes #549, the validate statement component was using a hardcoded library in the source. We have removed the qualifier so it uses the default library of the RUNSQLSTM job (which is already set properly)

How to test this PR

  1. Connect to a system where the temp library is not ILEDITOR
  2. Once connected edit an SQL file to trigger the syntax checker

Checklist

  • have tested my change
  • Remove any/all console.logs I added
  • have added myself to the contributors' list in CONTRIBUTING.md

Signed-off-by: Julia Yan <julia.yan@ibm.com>
@julesyan julesyan requested a review from a team June 12, 2026 17:16
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

👋 A new build is available for this PR based on f587afd.

@SanjulaGanepola

Copy link
Copy Markdown
Member

it uses the default library of the RUNSQLSTM job (which is already set properly)

If we don't qualify it, my understanding would be that it looks it up in the caller's library list or am I wrong about that?

@julesyan

julesyan commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

I tested this with a new library where the only thing in my library list was QGPL and QTEMP, so it looks like its grabbing the correct function @forstie might be able to help more on this

@sebjulliand

Copy link
Copy Markdown
Member

I thinks it's going to be a fun one.
My assumption is it will depend on the naming option of the job.

  • *SYS: it will look in the library list
  • *SQL: it will look in the SQL PATH

Not entirely sure but from my past experience, it was something like that.
And we can't assume what the job configuration is going to be.

For now, it doesn't work (it says "CHKSTMNT0001 of type *N not found in ILEDITORX"):
image

Even though it exists:
image

@SanjulaGanepola

Copy link
Copy Markdown
Member

Why not make the library a parameter on the SQL function we are creating so when we calculate the hash value, it is not dependent on any hardcoded library name?

@sebjulliand

Copy link
Copy Markdown
Member

No, but I'm not sure that would work (assuming IN_LIBRARY is a parameter):

call IN_LIBRARY.CHKSTMNT(...)

Worth a try though!

@julesyan julesyan marked this pull request as draft June 12, 2026 19:52
@julesyan

Copy link
Copy Markdown
Member Author

Yea setting it as a param does not work, i get [SQL0204] CHKSTMNT0001 in LIB type *N not found.

Signed-off-by: Julia Yan <julia.yan@ibm.com>
@julesyan

Copy link
Copy Markdown
Member Author

Ok @sebjulliand if you could test now with your case. This worked on my local but im not sure if im missing a case

@julesyan julesyan marked this pull request as ready for review June 12, 2026 20:54

@sebjulliand sebjulliand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @julesyan , it works like a charm now!
Tested with *SYS and *SQL naming. No issues.

I just had to delete the function because of my previous test, but that won't happen to the users.

@sebjulliand sebjulliand merged commit 87c53a9 into main Jun 12, 2026
1 check passed
@sebjulliand sebjulliand deleted the fix/hardcoded-name branch June 12, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValidateStatement warning message

3 participants