narasiman rao

narasiman rao

  • NA
  • 519
  • 766.1k

how to increment value and insert into database

Sep 14 2015 1:08 AM
   Query as follows

i have one table as follows control_file
ctrl_type     ctrl_last_no
PKGNO        52

I have another table as follows Co_Package_Master

cpm_pkg_id            pkg_name
PKG00000              EFA+PSSR

First Query as follows
Update control_file set ctrl_last_no = ctrl_last_no + 1 where ctrl_type = 'PKGNO'

Second Query as follows
select * from CONTROL_FILE where ctrl_type = 'PKGNO'

i get the ctrl_last_nor from control file table and increment one value.

i have Co_package_master table in that i want to insert the cpm_pkg_id as follows
PKG0000053

The above 53 value has get from control file and increment one value and want to be store in the co_package_master table.

for that how can i do in asp.net using c#. 

Answers (2)