cursor

How to Access Cursor Columns Without FETCH .. INTO

假如想象 提交于 2019-12-10 03:28:52
问题 I'm using SQL Server to build stored procedures, and I'm using cursors to loop through a select statement I'm defining the cursor as follow: DECLARE @c_col1 varchar(max); DECLARE @c_col2 varchar(max); DECLARE c as CURSOR FOR SELECT col1, col2 FROM table; OPEN c; FETCH NEXT FROM c INTO @c_col1, @c_col2; SELECT @c_col1, @c_col2; Is there a way to access the columns of the cursor without a need to declare variables for each column and to use INTO in FETCH clause? In other words, is it possible

Change the color of the cursor of an EditText in Android 3.0

与世无争的帅哥 提交于 2019-12-10 02:25:09
问题 I have to have an EditText in my application with a white background. I did this in my theme.xml file <style name="myEditText" parent="@android:style/Widget.EditText"> <item name="android:background">#ffffffff</item> <item name="android:textColor">#ff000000</item> </style> The problem now is that the cursor is still white and therefore not visible. I did some googling and found this question here on StackOverflow: Set EditText cursor color The way it's done there is the android

Sort a list in ascending order by date from sqlite

余生颓废 提交于 2019-12-10 02:02:35
问题 I am having a code for retrieving data like this. I wanted to get records with the dates in the ascending order.I tried using "KEY_DATE_TIME ASC" . but it didnt work. public Cursor fetchAllReminders() { return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE, KEY_BODY, KEY_PHONE,KEY_DATE_TIME}, null, null, null, null, null); } 回答1: Assuming that KEY_DATE_TIME is a String constant holding the name of the db field, the following should work: return mDb.query(DATABASE_TABLE, new

Android SimpleCursorAdapter results not displaying in AlertDialog

强颜欢笑 提交于 2019-12-10 00:30:43
问题 I was looking for an alternative to a spinner, since the first item is always selected (which causes me issues), and I found some examples for using an AlertDialog with a list instead. I am having two problems: The list is displaying and is formatted ok, but there are no values in it. I know the query is returning, and the cursor/adapter has the data in it. This may be a symptom of #1 - but when I select a blank row, the Cursor cursor2 = (Cursor) ((AdapterView) dialog).getItemAtPosition(which

WPF: drawing own cursor - nontrivial problem

非 Y 不嫁゛ 提交于 2019-12-09 23:48:29
问题 i need to implement a cursor with some very specific features: it has to be animated because after n seconds it automatically clicks - so the animation is feedback for the user when the click will happen it has to snap to some of our controls it has to work outside of our application the approaches so far: render my WPF-control into a bitmap, make a cursor-struct out of it and use user32.dll/SetSystemCursor to set it PRO the cursor has no delay after the mouse since it's a real cursor CON

Mac IntelliJ cursor style/type does not change (stays as default)

瘦欲@ 提交于 2019-12-09 20:40:31
问题 Sometimes (every 10 minutes in average) the cursor style/type does not change from the default to edit or drag / resize when hoovering between various window components in IntelliJ Idea (OSX Yosemite). It stays stuck in the default style unless I do some weird combo such as right click in the editor window and then again right click anywhere in the drop down menu. I'm not sure if this is just problem of Java/IntelliJ Idea or a general problem of Yosemite though as far as I remember it happens

How to get matched Rows from MySQLdb.cursors.Cursor python2.6

孤街浪徒 提交于 2019-12-09 20:29:47
问题 I'm working with python2.6 and MySQLdb. I have a table with this data +----+--------+ | id | status | +----+--------+ | 1 | A | | 2 | B | | 3 | B | +----+--------+ I want to do an mysql update like this example: UPDATE my_table SET status = "A" where id in (1,2,3,10001); Query OK, 2 rows affected (0.03 sec) Rows matched: 3 Changed: 2 Warnings: 0 And I need to know if all the ids in the update exits in the database. My idea to get this information was to compare the number of items I tried to

How to flip to previous page with ndb cursors?

女生的网名这么多〃 提交于 2019-12-09 16:57:59
问题 I cant manage to get to 'previous page' in ndb paging. I have checked the documentation and also this similar question here without success. def show_feedback(kind, bookmark=None): """Renders returned feedback.""" cursor = None more_p= None if bookmark: cursor = Cursor(urlsafe=bookmark) q = Feedback.query() q_forward = q.filter(Feedback.kind==Feedback.KINDS[kind]).order(-Feedback.pub_date) q_reverse = q.filter(Feedback.kind==Feedback.KINDS[kind]).order(Feedback.pub_date) feedbacks, next

Passing a Cursor between processes (Parcelable Cursor)

不问归期 提交于 2019-12-09 13:15:23
问题 I need to pass a Cursor ( SQLiteCursor ) from a service to an application on API 10 , and having hard time finding a decent (and fast) solution. I've seen the CursorWindow class. This is Parcelable but I can't instantiate this class on API 10 to use SQLiteCursor.fillWindow() because it has no valid constructors. CursorWindow(boolean) is deprecated. And even if I got a CursorWindow instance with data from a SQLiteCursor , how do I copy this window into a new Cursor ? What Cursor implementation

Does Oracle 12 have problems with local collection types in SQL?

痞子三分冷 提交于 2019-12-09 08:39:39
问题 To make a long story short I propose to discuss the code you see below. When running it: Oracle 11 compiler raises "PLS-00306: wrong number or types of arguments tips in call to 'PIPE_TABLE'" "PLS-00642: Local Collection Types Not Allowed in SQL Statement" Oracle 12 compiles the following package with no such warnings, but we have a surprise in runtime when executing the anonymous block as is - everything is fine (we may pipe some rows in the pipe_table function - it doesn't affect) now let's