cursor

Navigating the results of a stored procedure via a cursor using T-SQL

微笑、不失礼 提交于 2019-12-07 10:53:59
问题 Due to a legacy report generation system, I need to use a cursor to traverse the result set from a stored procedure. The system generates report output by PRINTing data from each row in the result set. Refactoring the report system is way beyond scope for this problem. As far as I can tell, the DECLARE CURSOR syntax requires that its source be a SELECT clause. However, the query I need to use lives in a 1000+ line stored procedure that generates and executes dynamic sql. Does anyone know of a

Modify Cursor columns value in android

◇◆丶佛笑我妖孽 提交于 2019-12-07 10:42:14
问题 I have a Cursor returned From a SQLiteDataBase object , i can use getXXX() to get the content of columns from the cursor , in my case i want to modify "update" data in the cursor using setXXX() method , i know there is no setXXX() methods , but there is CursorWindow object that have this feature , but i can't use it 回答1: You can't change the cursor. What you can do is update your database and then use the reQuery() method. // code to update your db cursor.requery(); EDIT Further research show

Rare behavior with mongodb cursor (DBCursor) in java, even though last element is already reached

房东的猫 提交于 2019-12-07 10:05:47
问题 I have a collection called MyCollection that contains 200 elements in the bd MyDB in mongodb > use MyDB switched to db MyDB > db.MyCollection.count() 200 I'm getting a really rare behavior, even in the different ways I have used to load the cursor and iterate on it, this is my code: DBCollection collection = getCollection("MyBD", "MyCollection"); DBCursor cursor = collection.find(); //DBCursor cursor = collection.find().limit(200); System.out.println("Cursor length: "+cursor.length());

MySQL Cursor在存储过程中的使用

廉价感情. 提交于 2019-12-07 09:36:48
MySQL Cursor在存储过程中的使用 游标的作用就是用于对查询数据库所返回的记录进行遍历,以便进行相应的操作。 declares a cursor and associates it with a SELECT statement that retrieves the rows to be traversed by the cursor. MySQL supports cursors inside stored programs. The syntax is as in embedded SQL. Cursors have these properties: Asensitive: The server may or may not make a copy of its result table Read only: Not updatable Nonscrollable: Can be traversed only in one direction and cannot skip rows 新建以下表 create table t3( id int not null, num_t int not null, primary key (id) ); create table t4( id int not null, num_tt int not null, primary

cursor.getType() and CursorIndexOutOfBoundsException exception

匆匆过客 提交于 2019-12-07 09:33:40
问题 There is a thing that I can not understand about Cursor.getType() , can anyone explain why do I get this stupid exception when I want to get columns type if cursor has no record but there are columns? I mean, if cursor has record there is no problem, I can use getType method to get columns type without any problem but if there is no any record it throws this exception out. The question is why must I need records to get columns type? Why just knowing columns name is not enough to get types of

When Does Query Returns Null on Android?

主宰稳场 提交于 2019-12-07 09:11:58
问题 I don't seem to find any information on query, insert or any other SQL method returning null. But it does if error occurs. I just wonder whether cursor being null means an error occured or could it mean no rows were selected (for instance)? I don't know how I should treat it - as an error or something that may happen time to time. 回答1: I don't believe you ever need to check if(cursor == null) {} . First If your query doesn't return any rows, you will receive an empty Cursor. The Cursor will

Is there any difference between closing a cursor or a connection in SQLite?

百般思念 提交于 2019-12-07 09:01:19
问题 I have been using always the command cur.close() once I'm done with the database: import sqlite3 conn = sqlite3.connect('mydb') cur = conn.cursor() # whatever actions in the database cur.close() However, I just saw in some cases the following approach: import sqlite3 conn = sqlite3.connect('mydb') cur = conn.cursor() # whatever actions in the database cur.close() conn.close() And in the official documentation sometimes the cursor is closed, sometimes the connection and sometimes both. My

Remove a dragged element and reset cursor with jQuery

笑着哭i 提交于 2019-12-07 08:37:12
问题 I have a problem using drag and drop with jQuery. Here's a very simple fiddle that shows what I mean (http://jsfiddle.net/Znt44/1/): $('#drop').droppable({ drop: function (e, ui) { ui.draggable.remove(); } }); $('#drag').draggable({ cursor: 'move' }); As you see, I set the cursor to a crosshair when dragged, which works. If you drop the green box on the red one, the cursor will not reset. It looks like the cursor is attached to the red box as well, and is not resetted. If you drop the green

Android OnClickListener not firing in GridView (2.2 only)

时光总嘲笑我的痴心妄想 提交于 2019-12-07 08:30:15
问题 I have a grid view of buttons that is generated by a CursorAdapter. When the CursorAdapter is passed to the Gridview the view renders correctly however the first item in the grid does not fire the OnClickListener event. If I select another button in the grid, the event fires correctly however if I selected the first button then another button, it loads the first button action then the section button action. When testing this, it only seems to be an issue in Android 2.2 on my emulator, my 1.5

IE8, IE9, IE10 Blinking Cursor Issue

安稳与你 提交于 2019-12-07 08:09:07
问题 I am making an editor which shows a toolbar on some text selection. The issue that I am facing in IE is that the blinking cursor still shows above the toolbar. This is specifically happening in IE. The blinking cursor comes on top. Here is the sample for this issue: $('.content').mouseup(function(e) { $('.shy').css({ top: e.pageY - 30 + 'px', left: e.pageX - 30 + 'px' }); $('.shy').show(); }); .content { height: 300px; width: 300px; border: 1px solid black; overflow: hidden; word-wrap: break