cancel
Showing results for 
Search instead for 
Did you mean: 

MI 7.1: Obtain SYNC_KEY from DB

Former Member
0 Kudos

Hi experts,

I have a problem, i want obtain the SYNC_KEY from DB, but if i do the SELECT SYNC_KEY FROM table the SYNC_KEY appear: "001E4F1D754C1DDD8CC9420C1C8E587E", it has char, and should be only number.

How can convert it?

Thanks in advance,

Accepted Solutions (1)

Accepted Solutions (1)

sivasatyaprasad_yerra
Active Contributor
0 Kudos

Hi,

SYNC_KEY always refers to CHAR32 data element. So, SYNC_KEY may contain characters also. Could you tell me why you need conversion to number.

Regards,

Siva.

Former Member
0 Kudos

If i do a select appear "001E4F1D754C1DDD8CC9420C1C8E587E".

If i obtain the sync_key with the method in MI: tableViewBean.getTableContent(row, 0); appear only number.

If i want modify a row:


	public void modifyRowInDB(
		String syBName,
		String syncKey,
		String newValue,
		int col)
		throws SmartSyncException, PersistenceException {
		String syncBoName = syBName;
		// Set default Syncboname for this example in case value is null.		
		//**		SyncBo syncBo = getSyncBoInstance(syncBoName, syncKey);
		SmartSyncTransactionManager transactionManager;

		// A transaction manager is valid for one action starting with beginTransaction and ending with commit/rollback
		// In this example we commit (save) every modification - no rollback.			
		transactionManager = dataFacade.getSmartSyncTransactionManager();
		transactionManager.beginTransaction();
		//**		setHeaderFieldValue(syncBo, arrayHeaderFieldNames[col], newValue);
		//Commit the transaction		
		transactionManager.commit();
	}

and i send the value: "001E4F1D754C1DDD8CC9420C1C8E587E", it doesn´t understand this sync_key.

Regards,

Edited by: Victor Capi on Jun 10, 2008 12:51 PM

Former Member
0 Kudos

Hi Victor,

you do not modify a row while setting the SyncKey. You select an existing row - use the sync key as select criteria and then leave this value untouched while changing other values in that item....

So first run a select with the key - then you have the row you want to change. Then change this row - and persist it. That is the weay you should do it.

Hope it helps.

Regards,

Oliver

Former Member
0 Kudos

but i want select the value directly from the DB MaxDB in MI 7.1, so, when obtain the SYNC_KEY i don´t receive only number.

Regards,

Former Member
0 Kudos

Yes - that is correct - and you can not change the sync key and you can not create an item with a sync key - nor have an empty item and set the sync key manually. this will not do what you expect!

So you know you want to change the item with sync key "abcde" - so you select the item from the Max DB with SyncKey "abcde". This item you have now - so you change the value of the property name in this item - for example - and save it again.

I do not really get your problem here.

Regards,

Oliver

Answers (0)