cursor

SimpleCursorAdapter issue - “java.lang.IllegalStateException: trying to requery an already closed cursor”

怎甘沉沦 提交于 2019-12-11 16:09:36
问题 I've read similar topics and didn't find any answer that I could apply to my situation. Long story short, I have an AutoCompleteTextView with SimpleCursorAdapter . It queries my SQLiteDatabase for the matching drop down list of options. Everything works fine, but when I press the "Home" button ( onPause() -> onStop() ) if I've shortly before that used the AutoCompleteTextView , upon re-entering the app ( onRestart() -> onStart() -> onResume() ), I get this error: 03-05 19:17:42.186 13847

PL/SQL Nested Loops with cursors

一世执手 提交于 2019-12-11 15:43:47
问题 I am working with Oracle PL/SQL. There are two cursors, namely c1 and c2. v_temp VARCHAR(50); For s1 IN c1 LOOP --do something FOR s2 IN c2 LOOP --do something v_temp := s1.s2.xxx; --PLS-00302: component 's2' must be declared END LOOP; END LOOP; s2.xxx gives a column name, and with that column name I hope to assign the value of that column from s1 to v_temp . For example: In the first iteration, s2.xxx is 'column1' , I would like to assign s1.column1 to v_temp . In the second iteration, s2

CURSOR in proc that only locks current row being UPDATEd (while UPDATing) and nothing else for duration?

末鹿安然 提交于 2019-12-11 15:40:00
问题 Please bear with me because I'm hopeless on vocabulary, and my own searches aren't going anywhere. I've learned here that if I update in the way I want to here (with the GROUP_CONCAT s also stored in user-defined vars), I'll lock the entire table. I'm fairly certain the best way to do this would be to UPDATE row by row in a CURSOR , starting with the highest PK id then descending because I'm sure I will have a lower chance of a deadlock, or conflict, or whatever it's called (told you I was

Using a cursor in a stored procedure to loop rows MySQL

佐手、 提交于 2019-12-11 15:38:32
问题 Scenario: I have a stored procedure that gets data from a table based on 2 inputs: a date and a string (which is a column name). The first procedure is called from another procedure which uses a cursor to loop through rows of a table and pass each row to the string of the first procedure (column names to be checked). My input for the second procedure (which is the one to be called directly) is the date. Issue: My first procedure is running fine when I call it on its own. My second procedure

Increase performance on insert cursor?

ぃ、小莉子 提交于 2019-12-11 15:36:15
问题 I would like to ask you how would you increase the performance on Insert cursor in this code? I need to use dynamic plsql to fetch data but dont know how to improve the INSERT in best way. like Bulk Insert maybe? Please let me know with code example if possible. // This is how i use cur_handle: cur_HANDLE integer; cur_HANDLE := dbms_sql.open_cursor; DBMS_SQL.PARSE(cur_HANDLE, W_STMT, DBMS_SQL.NATIVE); DBMS_SQL.DESCRIBE_COLUMNS2(cur_HANDLE, W_NO_OF_COLS, W_DESC_TAB); LOOP -- Fetch a row IF

Couldn´t read row 0 - cursor

邮差的信 提交于 2019-12-11 14:56:42
问题 In my application, I want to set the layout for a ListView with a CustomAdapter. This is my error log: 05-09 19:17:50.187: E/AndroidRuntime(32063): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.unserekinder/com.example.unserekinder.Ereignisse}: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. 05-09 19:17:50.187: E/AndroidRuntime(32063): at android.app

SQL cursor issue

爷,独闯天下 提交于 2019-12-11 14:34:56
问题 I am trying to create a new table using a cursor and a select statements. Declare Cursor c1 is select store_number from table1 where CLIENT_ID= 1 and ORG_ID = 1 ; Type C1_TAB_TYPE is table of c1%ROWTYPE; c1_list c1_TAB_TYPE; Begin For r1 in c1 Loop select store_number BULK COLLECT INTO c1_list from ( SELECT store_number, ( (SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(a.geometry,b.geometry, 0.005), 0.005, 'unit=sq_mile') /SDO_GEOM.SDO_AREA((a.geometry), 0.005, 'unit=sq_mile'))*100) Total_area

Cursor in Mysql has other rights than user?

无人久伴 提交于 2019-12-11 14:32:37
问题 i have two databases, db1 and db2. User man1 had all privileges to db1 but only executing provileges for all functions and procedures in db2. Calling function db2.getValue from db1 is successful and returns correct values, also if call for db2.getValue is nested in a stored procedure. Now i create a stored Procedure proc1 and within this procedure i use a cursor to fetch values (_val1, _val2,--) from a table in db1 and call db2.getValue(_val1). Now somthing really strange happens: The first

Fetch subquery value from cursor to parameter in PL/SQL

末鹿安然 提交于 2019-12-11 14:22:18
问题 I have below query to select the count of subquery: SELECT COUNT(*) FROM (select crs_cust.CUSTOMER_ID, subset.NEW_REFERENCE_ID FROM CRS_CUSTOMERS crs_cust INNER JOIN DAY0_SUBSET subset ON crs_cust.CUSTOMER_ID=subset.CURRENT_CUSTOMER_ID); Above query is executed from a cursor in PL/SQL, how can I fetch columns from subquery ( CUSTOMER_ID and NEW_REFERENCE_ID ) into respective parameter? The cursor is expected to have multiple records.Similiar like the following: p_Count := SELECT COUNT(*) FROM

SQLite Query returns null

孤者浪人 提交于 2019-12-11 13:56:44
问题 What I've done I have a Gridview which is filled over my Database with the imageID's. Now I setted up a onItemClickListner with that I get the imageID -> this works!. Now I'd like to search my DB with that imageID, but it allways returns "null", but that shouldn't be because if filled my DB exactly with those imageID's. The Structure of the Table is that: RowID | SOURCE | INFO In Info i stored the imageID's Question How do I have to change Cursor that I can get the entries over INFO. Down