This topic is locked

strsqlUpdate

11/22/2007 9:21:00 AM
ASPRunnerPro General questions
S
sagieg author

Hi,
I'm trying to update a table with the spesific id row number that was changed in the site. The code is:
strSQLupdate = "update RBV_WS_CU_V_nts_retail_rates "

strSQLupdate = strSQLupdate & " set Chargeband_Name = tbl.Chargeband_Name, Chargeband_Description = tbl.Chargeband_Description, WholesalePriceClass = tbl.WholesalePriceClass, "

strSQLupdate = strSQLupdate & " Start_Date = tbl.Start_Date, End_Date = tbl.End_Date, Daytime_ppm = tbl.Daytime_ppm, Evening_ppm = tbl.Evening_ppm, "

strSQLupdate = strSQLupdate & " Weekend_ppm = tbl.Weekend_ppm, Daytime_ppc = tbl.Daytime_ppc, Evening_ppc = tbl.Evening_ppc, Weekend_ppc = tbl.Weekend_ppc, Retail_CB = tbl.Retail_CB "

strSQLupdate = strSQLupdate & " from tbl_TEST_NTS_CALC4 tbl "

strSQLupdate = strSQLupdate & " where RBV_WS_CU_V_nts_retail_rates.id "= & "'" & keys("ID") & "'"
strSQLdrop = "drop table tbl_TEST_NTS_CALC4"

strSQLinsert = "select * into tbl_TEST_NTS_CALC4 from TEST_NTS_CALC4"
dbConnection.execute strSQLUpdate

dbConnection.execute strSQLdrop

dbConnection.execute strSQLInsert

  1. does keys("ID") returns the id of the row?
  2. what is wrong with the synatx i'm using
    help is most appriciated,
    Sagie

Sergey Kornilov admin 11/22/2007

What event do you use?
Instead of executing queries I recommend to print them on the page to see if everything looks good.

S
sagieg author 11/25/2007

What event do you use?

Instead of executing queries I recommend to print them on the page to see if everything looks good.


I dont know what you mean by event, please explain <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=23600&image=1&table=forumreplies' class='bbc_emoticon' alt=':unsure:' />
the keys("id") part returns nothing instead of the id of the line that was just updated (this is what im trying to get) all the rest works fine..

Sergey Kornilov admin 11/25/2007

Where do you put this code?

S
sagieg author 12/3/2007

Where do you put this code?


I use it in edit - afteredit - custom

Sergey Kornilov admin 12/3/2007

What version of ASPRunnerPro do you use?

What is the actual name of key column?
Instead of executing the query print it on the web page and post it here.
response.write strSQLUpdate

response.write strSQLdrop

response.write strSQLInsert
'dbConnection.execute strSQLUpdate

'dbConnection.execute strSQLdrop

'dbConnection.execute strSQLInsert

S
sagieg author 12/4/2007

What version of ASPRunnerPro do you use?

What is the actual name of key column?
Instead of executing the query print it on the web page and post it here.
response.write strSQLUpdate

response.write strSQLdrop

response.write strSQLInsert
'dbConnection.execute strSQLUpdate

'dbConnection.execute strSQLdrop

'dbConnection.execute strSQLInsert


I'm using asp pro 5.1 latest build.

the column name is id
and the output of strSQLUpdate is:
update RBV_WS_NTS_CALC_nts_retail_rates set Chargeband_Name = tbl.Chargeband_Name, Chargeband_Description = tbl.Chargeband_Description, WholesalePriceClass = tbl.WholesalePriceClass, Start_Date = tbl.Start_Date, End_Date = tbl.End_Date, Daytime_ppm = tbl.Daytime_ppm, Evening_ppm = tbl.Evening_ppm, Weekend_ppm = tbl.Weekend_ppm, Daytime_ppc = tbl.Daytime_ppc, Evening_ppc = tbl.Evening_ppc, Weekend_ppc = tbl.Weekend_ppc, Retail_CB = tbl.Retail_CB from RBV_WS_NTS_CALC tbl where RBV_WS_NTS_CALC_nts_retail_rates.id = ''
it completely idnores the keys part. I also tries with dict and no results...

Sergey Kornilov admin 12/5/2007

I see what you saying.
You can post your application to Demo Account and send the URL to support@xlinesoft.com along with your order number.