cursor

A cursor with the name … already exists - SQL Server 2008

我的梦境 提交于 2019-12-10 12:34:10
问题 I have a trigger that is used to perform some auditing tasks when changes are made to a table. Within this trigger there is a WHILE loop, and in the loop there is a cursor that is declared, used, closed and then deallocated before the next iteration of the loop. When I call a stored procedure that changes the table and in turn causes the trigger to run, and I do this from within the Management Studio, all works as expected. However, when this stored procedure is called from within my Java web

Android ListView with SimpleCursorAdapter - Crashes onResume

最后都变了- 提交于 2019-12-10 11:47:57
问题 I have a ListView in AcitivityA that is populated using a custom SimpleCursorAdapter called RecipeAdapter . The adapter holds data from SQLite There is a EditText view at the top of the ListView , that filters the listview as the user searches for a recipe. When a user clicks on a item in the filtered ListView , ActivityB starts. This all works perfectly. However when the user presses the backbutton to resume ActivityB , I get the following error. java.lang.IllegalStateException: trying to

Android - SimpleAdapter filter query, how to ignore accents?

ε祈祈猫儿з 提交于 2019-12-10 10:55:44
问题 I am currently using the ContentProvider for contacts to retrieve the contacts from the device and allowing the user to filter the results by typing into an EditText. To do so I have set up a filter query on a SimpleAdapter as follows: contactsAdapter.setFilterQueryProvider(new FilterQueryProvider() { String[] PROJECTION = new String[] { ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts.HAS_PHONE_NUMBER, }; String sortOrder = ContactsContract

resetCursorRects not working (new cursor only flashes as mouse enters)

与世无争的帅哥 提交于 2019-12-10 10:38:42
问题 I'm creating a custom view that needs a special cursor (instead of the usual arrow). I'm using the resetCursorRects to setup the new cursor and its area, but the new cursor only appears briefly when the mouse enters the rect area, returning to arrow. To check things better, I've created a new project, create a new custom view (based on NSView), add it to the window, but the problem remains. The custom view code: #import "TestView.h" @implementation TestView - (void)drawRect:(NSRect)dirtyRect

How to set mouse cursor on X11 in a C application

余生长醉 提交于 2019-12-10 10:15:53
问题 I've got a rather large and rather old C application that has been ported to Linux. I'm in charge of getting mouse cursors to work correctly, but having some issues. I was able to convert most of the cursors we require to using the standard cursors provided by XFontCursor by using something like: gCursorTable[waitCurs] = XCreateFontCursor(gDisplay, XC_watch); ... XDefineCursor(gDisplay, WHostWindow(w), gCursorTable[cursor]); XFlush(gDisplay); This is fine for cursors which have analogs in the

Procedure mysql with cursor is too slow.. Why?

十年热恋 提交于 2019-12-10 10:07:51
问题 I create a Mysql procedure using cursor, but it's run too slow... It's get between 40 and 60 lines by second.. See: DELIMITER $$ CREATE PROCEDURE sp_create(IN v_idsorteio INT,OUT afetados INT) BEGIN DECLARE done INT default 0; DECLARE vc_idsocio INT; DECLARE z INT; DECLARE cur1 CURSOR FOR select IdSocio from socios where Sorteio=1 and Finalizado='S' and CodClientes IS NOT NULL; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done=1; SET z=1; OPEN cur1; FETCH cur1 INTO vc_idsocio; WHILE done

Drag cursor in javascript?

北城以北 提交于 2019-12-10 06:37:17
问题 I need to set the drag cursor in some places but i can' see listened here http://www.w3schools.com/cssref/pr_class_cursor.asp In my case it apears when i drag some image : http://s2.subirimagenes.com/otros/previo/thump_8236773bgform29.jpg Is there a code to use like body{cursor: drag} ? 回答1: You can use the move cursor paramater: .target {cursor:move} That cursor you are asking for is unique, if you want to use one with pure CSS then the best for this case is the move cursor. Edit: For a

Django Backend-neutral DictCursor

耗尽温柔 提交于 2019-12-10 05:39:54
问题 Is there any way to get a backend-neutral dictionary cursor in Django? This would be a cursor that is a dict rather than a tuple. I am forced to use Oracle for the school project I'm working on. in Python's MySQLDb module it's called a DictCursor. With WoLpH's inspiring suggestion I know I am very close.. def dict_cursor(cursor): for row in cursor: yield dict(zip(cursor.description, row)) Iterating and printing each row cursor used to result in: (482072, 602592, 1) (656680, 820855, 2) (574968

Vim: do something in a function based on character under a cursor?

一曲冷凌霜 提交于 2019-12-10 04:35:55
问题 I'm writing a function that edits a certain environment in LaTeX. The environment basically looks like this: \begin{quicktikz} ...some stuff... \end{quicktikz} or like this: \begin*{quicktikz} ...some stuff... \end{quicktikz} I want to write a function that toggles between the two, when called from within the environment. Since my Vim knowledge ain't all that, I'm coming up with a simple solution: Get cursor position with let save_cursor=getpos(".") Backward search for \begin{quicktikz} using

Android how do you code now if requery is deprecated?

泄露秘密 提交于 2019-12-10 03:54:15
问题 as per the topic. If we used to call cursor.requery(), but it is now deprecated, how do you call this function now? "This method is deprecated. Don't use this. Just request a new cursor, so you can do this asynchronously and update your list view once the new cursor comes back." So how does one request a new cursor and pass it back to the adapter? 回答1: again re-initialize cursor when your any DML query execute, can refer this 回答2: Just think about a block where you need to use cursor again