Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

amritak94288453
amritak94288453
Offline

Badges

Badges
5

Accepted Solutions

Accepted Solutions
1

Likes

Likes
2

Posts

Posts
2

Discussions

Discussions
0

Questions

Questions
2

Ideas

Ideas
0

Blog Posts

Blog Posts
0
Top badges earned by amritak94288453
Customize the badges you want to showcase on your profile
Re: How to get the id after insert (Auto PK= True)
Avatar
Give Back
Level 1
amritak94288453
Level 1

Likes

2 likes

Total Posts

2 posts

Correct reply

1 solution
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 1
Affirm 1
View profile
amritak94288453
- Adobe Campaign Classic
I was able to achieve it as below . Problem with inserting and then selecting is it does not guarantee the right id because of parallel transactions. So I had to do the below var sql4 = "WITH upd AS (INSERT INTO SamTempOptout (sOldEmail,iBlId,iRId,iOptOut) values ('"+ vOldEmail + "'," + vblId + "," +vrId + "," + vOptOut + ") RETURNING iTempOptoutId) SELECT iTempOptoutId FROM upd ";document.write("sql4 = " + sql4 );ctx.vars.TempOptoutId = String(sqlGetInt(sql4))

Views

722

Like

1

Replies

0
How to get the id after insert (Auto PK= True)
Avatar
Give Back
Level 1
amritak94288453
Level 1

Likes

2 likes

Total Posts

2 posts

Correct reply

1 solution
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 1
Affirm 1
View profile
amritak94288453
- Adobe Campaign Classic
xtk.session.Write();In the above I want to get back the id value for the above schema after the insert. Schema has autopk=truePlease help

Views

878

Like

1

Replies

2
Likes from