cursor

Oracle 11g - Running PL/SQL Cursors

淺唱寂寞╮ 提交于 2019-12-11 10:37:13
问题 I'm trying to run this code on Oracle 11g and it's giving me the error below. I can't seem to get it right. DECLARE CURSOR bookcursor IS SELECT btName, BookCopy.Isbn, pubName, dateDestroyed FROM booktitle bt JOIN publisher p ON bt.pubId = p.pubId JOIN bookcopy bc ON bt.Isbn = bc.Isbn WHERE datedestroyed IS NULL ; bookcursorrec bookcursor%ROWTYPE; BEGIN OPEN bookcursor; LOOP FETCH bookcursor INTO bookcursorrer; EXIT WHEN bookcursor%NOTFOUND; dbms_output.put_line( 'ISBN: ' ||bookcursorrec.isbn

setSelectionRange workaround doesn't work for android 4.0.3

我怕爱的太早我们不能终老 提交于 2019-12-11 10:25:15
问题 I am trying to mask the phone number as the user types. I have used the javascript code below with jquery and the setTimeout workaround successfully on android 2.x devices, but I have not found a workaround for that works for android 4.0.3. if (navigator.userAgent.toLowerCase().indexOf("android") >= 0) { $.fn.usphone = function() { this.keyup(function(e) { // do not process del, backspace, escape, arrow left and arrow right characters var k = e.which; if (k == 8 || k == 46 || k == 27 || k ==

Compare two rows using a single cursor in SQL

社会主义新天地 提交于 2019-12-11 09:56:04
问题 I have the following table +-------+-------+----------+------+ | icode | iname | icatcode | slno | +-------+-------+----------+------+ | 10 | a | 11 | 0 | | 20 | b | 31 | 0 | | 30 | c | 11 | 0 | | 40 | d | 21 | 0 | | 50 | e | 31 | 0 | | 60 | f | 11 | 0 | | 70 | g | 21 | 0 | | 80 | h | 41 | 0 | +-------+-------+----------+------+ I need to update the slno column using a cursor. The o/p should be the following table ie., when the icatcode is same it should increment the slno and when icatcode

Using cursor in OLTP databases (SQL server)

假装没事ソ 提交于 2019-12-11 09:37:07
问题 Is it safe to use cursors in stored procs that are called from a website? There is the obvious performance hit, but what I am trying to raise here is the issue with the variable @@Fetch_status. The scope of @@Fetch_status used in stored proc, is a connection. Isn't it possible that two different users call the same stored proc, from the same connection, thru the UI? Wouldn't that cause unexpected results? In other words, would the fact that @@Fetch_status is global not just to a scope but to

Cursor.Postition and Mouse_Event being Blocked

被刻印的时光 ゝ 提交于 2019-12-11 09:32:19
问题 I'm working on an app to automate some input into another application. And i'm running into a problem. Below is the function code i'm using public class MouseClick { [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo); } public enum MouseButton { MOUSEEVENTF_LEFTDOWN = 0x02, MOUSEEVENTF_LEFTUP = 0x04, MOUSEEVENTF_RIGHTDOWN = 0x08, MOUSEEVENTF_RIGHTUP =

CursorWindow number of columns

末鹿安然 提交于 2019-12-11 09:18:15
问题 How can I know how many columns there are on a CursorWindow ? Why it has a getNumRows() but no getNumColumns() , despite having a setNumColumns() ? 回答1: I did it in this most horrible way: /** * Get the number of columns of this CursorWindow. The CursorWindow has to * have at least one row. */ public static int getCursorWindowNumCols(CursorWindow window) { // Ugly hack... int j = 0; while (true) { try { window.getString(0, j); } catch (IllegalStateException e) { break; } catch (SQLException e

Replace iteration's fetch to BULK COLLECT

只谈情不闲聊 提交于 2019-12-11 08:50:01
问题 There is an object type and table consists of that objects. So here we go: create or replace type lpu.someobj_o as object ( name VARCHAR2(75), enroll_date DATE, id NUMBER(12) ) CREATE OR REPLACE TYPE lpu."SOMEOBJ_T" IS TABLE OF someobj_o; There's also PL/SQL function that works in common ETL principle. Here is piece of code function: for some_cursor_rec in some_cursor(startTime, recordInterval) loop open some_cur2(some_cursor_rec.name, some_cursor_rec.id); fetch some_cur2 into some_cursor

MySQL cursor fetch NULL

谁都会走 提交于 2019-12-11 08:44:50
问题 Why both my variables output NULL ? SELECT part of the cursor is working properly. CREATE PROCEDURE p2() BEGIN # Account table DECLARE accountid INT; DECLARE accountname VARCHAR(1000); # 1. cursor finished/done variable comes first DECLARE done INT DEFAULT 0; # 2. the curser declaration and select DECLARE c_account_id_name CURSOR FOR SELECT accountid, accountname FROM temp.test; # 3. the continue handler is defined last DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = TRUE; OPEN c

Android: Couldn't init Cursor Window

时光怂恿深爱的人放手 提交于 2019-12-11 08:36:14
问题 I'm getting the following error and stack traces: Caused by: java.lang.IllegalStateException: Couldn't init cursor window at android.database.CursorWindow.native_init(Native Method) at android.database.CursorWindow.<init>(CursorWindow.java:41) at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:276) at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:268) at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171) at android.database

CSS .cur cursor format

陌路散爱 提交于 2019-12-11 08:29:13
问题 I set custom cursor url(mouse2.cur) and it doesnt change. (mouse2.png) works perfectly! Whats the problem ? body{ cursor: url(mouse2.cur),pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; } 回答1: Different browsers have different support in url of the cursors. Firefox/Mac, Safari/Mac, Chrome/Mac don't support PNG and JPG cursors (tested with 48px cursors). IE only supports cursors in the CUR format. According to CanIUse: http://caniuse.com/#search=cursor W3C