Skip to content

det: EXEC SQL EXECUTE name USING :host-vars for a prepared INSERT (Part of #4269) - #6040

Merged
squid-protocol merged 2 commits into
mainfrom
churn/4269-20261022T1728Z
Oct 22, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
churn/4269-20261022T1728Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4269.

Checklist: partial [c:fe6377e7] -- DESCRIBE, CONNECT, CALL, host-variable statement text (no burned program uses them)

What

EXEC SQL EXECUTE name USING :h1[:i1], ... for a prepared INSERT ... VALUES (?, ...), in the det port and the oracle precompiler, with DYNDEMO scenarios J-M (bound insert, read back, duplicate -803, null indicator -407).

Design

The det port inlines the USING values as SQL literals into the statement text sent through the existing DetSql.savepoint path. DetSql.java is unchanged, so no existing Db2 port's evidence moves. The oracle binds the host variables natively.
Assumption (Q4 register): literal substitution is equivalent to parameter binding for string and numeric values in an INSERT VALUES list. Refused with a reason: marker/host count mismatch (-313), host structure, USING DESCRIPTOR, markers in EXECUTE IMMEDIATE.

Class table

Member Status
EXECUTE IMMEDIATE (INSERT VALUES) already merged
PREPARE + EXECUTE (no markers) already merged
EXECUTE name USING :hv this PR
EXECUTE USING DESCRIPTOR, DESCRIBE, CONNECT, EXEC SQL CALL refused, no burned program uses them
EXECUTE IMMEDIATE :host-var / host-var PREPARE text refused
dynamic SELECT/UPDATE/DELETE refused (needs row count)

Evidence

Translated: DYNDEMO whole, 0 holes. Executed-equivalent: Db2 e2e DYNDEMO output matches the GnuCOBOL/Db2 oracle for scenarios J-M. pr_gates --fast 7/7, --ratchets 9/9, audit_check clear, det_port check 170/170 unchanged. Oracle is GnuCOBOL plus our stub and Db2, not z/OS. This is breadth on the synthetic DYNDEMO estate; no burned estate issues dynamic SQL.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits October 22, 2026 13:33
… VALUES (Part of #4269)

Parameter markers in a PREPAREd literal INSERT are bound by EXECUTE ... USING
(scalar host variables, optional indicator); the oracle precompiler binds them
as Db2 does and DYNDEMO proves it on Db2. Q4 register updated.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 22, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 22, 2026 17:50
@squid-protocol
squid-protocol enabled auto-merge (squash) October 22, 2026 17:54
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant