Solved

Generate a Rowkey while inserting a row

  • 7 January 2022
  • 9 replies
  • 274 views

Userlevel 7
Badge +22
  • Superhero (Customer)
  • 943 replies

Hello everybody,

I want to developt a new event which reserve a lot in the table RESERVED_LOT_BATCH_TAB.

How can I generate a new rowkey while inserting a new row? Which API do I need?

 

 

Thank you

icon

Best answer by Kelum Pradeep Kumara 7 January 2022, 20:47

View original

This topic has been closed for comments

9 replies

Userlevel 3
Badge +5

@Yasas Kasthuriarachchi - can you please move this topic to Framework & Experience.

Userlevel 7
Badge +30

Thanks @ola.nissen,
Moved to Framework & Experience forum. 

Userlevel 7
Badge +18

Hi @Link 
you can insert the rowkey using sys_guid()
rowkey := sys_guid();

-Kelum

Userlevel 7
Badge +22

Hi @Link 
you can insert the rowkey using sys_guid()
rowkey := sys_guid();

-Kelum


Hi @Kelum Niranjana 

it is really perfect. Thank you a lot.

 

Kind regards

Userlevel 5
Badge +10

Not sure this is the right way… the table should be rowkey enabled. Think this is done somewhere in Solution Manager. When the table is rowkey anabled all old rows will get the rowkey set and all new rowkeys will get the guid automatically by a default value function on the rowkey column.

Userlevel 7
Badge +22

Not sure this is the right way… the table should be rowkey enabled. Think this is done somewhere in Solution Manager. When the table is rowkey anabled all old rows will get the rowkey set and all new rowkeys will get the guid automatically by a default value function on the rowkey column.


Hi @hhanse 

if you create a new object in IFS directly then the rowkey will be generated.

But if you insert a new row with PLSQL or with an event it doesn’t create the rowkey - not in IFS APP 9.

Unless you know an other way. :-)

Userlevel 5
Badge +10

So you mean that Oracle treats row inserts differently depending on if its done through the framework or by PLSQL?  It says in the column definition that if the column is null when inserting a new row, it should set sys_guid()….   or?
But this requires that kowkey in enabled on the table. This is made manually in SolutionManager in older versions if IFS Applications.

 

 

Userlevel 7
Badge +22

So you mean that Oracle treats row inserts differently depending on if its done through the framework or by PLSQL?  It says in the column definition that if the column is null when inserting a new row, it should set sys_guid()….   or?
But this requires that kowkey in enabled on the table. This is made manually in SolutionManager in older versions if IFS Applications.

 

 


Hi @hhanse 

yes, I think so. If I insert a new row (with PLSQL or an event) it doesn’t generate a rowkey. See my first screenshot.

As you can see the table hasn’t a default function:

I don’t know why.

Thank you

Userlevel 5
Badge +10

Again  :sunglasses:  - Table requires that rowkey in enabled on the table. This is made manually in SolutionManager in older versions if IFS Applications.
Per LU:

https://docs.ifs.com/techdocs/Foundation1/040_administration/300_system_information/010_logical_units/default.htm

Or in bulk:

https://docs.ifs.com/techdocs/Foundation1/040_administration/300_system_information/010_logical_units/enable_and_disable_rowkey.htm