cancel
Showing results for 
Search instead for 
Did you mean: 

Huge problem deploying tasks to ML Agents SA17.07 3399

axel_siepmann
Participant
2,062

Hi all,

i have a problem deploying a database structure update to ml-clients. Sybase Central obviously puts spaces into my script at random positions...!

Original task: alt text

Deployed task: alt text

This is really ** - i don't need to mention.

Best regards, Axel

Accepted Solutions (0)

Answers (3)

Answers (3)

axel_siepmann
Participant
0 Kudos

Unfortunately this problem still exists in SA 17.10.5866 I'm still not able to deploy a structure update with Sybase Central.

After creating the original task everthing is ok:

alt text

After deploying the task to the first agent there is a blank between then smaler sign and the bigger sign:

alt text

So the whole system for distributing tasks to ML Agent is unusable. What can i do? Should i open a case?

Thanks, Axel

axel_siepmann
Participant
0 Kudos

May i hope for a solution or even an answer?

axel_siepmann
Participant
0 Kudos

I'm still having problems with the deployment of tasks...

I must not use "<>" in SQL-Scripts because they are always disrupted into "< >" with varying count of blanks. I'm using "!=" instead.

This SQL-Script throws an error when executed via agent:

create or replace trigger InsCheckNextAufgTask after insert order 1 on DBA.OBJ_TO_PL 
referencing new as "NewRow" for each row
begin 
  if current remote user is null then
    call "dba"."proc_SetNextObjTaskPl"("NewRow"."obj_id","NewRow"."pl_id") 
  end if
end; 

create or replace trigger UpdCheckNextAufgTask after update order 1 on DBA.OBJ_TO_PL referencing new as "NewRow" old as "OldRow" for each row begin if current remote user is null and "OldRow"."pl_id" != "NewRow"."pl_id" then call "dba"."proc_SetNextObjTaskPl"("NewRow"."obj_id","NewRow"."pl_id") end if end;

create or replace trigger trUpdOStat_aufgabe after update order 1 on DBA.AUFGABE referencing new as NewRow for each row
begin declare err_notfound exception for sqlstate value '02000'; declare PlID char(23); declare ObjID char(23); declare AufgID char(23); declare PL dynamic scroll cursor for select pl_id from dba.pl_to_aufgabe where aufg_id = NewRow.aufg_id; Set AufgID = NewRow.aufg_id; open PL; PlLoop: loop fetch next PL into PlID; if sqlstate = err_notfound then leave PlLoop end if; call dba.proc_UpdNextObjTaskToAufg(AufgID, PlID); end loop PlLoop; close PL; end;

create or replace trigger trDelOStat_aufgabe after delete order 2 on DBA.AUFGABE referencing Old as OldRow for each row begin declare err_notfound exception for sqlstate value '02000'; declare PlID char(23); declare ObjID char(23); declare AufgID char(23); declare PL dynamic scroll cursor for select pl_id from dba.pl_to_aufgabe where aufg_id = OldRow.aufg_id; Set AufgID = OldRow.aufg_id; open PL; PlLoop: loop fetch next PL into PlID; if sqlstate = err_notfound then leave PlLoop end if; call dba.proc_UpdNextObjTaskToAufg(AufgID, PlID); end loop PlLoop; close PL; end;

The error message is "Line 4 had error: Item 'PL' already exists"

If i execute the script directly on the remote database it runs through without any problem.

It seems like the agent does not simply execute the "create trigger" statement but tries to run the trigger instantly oder something like that. I don't understand it. The whole system of remote tasks is not usable!!! 😞

Regards, Axel

VolkerBarth
Contributor
0 Kudos

As this error seems to be related to the cursor variable: Does this also occur if you use a FOR statement instead (which would also be much easier and shorter IMHO)?

Can't comment on the basic question, as I never have used the ML Agent..

axel_siepmann
Participant
0 Kudos

The agent has to run the "creater trigger"-statement, not to declare the cursor, Volker...

VolkerBarth
Contributor
0 Kudos

Yes, I'm aware of that... It's just a wild guess to debug that error...

axel_siepmann
Participant
0 Kudos

I think that's a fundamental error with the agent. It just has to passthrough the statements to the client and that does not work.