cursor

How to store result of a function which will return sysrefcursor?

↘锁芯ラ 提交于 2019-12-13 08:47:54
问题 Scenario: there is an procedure inside which we have a cursor. I need to call a function which will take an input from that cursor value and will return SYS_REFCURSOR . I need to store that result of function in a different variable/cursor & need to return this value from procedure as out parameter. I am using Oracle 11g. How can I proceed? PFB My Approach: create or replace procedure prc_test (p_dept_id in number, c_detail out sysrefcursor)--need to add extra out parameter as var1 varchar2

Top 2 offers with sum of all offers

为君一笑 提交于 2019-12-13 08:30:40
问题 Can someone please tell how can I get the results as below. Using dense_rank function where rank <=2 will give me top 2 offers. I am also looking to get 'total_offer' which should be sum of 'offer1' and 'offer2'. when there is no offer2 ( eg:taurus) 'total offer' should be 'offer1' and 'null' for 'offer2' Input: customer make zipcode offer notes mark focus 101 250 cash mark focus 101 2500 appreciation cash mark focus 101 1000 cash mark focus 101 1500 cash offer henry 520i 21405 500 cash offer

How to calculate the position and direction of the target cursor in xna?

我怕爱的太早我们不能终老 提交于 2019-12-13 07:40:08
问题 I developped a small games like "minecraft". and I'm stuck for a few days on the calculation of the direction of the cursor. Let me explain. I would like to target a cube with my cursor in the middle of the screen and make it disappear with a click. But I do not see any how to recover this information .. Can someone point me to a "sample / tutorial" or explanation please? Thank you very much. My screenShoot picture game : 回答1: I take no credit for most of this--it's what I used in my 3D XNA

How to refresh the cursor in Oracle if some data gets inserted into the table in between?

假装没事ソ 提交于 2019-12-13 07:19:49
问题 I have a cursor executing on a select statement. In between the processing , some data got inserted into the table on which the cursor is open. I want to execute the cursor on the new data also. How to refresh the cursor here ? 来源: https://stackoverflow.com/questions/38479812/how-to-refresh-the-cursor-in-oracle-if-some-data-gets-inserted-into-the-table-in

Android ContentResolver.query() throwing exception when passing a String[] projection argument

馋奶兔 提交于 2019-12-13 06:59:23
问题 In my current Android project I'm facing with a strange error. Everytime I issue the query method I get errors saying that the columns of the passed projection String[] argument don't exist (_id column field comprised). Despite this, passing null (hence allowing all columns to be returned) works fine , so I must assume this is not a problem of column names mismatch. Also, when retrieving data from a Cursor object, the column names are not giving any problems, since I can safely get all of the

Apply Custom ListView For a CursorAdapter

核能气质少年 提交于 2019-12-13 06:41:48
问题 I am building a custom listview used to list contacts from the contact cursor into a list with two text view for the phone number and name of the contact as well as a place for the images. I am getting a nullpoint error when i try to setText for my TextView Even though i checked the variable to see if they contained a string I have no ideas whats wrong with it. public View getView(int position, View convertView, ViewGroup parent) { View rowView=convertView; ViewCache viewCache=null; if

Ensuring my cursor is closed

橙三吉。 提交于 2019-12-13 06:02:53
问题 So I have a few different Activities that use a SimpleCursorAdapter for a ListView. My main concern right now would be memory leaks and whatnot. I need to make sure that the cursor is closed when it is supposed to be. I noticed that my app crashes when I go to re-run the code after I've made changes due to a nullpointerexception. Can someone take a look at my code for one of my activities and tell me if there are issues with the cursor not being closed properly? Or any other issues you see

Inner join with Cursors resulting another Cursor object

冷暖自知 提交于 2019-12-13 05:59:03
问题 In fact I have 2 Cursor s one is SQLite cursor, another one comes from ContentProvider - beneath it lies complicated SQLite query - but I don't have access to it. Both cursors has the same unique _ID field. In a pure SQL it would be really easy to join them using those id field, but not in my case, since 2nd Cursor is not SQLite query. I need to produce resulting joined Cursor . Neither CursorJoiner nor MergeCursor doesn't help me. Any ideas, clues, hints? 回答1: Option #1: Write your own

Run plpgsql program to update the data in table

自闭症网瘾萝莉.ら 提交于 2019-12-13 05:47:07
问题 I am using Postgres 8.4. I want to update the data from using plpgsql and a cursor. When I try to run the plpgsql it generates an error. CREATE OR REPLACE FUNCTION updateScore() RETURNS void AS $$ DECLARE singleTopicCriteriaPercentage DECIMAL(6,10); sitePercentage DECIMAL(6,10); singleSiteCriteriaPercentage DECIMAL(6,10); totalSocre DECIMAL(6,10); cursor1 CURSOR FOR select id from sitereviews order by id; cursor2 CURSOR FOR select weight into rating from sitereviews_ratingcriteria where site

Android: How to close a cursor that returns from Class to Activity

白昼怎懂夜的黑 提交于 2019-12-13 05:27:20
问题 I have: Accounts.java public class Accounts{ private SQLiteDatabase dbConfig; public Cursor list(Context context, String db, String where, String order) { DBHelper dbHelper = new DBHelper(context, db); dbConfig = dbHelper.getReadableDatabase(); Cursor c = dbConfig.query("accounts", new String[]{ "iId","sName"}, where, null, null, null, order); return c; } } and: MainActivity.java Accounts account = new Accounts(); Cursor cursor = account.list(getApplicationContext(), globalDB, null, null);