cursor

How to Use MediaStore to display all images in GridView

狂风中的少年 提交于 2019-12-25 02:21:13
问题 I need a little help in trying to figure out a problem that I am having. I have an application that will query all the images on the phone and display them in a GridView. I was able to do this and populate the list. The problem is when I am accessing the list and getting information from the items from a query. The cursor is telling me that the item has a file path of /mnt/sdcard/images/media/file.jpg but the path is only /sdcard/images/media/file.jpg This is the code I used to populate the

SQL: compare two table record by record

随声附和 提交于 2019-12-25 02:19:17
问题 I want to compare two tables recordby record. I have two cursor for each table. The code looks like this Declare Cursor c1 for SELECT * from Table1 OPEN c1 While @@Fetch_status=0 Begin Declare Cursor c2 for SELECT * from Table2 OPEN c2 WHILE @@Fetch_Status=0 Begin /*Comparison happens here*/ END END When fecthing, must I specify which cursor I am fetching and how do I do that? EDIT For each record in Table1 I want to Search Table2 for that record based on the primary key. When it is found, I

LIstView shows no data while populating through cursor

谁说胖子不能爱 提交于 2019-12-25 02:02:55
问题 I am new to Android development. I am using ListView to list some data from SQLite database. my Main.xml file looks like: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/inspections" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <!-- Header --> <LinearLayout android:id="@+id/header" android:background="#ff347c12" android:layout_height="wrap_content"

Making the Cursor Disappear

无人久伴 提交于 2019-12-25 01:43:55
问题 I am constructing an Editor for a little Webapp. My concept is to have a Bar where I put all the functions. It changes concerning to the content. Now i got the following problem. As you can see in the picture when i click on the button it happens that the button will be on a new button just after beeing clicked. My question is: Is there a possibility to make the cursor disappear? We are coding in PHP. 回答1: Do you mean the mouse cursor disappear? If so, you can use css to use any gif as your

spring-data-jpa 1.11.16 stored procedure with cursor

冷暖自知 提交于 2019-12-25 01:38:31
问题 i'm unable to use stored procedure with cursor in spring-data-jpa (version 1.11.16) and an oracle server. The Repository: @Repository public interface GeoRegionRepository extends CrudRepository<PocRegions, String> { @Procedure(name = "PocRegions.getRegion", procedureName = "POC_PKG_GEO.PRO_RETURN_REGION") List<PocRegions> getRegion(@Param("id_region") BigDecimal regionId); } The annotation on the entity: @Entity @Table(name = "POC_REGIONS") @NamedStoredProcedureQueries({

Output message problems with procedure and function

喜夏-厌秋 提交于 2019-12-25 01:37:01
问题 I have successfully created a function and a trigger but the output does not seem to be showing when i execute it just says procedure completed successfully. It does not display the total cost. 回答1: To see the output from the DBMS_OUTPUT package, you must enable it. That depends on the tool you are using. in SQL+, set the command set serveroutput on before running the procedure in TOAD, click on the Output On/Off button in the DBMS_OUTPUT tab in SQL Developer you also have a tab named DBMS

Nested Cursor Declare Issue Mysql

岁酱吖の 提交于 2019-12-25 01:28:33
问题 I'm trying to make a Nested Cursor in Mysql by following this instruction. Then i got this issue: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DECLARE activityids CURSOR FOR SELECT activity_id FROM @_activity; END BLOCK2;' at line 22 I've 2 table 'account' and 'n_activity' (n = account_id in table 'account') Ex: i've table 'account' and '20_activity'. So i want to loop the 'account_id' and get

Sort results from an Android sdk Cursor's managedQuery in a case insensitive manner

て烟熏妆下的殇ゞ 提交于 2019-12-24 22:14:57
问题 I'm using the string 'MediaStore.Audio.Media.TITLE + " ASC"' to sort the resultant list of a managedQuery in an Android Cursor but, unfortunately, my items that begin with 'a' appear after the items that begin with 'Z'... I would like to know how to perform a managedQuery with the resultant list sorted in a case-insensitive fashion. Help? 回答1: A quick google search turns up this post which almost directly answers your question. But since I'm assuming you'll want to retain the case of the

CursorIndexOutOfBoundsException when accessing Sqlite database

不问归期 提交于 2019-12-24 22:12:05
问题 Hi everyone I’ve been having some difficulty, hope one of you can help. I’m trying to create a little program to store my timetable for college. I’ve been having some trouble with the SQlite database though, it’s got me stumped. When I first run the program it force closes I get this error in logcat Caused by: android.database CursorIndexOutOfBoundsException: Index 0 requested. With a size of 0 When I go to open the application again the table is created and the app works fine. I have no idea

IllegalStateException Cursor Error

你说的曾经没有我的故事 提交于 2019-12-24 20:35:24
问题 Sorry for the repeat Question.but I try to make many way doesn't work In applecation,In the first round, it can push through Activity. But back then it was a mistake. SQLiteDatabase mDb; Database3 mHelper; SQLiteDatabase mDb2; Database mHelper2; private Cursor mCursor; private String name; private String image; private String location; private String info; private String shop; private String mcontact; mHelper2 = new Database(this,shop); mDb2 = mHelper2.getWritableDatabase(); mHelper2