while trying to execute the below query in SQL server I am getting an error SQL Error: The executeQuery method must return a result set.
with cte
AS
(
SELECT GUID,seq original_seq_no, ROW_NUMBER()
OVER ( PARTITION BY GUID ORDER BY seq) AS new_seq_no
FROM CHK_SEQ
)
update CHK_SEQ
set CHK_SEQ.seq = r.new_seq_no
from cte r
where CHK_SEQ.seq = r.original_seq_no AND CHK_SEQ.GUID= r.GUID;
can any one please help me with this.
executeQuery method must return a result set
Your query does not return a result set. Is an UPDATE. Use ExecuteNonQuery
instead, executeUpdate
for Java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With