NBS Posted October 7, 2008 Report Posted October 7, 2008 query = "INSERT INTO financest (custom_ID, device_NR, subsfee) VALUES ('"& customid &"', "& request("devid") &", "& request("subsfee") &")" response.write(query) link.execute(query) Izvadās INSERT query. query = "SELECT @@IDENTITY AS financ_ID" response.write(query) set exe = link.execute(query) response.write(exe("financ_ID")) Neizvadās financ_ID. Neiegūstu IDENTITY. Palīdziet, lūdzu.
andrisp Posted October 7, 2008 Report Posted October 7, 2008 query = "SELECT 100 AS financ_ID" šitā kaut ko izdrukā ?
NBS Posted October 7, 2008 Author Report Posted October 7, 2008 query = "SELECT 100 AS financ_ID" šitā kaut ko izdrukā ? Jā izvada 100.
andrisp Posted October 7, 2008 Report Posted October 7, 2008 (edited) Esi pārliecināts, ka iekš Access db tāda fiška kā @@IDENTITY vispār ir ? Es zinu, ka tas ir priekš MSSQL. http://www.google.com/search?hl=en&q=a...+last+insert+id Edited October 7, 2008 by andrisp
NBS Posted October 7, 2008 Author Report Posted October 7, 2008 Esi pārliecināts, ka iekš Access db tāda fiška kā @@IDENTITY vispār ir ? Es zinu, ka tas ir priekš MSSQL. http://www.google.com/search?hl=en&q=a...+last+insert+id Es tieši izmantoju MSSQL un palaižot iekšs SQL Query Analyzer: INSERT INTO financest (custom_ID, device_NR, subsfee) VALUES ('270785', 1, 10.6) SELECT @@IDENTITY AS financ_ID Viss forši strādā :(
NBS Posted October 7, 2008 Author Report Posted October 7, 2008 Uzrakstot pat šādu kodu atgriež abos gadījumos tukšumus :( query = "SELECT @@IDENTITY AS financ_ID1" set exe = link.execute(query) response.write("financ_ID1: ") response.write(exe("financ_ID1")) query = "SELECT SCOPE_IDENTITY() AS financ_ID2" set hm = link.execute(query) response.write("financ_ID2: ") response.write(hm("financ_ID2"))
NBS Posted October 8, 2008 Author Report Posted October 8, 2008 Atrisināju problēmu, iepriekšējais query nebija aizvērts, kas tika izsaukts skripta sākumā. Dīvaini it kā nevajadzēja būt problēmas ar to, bet tomēr traucēja tam kaut kas.
Recommended Posts