Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to lint query: OPEN dmsShipmentCursor; #254

Open
martinbos opened this issue Sep 29, 2023 · 2 comments
Open

Unable to lint query: OPEN dmsShipmentCursor; #254

martinbos opened this issue Sep 29, 2023 · 2 comments

Comments

@martinbos
Copy link

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;
@martinbos martinbos changed the title Unable to lint query Unable to lint query: OPEN dmsShipmentCursor; Sep 29, 2023
@joereynolds
Copy link
Owner

Hi, what dialect are you using here? MySQL?

@martinbos
Copy link
Author

Not sure.
I saw similar coding in other scripts, so i used it to create this script. (Already a while ago)

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

No branches or pull requests

2 participants