Not able to find the function for incrementing an existing value from a SQL query
search cancel

Not able to find the function for incrementing an existing value from a SQL query

book

Article ID: 217832

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

We have to subset the data from source to target in CA Portal but for few fields, we need to increment an existing value and we were not able to do so. Could you please suggest a suitable function for the same.


But we need to use SQL query to pull the data from the source and make it +1 and put it into the target.

For this, how NEXTVAL would work.

We have tried multiple Data generation functions like next val sequence, ~next~, seqlov sqllist connection to DB. But couldn’t get the expected result.

Scenario is – We need to pull the specific column data (Component_ID) of the max value using DB connection SQL query and increment with +1.

For example – If the component ID in the table is 1001 (pulled using SQL query), the generated value sequence should be 1002, 1003, 1004 respectively.

The datatype for the field is Numeric

 

Environment

Release : 4.9

Component : CA Test Data Manager - TDM Web Portal

Cause

N/A

Resolution

This function worked for the customer.

@nextval(NextContractNumber,@add(@execsql(PEB_Contracts_GC,select top 1 ComponentID from EB_Gold_Copy.dbo.GroupComponentDetail order by ComponentID desc)@,1)@)@