cursor

Conditionally define a Cursor

倾然丶 夕夏残阳落幕 提交于 2019-12-18 06:06:17
问题 I have a Procedure in Oracle that takes a varchar2 paramater. Based on the value of that parameter, I need to define a cursor. The cursor will operate on different tables based on the value of the parameter. I wanted to do something like below but it throws an error in the CURSOR definition piece of code. Any ideas? PROCEDURE GET_RECORDS(v_action IN VARCHAR2) IS CURSOR get_records IS IF(v_action = 'DO THIS') THEN SELECT * from <THIS>; ELSE SELECT * from <THAT>; END IF; BEGIN OPEN get_records;

How to convert a SQL Server cursor to MySQL equivalent

杀马特。学长 韩版系。学妹 提交于 2019-12-18 05:11:59
问题 How can I convert the procedure below to MySQL format? Here is the piece to be converted: DECLARE @CurrentFirstName varchar(300) DECLARE @CurrentAge INT DECLARE CursorName CURSOR FAST_FORWARD FOR SELECT Firstname,Age FROM Customers OPEN CursorName FETCH NEXT FROM CursorName INTO @CurrentFirstName, @CurrentAge WHILE @@FETCH_STATUS = 0 BEGIN IF @AGE>60 /*this is stupid but we can apply any complex condition here*/ BEGIN insert into ElderCustomers values (@CurrentFirstName,@CurrentAge) END FETCH

Android list all images available

半腔热情 提交于 2019-12-18 05:03:14
问题 I m making an application which requires me to list all the images available on the SD-Card of the phone. i tried querying the ContentResolver way i.e. Cursor image = getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI, new String[]{Images.Media._ID,Images.Media.DATA,Images.Media.DISPLAY_NAME}, null, null, null); but without any result. Is there any way i can get the list or if thats not possible then is there any possible intent (e.g. PICK) by which i can allow the user to select a

Using Cursor in a Loop of a stored procedure

女生的网名这么多〃 提交于 2019-12-18 04:53:13
问题 So as to use cursors dynamically using MySQL is it possible to declare a cursor in a loop of a stored procedure? I've tried and got an error: increment: LOOP DECLARE cur1 CURSOR FOR SELECT person_id, publication_id FROM p_publication WHERE person_id = new_count; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur1; REPEAT FETCH cur1 INTO pub_id, per_id; IF NOT done THEN INSERT INTO test.t2 VALUES (pub_id, per_id); END IF; SET new_count = new_count + 1; UNTIL done END REPEAT; CLOSE

Remove typing cursor from combobox

孤街浪徒 提交于 2019-12-18 04:53:06
问题 I am using an ExtJS combobox. There is a typing cursor when focusing on the combobox. I tried to implement editable: false when creating the combobox, but it helped only for chrome. Also tried clearListeners() function to see if this works on that cursor - didn't help, it still appears in FireFox and IE. The other idea is to set disabled on the input field in combobox. When I did it manually, it helped. But when I wrote the next Ext.get('bu-encodingcount-combobox').select('input').set(

Hide cursor on remote terminal

。_饼干妹妹 提交于 2019-12-18 04:52:49
问题 I have an open socket to a remote terminal. Using the answer to "Force telnet client into character mode" I was able to put that terminal into character mode. My question is, how do I hide the cursor in the remote terminal using this method? 回答1: This is something that the ncurses library can do for you. The curs_set() function can make the cursor invisible. 回答2: To expand upon mjh2007's answer, the following c/c++ code will implement sending the escape codes to the terminal, and is slightly

Updating database rows without locking the table in PostgreSQL 9.2

匆匆过客 提交于 2019-12-18 04:46:26
问题 Trying to run an update statement like this on a table, using PostgreSQL 9.2: UPDATE table SET a_col = array[col]; We need to be able to run this on a ~10M row table, and not have it lock up the table (so normal operations can still happen while the update is running). I believe using a cursor will probably be the right solution, but I really have no idea if it is or how I should implement it using a cursor. I have come up with this cursor code, which I think might be good. Edit: Added cursor

How can I lock the cursor to the inside of a window on Mac OS X?

巧了我就是萌 提交于 2019-12-18 04:44:05
问题 I'm trying to put together a game for Mac OS X which involves a lot of fast action and flinging around of the mouse cursor. If the user wants to play in windowed mode, I'd quite like to lock the cursor to the inside of the window to avoid accidentally changing programs in the heat of battle (obviously this will cancel itself if the user changes programs or hits escape for the pause menu.) On Windows, this can be accomplished easily with ClipCursor(). I can't find an equivalent on Mac OS X. Is

CSS to change the cursor style of the resize button on a textarea

半世苍凉 提交于 2019-12-18 03:57:51
问题 I noticed that the resize button on my text area when hovered and/or clicked is staying as an arrow. It seems to me like it should be a pointer. seeing as there is css to remove or add the resize tool to a textarea, resize:none; and css to change the cursor of the whole textarea, cursor:pointer; but it seems like there should be a css parameter to control the cursor of just the resize button. I've been looking around a bit and can't seem to find the property though. I can think of a few ways

Rotating Cursor According to Rotated TextBox

Deadly 提交于 2019-12-18 02:46:46
问题 I have a TextBox that I allow my users to rotate. But what I would LOVE for my users is to have their Cursor rotate to the same angle that the TextBox was rotated at. For example, if they rotated the TextBox to 28°, then when the Cursor enters that TextBox the Cursor should also rotate itself to 28°. Any help at all will be greatly appreciated. Thank you :) 回答1: You can rotate your cursor using the System.Drawing.Icon class from WinForms in combination with WPF's bitmap rotation ability. The