cursor

Avoiding cursors to update many records using a trigger

柔情痞子 提交于 2019-12-11 18:58:25
问题 I have a table with just over 1 million records. Initially, my table is empty, but I use a BULK INSERT to add these records to the database. I have an AFTER INSERT trigger that I use to update the initialValue field in this table. The value of initialValue is a calculation of specific variables in another table ( my_data_db ) summed across all records. I am using the values of the v1 , v2 , etc. columns as the column names in the table my_data_db . I know it's poor practice, but the only way

Converting mouse position

拜拜、爱过 提交于 2019-12-11 18:57:02
问题 I need some help with Mouse position and screen resolution. I have two applications running on two separate machines: application1 (resolution: 1920 x 1200) captures the mouse location, and then it sends the location values to application2. application2 (resolution: 1280 x 800) receives and sets the Cursor position based on those values. This works just fine, the problem I'm having is, that application1 has a different screen resolution compare to application2, therefore the mouse location

Call a function in a cursor for loop

只谈情不闲聊 提交于 2019-12-11 18:54:22
问题 I have created a procedure which finds some records with a missing date which needs to be populated. I have written a cursor which uses a select statement to find these records and was going to use a for loop to update them. There is an existing public function in the application that will return the date I need if I pass the ID of the record to it . My question is a syntax one really, how do I call this public function in a cursor for loop and pass the variable I need to it to get the date

Diagonal resizing mouse pointer [closed]

天涯浪子 提交于 2019-12-11 18:37:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I am looking for the (hidden) mouse shapes which had been available with ObjC (see SO question). The Swift NSCursor offers none of those cursors you find for resizing standard windows?! For now I'm just looking for the diagonal resizing mouse shapes. If the others were available it

Getting contact email by name

痞子三分冷 提交于 2019-12-11 18:24:42
问题 I've been trying to get email for contact by its name, but stuck with some difficultes. here is how I am trying to do this: Cursor emailCur = cr.query( ContactsContract.CommonDataKinds.Email.CONTENT_URI, null, ContactsContract.CommonDataKinds.Email.DISPLAY_NAME + " = ?", new String[] { contactName }, null); while (emailCur.moveToNext()) { String email = emailCur .getString(emailCur .getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA)); String emailType = emailCur .getString(emailCur

cursor output use in select

旧时模样 提交于 2019-12-11 18:07:22
问题 My last problem: select with variable parameter in the procedure okay, I have one more question. I would like to extend this procedure to another element. Well, we have already chosen these identifiers from the typepkstring column, from all tables on the schema, and which are not in the PK column in the Composedtypes table. It works great. Added to this is a new condition. After choosing what I had before and what I have already achieved, I now have to check whether these specific selected

WinAPI SetSystemCursor and LoadCursorFrom - how to set default cursor?

痴心易碎 提交于 2019-12-11 16:50:32
问题 I set my own cursor by: HCURSOR hCurStandard = LoadCursorFromFile(TEXT("cursor.cur")); SetSystemCursor(hCurStandard, 32512); DestroyCursor(hCurStandard); How to go back and set default cursor? This doesnt work: SetSystemCursor(LoadCursor(0, IDC_ARROW), 32512); ----EDIT----- HCURSOR hcursor = LoadCursor(0, IDC_ARROW); HCURSOR hcursor_copy = CopyCursor(hcursor); BOOL ret = SetSystemCursor(hcursor_copy, OCR_NORMAL); DestroyCursor(hcursor); This works for all cursors except IDC_ARROW, what the...

Process a row with unknown structure in a cursor

牧云@^-^@ 提交于 2019-12-11 16:42:40
问题 I am new to using cursors for looping through a set of rows. But so far I had prior knowledge of which columns I am about to read. E.g. DECLARE db_cursor FOR SELECT Column1, Column2 FROM MyTable DECLARE @ColumnOne VARCHAR(50), @ColumnTwo VARCHAR(50) OPEN db_cursor FETCH NEXT FROM db_cursor INTO @ColumnOne, @ColumnTwo ... But the tables I am about to read into my key/value table have no specific structure and I should be able to process them one row at a time. How, using a nested cursor, can I

How to stop an animated QCursor from freezing when loading or dumping with pickle?

霸气de小男生 提交于 2019-12-11 16:28:53
问题 As a follow-up question to this post, I was wondering if it is possible to extend the functionality of the cursor so that when pickle is used to dump or save data, the animation of the cursor doesn't freeze. from PyQt5 import QtCore, QtGui, QtWidgets import pickle import gzip import numpy as np class ManagerCursor(QtCore.QObject): def __init__(self, parent=None): super(ManagerCursor, self).__init__(parent) self._movie = None self._widget = None self._last_cursor = None def setMovie(self,

Activity not properly managing cursor.

六月ゝ 毕业季﹏ 提交于 2019-12-11 16:16:49
问题 I have an activity that populates a list and does some other things from a cursor. I get the cursor from a method that returns it based on a standard android SQLite query to my database. The method is defined in my SQLHelper class. The method opens the database, queries, closed the database, and returns the cursor. After the cursor has been collected in the activity, I call startManagingCursor(cursor); All that works fine. The problem happens when I launch a sub activity and then come back to