cursor

PLS-00386: type mismatch found between FETCH cursor and INTO variables

人走茶凉 提交于 2019-12-01 11:07:06
The following package throws : PLS-00386: type mismatch found at 'V_STUDYTBL' between FETCH cursor and INTO variables Purpose of the code: Define two types outside the package, one is used to send a bunch of numbers into the stored proc and the other is used to return the corresponding rows from my_table Thank you in advance for the inputs. Create OR REPLACE Type InputTyp AS VARRAY(200) OF VARCHAR2 (1000); CREATE TYPE OBJTYP AS OBJECT ( A NUMBER, B VARCHAR2 (1000), C VARCHAR2 (100) ); CREATE TYPE OutputTyp IS VARRAY (2000) OF OBJTYP; / CREATE OR REPLACE PACKAGE my_package AS PROCEDURE my

Get contacts with email id

让人想犯罪 __ 提交于 2019-12-01 10:48:59
I need to get contacts information(cursor) with email. They must be distinct. There must be one entry per contact if he has got an email. How to do it? I am targetting new contacts API comes with 2.0. 1)I tried to do it using CursorJoiner, but a strange thing happens. Here is my code : MatrixCursor matCur = new MatrixCursor( new String[]{ Contacts._ID, Contacts.DISPLAY_NAME, "photo_id", "starred" } ); Cursor newContactCursor = managedQuery( ContactsContract.Contacts.CONTENT_URI, new String[]{ Contacts._ID, Contacts.DISPLAY_NAME, "photo_id", "starred" }, null, null, null//Contacts._ID );

Is it a bad practice to use EXIT WHEN instruction when looping through CURSORs in Oracle?

我只是一个虾纸丫 提交于 2019-12-01 09:37:12
It may sound like a silly question, but I hope I'll make myself clear enough. When talking about Spaghetti Code , the basis of it is the usage of GOTOs. I had a peer that was used to say if I put a breakpoint at the end of the code and this breakpoint isn't reached everytime, something is wrong . Nevertheless, is a common (and I'd say, a rule) to use EXIT WHEN structures within Oracle packages (usually followed by a %NOTFOUND test). Taking for granted that using EXIT breaks the programming flow, isn't something that doesn't match between 1 and 2? Is everyone programming in PL/SQL following a

Does SQLite have Cursors?

有些话、适合烂在心里 提交于 2019-12-01 09:13:13
i wonder if i could run the following procedure in SQLite: set nocount on select T.ID, max(T.SerialNo) as SerialNo into #Tmp_Ticket_ID from Ticket as T, Ticket as inserted where t.ID = inserted.ID group by T.id having count(*) > 1 declare zeiger cursor for select SerialNo from #Tmp_Ticket_ID declare @SerialNo int OPEN Zeiger FETCH NEXT FROM zeiger INTO @SerialNo WHILE (@@fetch_status <> -1) BEGIN IF (@@fetch_status <> -2) BEGIN update T set ID = (select max(id) + 1 from Ticket) from ticket AS T, #Tmp_Ticket_ID as I where t.serialNo = i.serialno and I.Serialno = @SerialNo END FETCH NEXT FROM

java.lang.IllegalStateException: attempt to re-open an already-closed object

梦想与她 提交于 2019-12-01 09:05:53
I'm trying to figure out why occasionally I'm getting the IllegalStateException. I can't find any good examples that show how to load a list using a thread to query a SQLite database. I've included my code below. Most of the time it works correctly, but occasionally, I'm getting the IllegalStateException. I have also gotten a similar exception in another activity of mine that is an instance of ExpandableListActivity. That exception states "trying to requery an already closed cursor". Can somebody tell me the correct way to do this so that it doesn't cause any errors? I would prefer to use the

The biggest size of Windows Cursor

瘦欲@ 提交于 2019-12-01 09:04:54
问题 I have a cursor what the size size 128x128, but when i used LoadCursor to load and show it, it only has 32x32. Which API can make it correctly? It seems MS resize it. Thanks. 回答1: Windows XP does not include any system cursors that are larger than 32x32. (If larger cursors were included, they would be stretched down to 32x32 when the standard APIs load the cursors.) For high-DPI systems, Windows XP has adjusted the SM_CXCURSOR and SM_CYCURSOR values to be 64x64 pixels. This size adjustment is

Is it a bad practice to use EXIT WHEN instruction when looping through CURSORs in Oracle?

佐手、 提交于 2019-12-01 09:03:16
问题 It may sound like a silly question, but I hope I'll make myself clear enough. When talking about Spaghetti Code, the basis of it is the usage of GOTOs. I had a peer that was used to say if I put a breakpoint at the end of the code and this breakpoint isn't reached everytime, something is wrong . Nevertheless, is a common (and I'd say, a rule) to use EXIT WHEN structures within Oracle packages (usually followed by a %NOTFOUND test). Taking for granted that using EXIT breaks the programming

How to get contact name for sms conversations?

陌路散爱 提交于 2019-12-01 08:57:21
I'm retrieving list of last sms/mms conversations using following query: String[] columns={"type", "address", "date", "body", "conversation_id"}; Cursor cursor=context.getContentResolver().query(Uri.parse("content://mms-sms/conversations"), columns, null, null, "date desc"); Can anyone advise me how to get in the same query also contact name? Specifically field ContactsContract.PhoneLookup.DISPLAY_NAME ? I mean, I understand how to get those field in separate query, but I need to get it in the same query as for conversations. Try this: Log.i(TAG,"load_contact for "+Phone_numb); Uri uri = Uri

how to drag object

狂风中的少年 提交于 2019-12-01 08:43:10
i want to drag a box and i want my mouse cursor to be where i clicked in a rectangle while im draging rectangle. i tried this code and i got bunch of errors when i tried to drag. import objectdraw.*; import java.awt.*; public class TouchWindow extends WindowController { private FilledRect a; private boolean b; private Location c; private int x; private int y; public void begin() { b=false; a=new FilledRect(0,0,50,50,canvas); } public void onMouseClick(Location pt) { if(a.contains(pt)) { b=true; pt=c; } } public void onMouseDrag(Location pt2) { if(b==true) { x=(int)c.getX()-(int)pt2.getX(); y=

使用python操作mysql数据库

ぃ、小莉子 提交于 2019-12-01 08:04:02
使用python操作mysql数据库 数据库的安装和连接 PyMySQL的安装 pip install PyMySQL python连接数据库 import pymysql db = pymysql.connect("数据库ip","用户","密码","数据库" ) # 打开数据库连接 cursor.execute("SELECT VERSION()") # 使用 execute() 方法执行 SQL 查询 data = cursor.fetchone() # 使用 fetchone() 方法获取单条数据 print ("Database version : %s " % data) db.close() # 关闭数据库连接 import pymysql conn = pymysql.connect( host='localhost', user='root', password="root", database='db', port=3306, charset='utf-8', ) cur = conn.cursor(cursor=pymysql.cursors.DictCursor) 更多参数 创建表操作 import pymysql # 打开数据库连接 db = pymysql.connect("localhost","testuser","test123","TESTDB"