cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry <<lastUpdate>> Value from Object

Former Member
0 Kudos

Hello,

in the MainFetch we create a Insert ClientExchange Step for a object ordergroup (AuftragsGruppe).

INSERT INTO IN_AUFTRAGSGRUPPE_EX

(auftragsGruppeNummer, userID, action, tsUpdate)

VALUES

('<<object.auftragsGruppeNummer>>',

'<<user.agentryID>>',

NULL,

'<<lastUpdate>>')

But when we run the MainFetch we get a sql query error:

SQLBEException), SQLQueryError (Fetch "MainFetch" ClientExchange "InsertAuftragsGruppeEx", 3: SA_DBMS_API_Error, DB Code: -

131, DB Text:42000 [Sybase][ODBC Driver][SQL Anywhere]Syntax error near '0000' on line 7, ), query.cpp#145:SQLQuery::run

It seems that the Object have as lastUpdate Value '0000' but we do not greate the object in a gtransaction at the client. We do a initial sync and after this the next sync and nothing between. We expected that the object have as lastUpdate the create date from the initial sync. How can we get a object update or create date.

We use a SQLAnywhere Database as Backend and the Agentry Server 6.1.4.179.

Thanx,

André

Tags edited by: Michael Appleby

Accepted Solutions (1)

Accepted Solutions (1)

sravanthi_polu
Contributor
0 Kudos

Hi,

     Check with below query

<<local lastUpdate=<<if <<eq <<lastUpdate format="%Y">> "0000">>

"<<database.tempdate>>"

else

"<<lastUpdate>>"

>>

>>

INSERT INTO IN_AUFTRAGSGRUPPE_EX

(auftragsGruppeNummer, userID, action, tsUpdate)

VALUES

('<<object.auftragsGruppeNummer>>',

'<<user.agentryID>>',

NULL,

'<<lastUpdate>>')

It may be possible that the value may not be set when a new object instance is created on agentry client.An unset date and time in agentry has a value for the year '0000',this year is not valid and the value would be rejected by the database.The above query  check weather a valid date is used else it takes database default date.

Thanks & Regards,

Sravanthi Polu

Former Member
0 Kudos

Hello,

i try this but the lastUpdate is everytime not set. And so we get everytyme the database.tempdate.

I understnading is that when i synchronise my object to the client, let us say at the time "17.06.2014 11:00:00". Then i do nothing with the object on the client. The insert Statement will get at the next sync the time "17.06.2014 11:00:00" as <<lastUpdate>>. If not everytime when i sync all my AuftragsGruppe will sync again to the client because the lastUpdate will be the tempData and this is lower then the tsUpdate in the Backend.

Thanx,

André

sravanthi_polu
Contributor
0 Kudos

Hi,

      Have you changed the date for back end,if so try with deleting the entries in exchange and time stamp  tables,then perform the sync

Thanks & Regards,

Sravanthi Polu

Former Member
0 Kudos

If the object is locally created then the lastUpdate will be blank.  If you are pulling it from the system connection, the script that downloads the object make sure you have in your select the following:
<<database.getSystemTime>> as lastupdate

This will get the current database system time when the object is download the from the database.

Stephen

Former Member
0 Kudos

Thats it.

Thanx Stephen. I thought the agentry server fills the lastUpdate on his own.

Answers (0)