MySQL Forums
Forum List  »  Stored Procedures

SP runs in Workbench but when called through command line does not behave as expected
Posted by: Some User
Date: February 07, 2023 01:38PM

I have a SP that works fine when called in Workbench. However, when I call it through command line only certain portions of the SP are executed. The INSERT lines are ignored. I have never seen this behavior before. Any thoughts? Again, works fine when called in workbench. I do not believe it is a permissions issue. I am not getting any syntax errors either. The referenced account does other inserts inside this db. The inserted columns are just varchar(12) and usually about 1000 rows. Real simple.


CREATE DEFINER=`importer`@`%` PROCEDURE `client_stage_step1`()
BEGIN

/* In some client files such as bogejt, givens, sniderm, a blank label is created due to a starting comment line before the first actual data line. This removes this line. */
DELETE FROM client_stage
WHERE Label = '';


Truncate client_stage_hold;

/* This is the portion not working */

INSERT INTO client_stage_hold (portfoliocodefile,label,labelvalue)
select distinct a.portfoliocodefile, 'vehicle' as label, 'Wrap' as labelvalue from client_stage a
where a.portfoliocode IN
(select portfoliocode from groupings where groupcode='totaum.grp') AND a.portfoliocode IN (select portfoliocode from groupings where groupcode='wrapacct.grp');


INSERT INTO client_stage_hold (portfoliocodefile,label,labelvalue)
select distinct a.portfoliocodefile, 'vehicle' as label, 'SMA' as labelvalue from client_stage a
where a.portfoliocode IN
(select portfoliocode from groupings where groupcode='totaum.grp') AND NOT a.portfoliocode IN (select portfoliocode from groupings where groupcode='wrapacct.grp');

/* END: This is the portion not working */

INSERT INTO client_stage (portfoliocodefile,label,labelvalue)
SELECT * from client_stage_hold;

Insert into client_stage_hold values('test','test','test');

Truncate client_stage_hold;

UPDATE client_stage
SET portfoliocode = TRIM(trailing '.cli' FROM portfoliocodefile)
WHERE portfoliocodefile = portfoliocodefile;
END

Options: ReplyQuote


Subject
Views
Written By
Posted
SP runs in Workbench but when called through command line does not behave as expected
442
February 07, 2023 01:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.