Skip to main content
Solved

Generate a Rowkey while inserting a row


Forum|alt.badge.img+23
  • Superhero (Customer)

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

Best answer by Kelum Pradeep Kumara

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

-Kelum

View original
This topic has been closed for comments

Forum|alt.badge.img+5
  • Hero (Employee)
  • January 7, 2022

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


Yasas Kasthuriarachchi
Superhero (Employee)
Forum|alt.badge.img+30

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


Kelum Pradeep Kumara
Superhero (Employee)
Forum|alt.badge.img+18

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

-Kelum


Forum|alt.badge.img+23
  • Superhero (Customer)
  • January 10, 2022
Kelum Niranjana wrote:

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


Forum|alt.badge.img+11
  • Hero (Employee)
  • January 13, 2022

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.


Forum|alt.badge.img+23
  • Superhero (Customer)
  • January 13, 2022
hhanse wrote:

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


Forum|alt.badge.img+11
  • Hero (Employee)
  • January 13, 2022

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.

 

 


Forum|alt.badge.img+23
  • Superhero (Customer)
  • January 13, 2022
hhanse wrote:

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


Forum|alt.badge.img+11
  • Hero (Employee)
  • January 13, 2022

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings