Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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

asked 11 Feb '18, 15:34

Axel%20Siepmann's gravatar image

Axel Siepmann
294111526
accept rate: 7%

edited 12 Feb '18, 09:33

Reg%20Domaratzki's gravatar image

Reg Domaratzki
7.7k343118

1

Is it really random? If you look at the script, would it be possible for you to check whether the spaces are being inserted every 32k or possibly at some other exponent of 2?

(12 Feb '18, 09:36) Reg Domaratzki
Replies hidden

Nice edit comment, Reg, anyway:)

(12 Feb '18, 09:55) Volker Barth

Maybe it's around pos 16384 if i delete all comments. Not sure...

(12 Feb '18, 10:02) Axel Siepmann

Btw: It seems to happen while copying the text to the task windows in Sybase Central - not while deploying a task to agents.

(12 Feb '18, 10:27) Axel Siepmann

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

permanent link

answered 09 Mar '18, 03:41

Axel%20Siepmann's gravatar image

Axel Siepmann
294111526
accept rate: 7%

edited 12 Mar '18, 04:25

Reimer%20Pods's gravatar image

Reimer Pods
4.5k384891

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..

(14 Mar '18, 09:49) Volker Barth

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

(14 Mar '18, 11:07) Axel Siepmann
Replies hidden

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

(14 Mar '18, 11:33) Volker Barth

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.

(14 Mar '18, 13:03) Axel Siepmann

May i hope for a solution or even an answer?

permanent link

answered 14 Mar '18, 05:57

Axel%20Siepmann's gravatar image

Axel Siepmann
294111526
accept rate: 7%

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

permanent link

answered 27 Aug '19, 03:03

Axel%20Siepmann's gravatar image

Axel Siepmann
294111526
accept rate: 7%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×371

question asked: 11 Feb '18, 15:34

question was seen: 1,743 times

last updated: 27 Aug '19, 03:03