Pl sql updating current record in cursor


A cursor is a pointer that points to a result of a query.

FIRST Returns the first row in the cursor and makes it the current row.If SCROLL is specified in an ISO style DECLARE CURSOR, all FETCH options are supported.When the Transact-SQL DECLARE cursor extensions are used, these rules apply: USE Adventure Works2012; GO DECLARE contact_cursor CURSOR FOR SELECT Last Name FROM Person.WHILE @@FETCH_STATUS = 0 BEGIN -- Concatenate and display the current values in the variables.PRINT ' Contact Name: ' @First Name ' ' @Last Name -- This is executed as long as the previous fetch succeeds.Person WHERE Last Name LIKE ' B%' ORDER BY Last Name; OPEN contact_cursor; -- Perform the first fetch.

You must have an account to comment. Please register or login here!