I have a table as follow:
sno department
1 CS
2 ME
3 EI
I want the output after inserting a row between sno 1 and 2 as
2 IT
3 ME
4 EI
How can i do that?
Discussion posts and replies are publicly visible
Is this a database table? Do you need the renumbering?
yes
in cdt i want to apply this
a!localVariables( local!values: { {sno: 1, department: "CS"}, {sno: 2, department: "ME"}, {sno: 3, department: "EI"} }, a!forEach( items: insert( local!values, {sno: 42, department: "IT"}, 2 ), expression: a!update( data: fv!item, index: "sno", value: fv!index ) ) )
nice solution. I like it!A Note for unexperienced designers: Please consider your target here. Display in table, storing in database afterwards, data manipulations afterwards...this all can effect if this solution is suitable for your specific cause.
Thanks