joereynolds / joereynolds/sql-lint

Unable to lint query: OPEN dmsShipmentCursor;

Open
#254 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
459
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Error on: OPEN dmsShipmentCursor;

sql looks like:

drop procedure if exists fixDMSDeclarations//
create procedure fixDMSDeclarations()
DETERMINISTIC
begin
declare done int default 0;
declare shipmentOID varchar(40);
declare backupShipmentOID varchar(40);
declare itemOID varchar(40);
DECLARE itemCounter INT DEFAULT 0;

declare dmsShipmentCursor cursor for
SELECT OID
FROM cus_nl_dms_cusdec_good_shp
WHERE
`DMS_CUSDEC_GOOD_SHIP_OID` IS NULL
AND dms_cusdec_good_ship_oid_b IS NOT NULL
AND dms_cusdec_good_ship_oid_b IN (SELECT oid FROM cus_nl_dms_cusdec);

declare dmsItemCursor cursor for
SELECT OID, gov_agncy_gdsitm_oid_b
FROM cus_nl_dms_gvagncy_gds_itm
WHERE
GOV_AGNCY_GDSITM_OID IS NULL
AND GOV_AGNCY_GDSITM_INDEX IS NULL
AND gov_agncy_gdsitm_oid_b IS NOT NULL
AND gov_agncy_gdsitm_oid_b IN (SELECT oid FROM cus_nl_dms_cusdec_good_shp)
ORDER BY gov_agncy_gdsitm_oid_b;

declare continue handler for not found set done = 1;

OPEN dmsShipmentCursor;
dmsShipmentLoop: loop

fetch next from dmsShipmentCursor into shipmentOID;
if done = 1 then
leave dmsShipmentLoop;
end if;

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.