FAQ Database Discussion Community


Enable text hovering cursor when textbox is empty

wpf,xaml,textbox,cursor
I have some TextBox, when I hover my mouse over it, the cursor does not change: However, when I enter some text, I do see a cursor when hovering: I want the cursor to be visible in this text mode even when the textbox is empty....

Cursor and output don't have the same color css

html5,css3,input,cursor
I want to personalize the input field so the cursor will have a blue color and the writing will be black. I want the cursor and the output when i write not to have the same color. How can i do that ?

C# (WinForms) - Find Colour of Cursor

c#,winforms,colors,cursor,screen
My Aim: I'd like to have the ability to retrieve the colour on the screen including the cursor, from certain coordinates. In other words, I suppose you could say I'd like to retrieve the colour of the cursor (or at least, a certain point/pixel on the cursor). My Difficulty: I...

nodejs & postgres : best way to do select for update

sql,node.js,postgresql,cursor
I need to do 'select for update' in postgres database from node.js, i.e obtain a cursor, iterate on it and updating values if needed. I don't know if it is even possible in node.js and how. I have found https://github.com/brianc/node-pg-cursor which seems good for reading cursor, but nothing for updating...

Displaying a row selector (cursor / pointer) in a JTable

java,swing,jtable,cursor,selector
I'm migrating an MS-Access app to Java. My concern is about data grids. My first one is ok (JTable in a JScrollPane), but lacks the row selector (cursor) that you can see in MS-Access grids or OpenOffice Base grids. By "row selector", I mean the little black arrow at the...

Android SimpleCursorAdapter and CursorLoader

android,android-listview,cursor,simplecursoradapter
I have a android list layout. Basically it will list user's info on the screen. Please help me explain how the listView set the data. How the SimpleCursorAdapter links with Loader Here's code : public class ChatList extends ListActivity implements LoaderManager.LoaderCallbacks<Cursor>{ private SimpleCursorAdapter adapter; private final int Adapter_AccountName = 1;...

How to kill dead cursors in MongoDB

mongodb,cursor,timeout,pymongo
When querying a MongoDB collection, if the read will take a while, the cursor times out. There's a timeout=False option, which makes the cursor not time out, and then it must be closed manually. When a script crashes with an open cursor, that cursor presumably just stays alive in the...

Mac IntelliJ cursor style/type does not change (stays as default)

java,osx,intellij-idea,cursor,yosemite
Sometimes (every 10 minutes in average) the cursor style/type does not change from the default to edit or drag/resize when hoovering between various window components in IntelliJ Idea (OSX Yosemite). It stays stuck in the default style unless I do some weird combo such as right click in the editor...

Android Cursor RecyclerView does a flick on swipe

android,sqlite,cursor,swipe,recyclerview
I want to implement swipeable items in my recycler view. I'm using a custom recycler adapter populated with a Loader (Github link here) and a custom listener for swipe (Github link here). Data is stored locally with a SQLite and retrieved with a call to a filtered Cursor. I think...

How to insert a Cursor into UILable's Text

swift,ios8,cursor,uitextfield,uilabel
i need to insert a cursor in the text .. i don't want a textField (user don't type in it) .. i just need the cursor itself . so i can put it manually wherever i want .. like button's title . or UILabel .. I tried to just type...

Cursor returning 0

android,mysql,cursor
I have a function where I want to get the sum of values on a MySQL database table's row. This is my code: public int getSum(int var) { int x=0; // Select All Query String selectQuery = "SELECT sum(amount) FROM donations WHERE aid = '"+aid+"'"; SQLiteDatabase db = openOrCreateDatabase("shareity", Context.MODE_PRIVATE,...

Using cursor for fetching multiple rows and setting its data in columns

sql,join,cursor,db2
My scenario is I have to populate data into a table by performing join on two tables A and B on the basis of column quoteid and compid Table A ------------------------------ quoteid compid ................ 10004 1 10004 1 10004 1 10004 22 10004 22 10004 22 Table B ------------------------------------ quoteid...

How to implement an endless CursorAdapter?

android,android-listview,cursor,android-cursoradapter,android-cursor
At our company we are developing an app that displays a timeline. We are willing to let the user scroll it (almost) indefinitely. Now there are 2 facts to consider: loading a large cursor can have a bad impact on performances (true especially for old devices) cursors seem to have...

Application did not close cursor, despite getting closed

android,sqlite,cursor
I have an SQLite database in my Android Application. When I do one operation I always get a Finalizing a Cursor that has not been deactivated or closed. Here is the method: public String getKey(){ net.sqlcipher.database.SQLiteDatabase db = this.getWritableDatabase(Login.authPass); String selectQuery = "SELECT * FROM " + STABLE; Cursor cursor...

VBA - How to Set Cursor in a Specific Position in a Textbox?

vba,textbox,cursor
The title mostly explains what I need. I have a textbox that I continuously examine for data validity using the _keypress procedure. If the user enters ( then I auto-fill it for them by typing the closing parenthesis ). The result is () and the cursor is at the end...

how to make constant value in MSSQL without cursor

sql-server-2008,cursor
I have one table that I will loop without cursor in MSSQL. Unit Speed C Count x y A | 200 | 200 | 3 | 3 | 0 A | 230 | 230 | 4 | 7 | 0 A | 240 | 240 | 3 | 10 |...

Tricky data entry validation SQL query

sql,sql-server-2008,while-loop,cursor,logic
I'm trying to develop a query to validate user data entry and I'm stuck. Basically, we're working with information about a daily 24 hour composite water sample. The user will enter the "COLDATE" which is the end of the composite and is stored in DATETIME format like "2015-03-02 04:00:00.000". Then...

VB.net : Wait a bit before right clicking

vb.net,cursor,mouseevent
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Me.Cursor = New Cursor(Cursor.Current.Handle) Cursor.Position = New Point(800, 500) 'mouse_event WaitFor2 seconds??? Cursor.Position = New Point(800, 500) mouse_event(&H8) Cursor.Position = New Point(800, 500) mouse_event(&H10) End Sub I am trying to make the cursor wait a few seconds before right-clicking. I've...

SQL cursor result in infinite loop

sql-server,tsql,sql-server-2008-r2,cursor
I'm trying to insert invoice items to existing invoice with negative value for quantity. I decided to use cursor for this but when I run the query it results in infinite loop. Here is my code: declare @cKey char(13); set @cKey = '1512000000043'; -- declare cursor to get -- all...

PLSQL Need REFCURSOR DATE + TIME

date,time,plsql,cursor
im using this code and I had 1 problem, the o_besteltijden cursor has this as output: 01-06-15 ( a date), but I prefer output like: 16:00 (so only time) Or 01-06-15 16:00:00 (date + time). is that possible? SET SERVEROUTPUT ON; CREATE OR REPLACE TYPE t_openingstijd IS TABLE OF DATE;...

Pl/Sql open cursor problems

database,plsql,oracle10g,cursor
I have code like, create or replace function ... return types.cursortype as l_cursor types.cursorType; begin open l_cursor for select ... ; return l_cursor; end; this code is used to return hundreds of records daily. Will these open cursors cause any memory leak issue ? Is there any way to close...

How to iterate an int column for each distinct value in SQL?

sql,sql-server,cursor
I've been trying a query to update my current database but I can't figure out how to do it. I've been trying with cursors but I can't find a way to isolate each row and not set all the rows of the distinct column to the same value. Here is...

Why is it a common practice to encode pagination cursors or id values as string?

facebook-graph-api,design,cursor,base64
For example the Facebook Graph API: why are after and before base64 encoded numbers? { "data": [ ... Endpoint data is here ], "paging": { "cursors": { "after": "MTAxNTExOTQ1MjAwNzI5NDE=", "before": "NDMyNzQyODI3OTQw" }, "previous": "https://graph.facebook.com/me/albums?limit=25&before=NDMyNzQyODI3OTQw" "next": "https://graph.facebook.com/me/albums?limit=25&after=MTAxNTExOTQ1MjAwNzI5NDE=" } } What benefits could it possibly bring in contrast to just plain numbers?...

TkInter: how to display the normal cursor?

python,tkinter,cursor
I have a simple TkInter interface where, after a button click, the cursor of the mouse is changed to fleur. Now, after the task using this cursor is done, I want to use a normal cursor. By normal I mean the cursor you see now on your own computer. I...

Detect whether or not cursor is in Text widget

python,python-3.x,tkinter,cursor
I am writing a text editor in Python 3 with tkinter, and I'm trying to add an undo function, but in order to log the user's edits I need to log the edit when they type a letter. However, I don't want to log the typed letter if they have...

Pythons fetchall eats all my swap memory

python,sqlite,cursor,fetchall
I'm executing a query on a table where I get a column with some hundred million rows back, this is because I want to plot them in a histogram. The problem is that this eats up nearly all my memory (7.8 gb) and all my swap memory (8gb) before the...

Wrong DURATION in MediaStore.Video.Media.DURATION

android,video,cursor,duration,mediastore
I'm trying to record video in my application and I've noticed that displaying their duration, I see wrong minutes \ seconds. This happens only with the video recorded trough the following code. With the video recorded through other apps, the duration is displayed right: public void recordStream() { //Release Camera...

Java.Lang.NumberFormatException: How to format cursor object to get int value

android,cursor
I have the following code with me. I am getting a cursor object from the db query, the query actually returns a integer value. I need to get the integer value from the cursor object. I am trying the following method and it is returning an exception. Can any one...

inserting (+update) into multiple tables from query without loosing reference

sql,oracle,reference,insert,cursor
I have this problem... I have 3 tables - RL_EST_SH (ID,PARTY_ID), PARTY(ID), COMM_PROP(PARTY_ID,PERSID1,PERSID2) ...tables have other columns, but they are irrelevant.. RL_EST_SH is filled with IDs and other two are empty. Than I have a query, select that returns me this resulet set(showing only first 10 rows): REAL_ESTATE_SHARE_ID PERSON_ID1 PERSON_ID2...

T-SQL Cursor in stored procedure

sql-server,stored-procedures,cursor
I am using a stored procedure and I want to use cursor for inserting new data (if data exist I want to update) ALTER Procedure [dbo].[conn] @ResellerID int, @GWResellerID int, @UserName varchar(50), @Password varchar(50), @URL varchar(100), @ServiceType int, @ServiceDesc varchar(50), @FeedFrom bit, @PublicKey varchar(max) AS declare gateway cursor for select...

CursorLoader, unsubscribe from ContentProvider notifications

java,android,cursor,android-contentprovider,android-cursorloader
I'm using a CursorLoader to query a ContentProvider to populate a ListView, with the following code (wrapped in a LoaderManager): CursorLoader loader = new CursorLoader(getActivity(), Provider.CONTENT_SOME_URI, projection, selection, null, null); And an AsyncQueryHandler to update SOME_VALUE for a given _id triggered on click on a CheckBox placed on every single...

How to assign variable if Cursor returns Bit of 0

tsql,cursor
I have written a cursor to search through a table looking at one bit value. If all values are 1, I send an email. But if one value is 0 in any row, I don't send the email. The issue that I am having comes in my If statement. In...

SQL Syntax error #1064 cursors (mysql)?

mysql,sql,if-statement,stored-procedures,cursor
So my procedure looks something like this: OPEN tstamp_cursor; get_timestamp: LOOP FETCH tstamp_cursor INTO cSID, ctstamp; IF finished = 1 THEN LEAVE get_timestamp ; END IF; SET @MID = 0; SET @MX = 0; SET @MY = 0; SET @MT = 0; SELECT @MID:=m.vID, @MX:=m.x , @MY:=m.y , @MT:=m.timestamp FROM...

MySQL insert - for each row, return insert id

mysql,cursor,bulkinsert,last-insert-id
Let's say I have an array of data to insert. I'm going to have an insert that looks like this: INSERT INTO `table` (`name`, `value`) VALUES('name1','value1'),('name2','value2') We're assuming that table has a primary key. Is there a way to, while batch inserting like this, grab the last insert id for...

SQL cursor works but db doesn't save changes

sql-server,cursor,replacewith
I have a table which has undesired characters(Ý) and I want to replace it with "I". Before I have tried that code for another column name and it worked perfect. But now while debuging I can see it fixes the rows but at the end db has no change... This...

Hide Cursor script doesn't work correctly in Unity 5

function,unity3d,cursor,unityscript
I've a simple hide cursor script attached in the "FirstPersonCharacter" GameObject and doesn't work correctly. #pragma strict var blocked = false; function Start () { blockCursor (false); } function blockCursor (blocked) { this.blocked = blocked; Screen.lockCursor = blocked; Cursor.visible = !blocked; } function Update () { if (Input.GetKeyDown("e")) { blockCursor(!blocked);...

What is faster - a Cursor or ArrayList?

java,android,sqlite,arraylist,cursor
I have an SQLite database which I have to be constantly retrieving data from. Changes may be done to the data between each retrieval. My goal is to maximize the app performance, so what is the fastest way to do this retrieving? I can imagine 2: constantly opening and closing...

Button cursor doesn't display right

java,swing,button,cursor
I have jframe with 2 jpanels. I have some components on first jpanel and button on second. When i click on jbuton (call method removeAll) on first panel it removes all components(i call method revalidate(), repaint()) within the that jpanel then i show second panel with components. Long story short,...

What is the differece between my codes when I use cursor to fetch my data with repeat and do while?

mysql,stored-procedures,cursor,mysql-workbench
I use cursor to fetch my datas.The number of my data is two.But I find that when I use repeat to fetch my data,it always fetch 3 times. And When I use do while,it is right which fetch 2 times.What is the different of thest two ways?How to fixed the...

Cursor for spliting t-sql @xml variable on elements level

sql-server,xml,tsql,cursor
I need to define some cursor for spliting t-sql @xml variable on elements level into different @xml(s). for example: <root> <element id=10/> <element id=11/> <element id=12/> <element id=13/> </root> so that get the following values inside of tsql cursor: <root><element id=10/><element id=11/></root> then <root><element id=12/><element id=13/></root> and so on where...

Which pointer object (i.e., cursor) to use when resetting game.input.onDown

javascript,cursor,reset,phaser-framework
I'm having a problem where I need to reset the game.input.onDown event in the same way as Phaser.Key.reset. It seems like this is doable with the Phaser.Pointer.reset method. Unfortunately, there seems to be a bunch of different potential pointer objects in the Phaser.Input class, and I'm not sure which one...

How to use ResultSet: absolute(int row) in java and dispaly retrieved rows in tabular format through jsp using jstl

java,jsp,cursor,resultset
I want to retrieve some specific rows from ResultSet by using absolute(int row) method.I have retrieved all the rows in tabular format by following code: public String[][] reference() { String a[][]=new String[46][2]; int i=0; try { con = getConnection(); stmt = con.createStatement(rs.TYPE_SCROLL_SENSITIVE,rs.CONCUR_READ_ONLY); String sql="select logtime,beam_current from INDUS2_BDS.dbo.DCCT where logtime between...

SQL Server Cursor Converting INT to Date

sql-server,date,cursor,sql-convert
I have a column where the date is stored as an integer. This is something that we cannot change because it is a part of an older ERP system. If I could change the column type to date or datetime I would. The dates are stored as yymmdd I am...

How to check if database is empty in SQLite Android with DatabaseConnector class

android,sqlite,cursor
I have a DatabaseConnector class where I want to check if the database is empty and then show an alert and a click on it will close the activity. This is my DatabaseConnector class public class DatabaseConnector { // Declare Variables private static final String DB_NAME = "MyNotes"; private static...

Run a rails query in batches

ruby-on-rails,ruby-on-rails-3,performance,postgresql,cursor
I have a table A(:name, :address, :phone) consisting of 500,000 entries. I want to run this query : johns = A.where(:name => "John") This query should return 150,000 results. But running this query gives me this result : Killed. How should I rewrite this query so that the query runs...

Cant see Overwrinting Cursor when i create new Line

java,swing,cursor
I'm trying to create an overwriting Cursor. I've got it except when I click an earlier line the caret disappears, then when I hit 'enter' for a new line it appears again. what should I change in my Code to solve this issue? here is my Caret Class: public class...

cursor is not displaying data in second activity

android,database,sqlite,cursor
I have a list of items, the data are stored in the SQLite. The problem occurred when I wanted to get detailed view of the item, it doesn't display any data. This is activity that displays all rows from the database in a listview, works great. public class List extends...

SQL - Adding user defined variables to table (mysql)?

mysql,sql,stored-procedures,phpmyadmin,cursor
So I have this code thats part of a stored procedure: SET @MID = 0; SET @MX = 0; SET @MY = 0; SET @MT = 0; SET @CSTAMP = '2014-6-06 08:03:19'; SELECT @MID=m.ID, @MX=m.x , @MY=m.y , @MT=m.timestamp FROM movement m WHERE m.ID = cSID AND m.timestamp = (SELECT...

How does Cursor work in android [closed]

java,android,cursor
I'm having a hard time exactly visualizing 'Cursor' functionality in my program. I kind of get the jist of it, but can anyone explain it's functionality in detail? By Cursor, I mean the Cursor interface. I can't simply understand the role it plays with anything. http://developer.android.com/reference/android/database/Cursor.html...

mysql append local variable inside a cursor

mysql,variables,stored-procedures,cursor
Having a brain fade moment and can't remember how to do the following: I have a cursor inside a stored procedure that's looping through a table of addresses. I am trying to build up a string variable of all the addresses found so that once the loop ends I can...

TSQL set concatenating varchar during cursor

sql,tsql,cursor
When debugging, @buildEvents gets filled the first time it enters the loop but then never gets concatenated the next time around. Is this possible inside of a cursor? OPEN @BusinessCursor; FETCH NEXT FROM @BusinessCursor INTO @BusinessName; WHILE @@FETCH_STATUS = 0 BEGIN set @buildEvents = @buildEvents + @BusinessName FETCH NEXT FROM...

Declare a Cursor From a Table as Variable (In the Select-Statement)

sql,sql-server,cursor
I want to create a SP that have 2 String parameters for 2 table names. In the SP I use dynamic SQL to modify one of the tables, but the other is inside a cursor, and I cant use dynamic SQL after the "FOR" ALTER PROCEDURE NameProcedure @SourceTable VARCHAR(100),@DestinationTable VARCHAR(100)...

Windows CE 6.0 (OEM 5.37) not displayed hourglass cursor

c#,cursor,windows-ce
I have a problem with displaying the hourglass and custom cursors in Windows CE applications on OEM 5 platform. Question is that the cursor does not display by default, and is displayed only when I click on the screen. Interestingly, the hourglass cursor spins correctly on OEM 4 platform. I...

Syntax error when creating stored procedure in DB2

sql,stored-procedures,cursor,db2
I am trying to create a stored procedure in DB2 which uses a cursor. However, I am having issues with the correct syntax and recieve the error: SQL0104N An unexpected token "=" was found following "N FOR SET v_party_id". Expected tokens may include: "JOIN". LINE NUMBER=12. SQLSTATE=42601 My procedure is...

Android How can I using Cursor get image and video thumbnails in my direct path both?

java,android,bitmap,cursor
How can I using Cursor get image and video thumbnails in my direct path in same cursor? I need get the image and video thumbnails in /DCIM/100ANDRO folder. But I just can separate to get image and video in at sd card all data. private ArrayList<ImageItem> getData() { final ArrayList<ImageItem>...

Cursor in procedure returning more values than query

sql,oracle,stored-procedures,cursor
I am using a simple cursor in a procedure that receives a couple of parameters. I then make a cursor on a select query with a where clause with multiple conditions, which are equal to the received parameters. This cursor should only return 1 row, instead it returns multiple rows....

Android get song from Media Store if you have the song ID?

java,android,search,cursor,mediastore
I got a song id from a playlist in MediaStore, using long id = cursor.getLong(cursor.getColumnIndex(MediaStore.Audio.Playlists.Members.AUDIO_ID)); and the id is correct, but as the only other data available is CONTENT_DIRECTORY, DEFAULT_SORT_ORDER, PLAYLIST_ID, PLAY_ORDER, and _ID, I am not sure how to get the important parts of the song. I need the...

iterating over a Mongo Cursor with finite batch size

mongodb,cursor,mongodb-query
How can I iterate over the following data cursor? Following code gives error " TypeError: Object [object Object] has no method 'forEach' var data = db.profiles.runCommand("aggregate", { pipeline: [ {$limit: 100000}, {$unwind: "$Items"}, { $group: { _id: "$Items", count: {$sum: 1} }, }, ], allowDiskUse: true, cursor: { batchSize: 100...

MySQL adding string to itself

mysql,sql,string,dynamic,cursor
I'm trying to add string to itself in MySQL in cursor, i need that for my dynamic SQL query. I have my string set before cursor ESQL3 = "FIRST PART OF QUERY "; Now in cursor i want to add the rest of the query, im using CONCAT() but i...

Do I need to close a Cursor if moveToFirst() is false?

android,cursor
If cursor.moveToFirst() returns false do I still need to close it? Since it returns false when the cursor is empty. I'm doubt about the correct approach: if (cursor != null && cursor.moveToFirst()) { // some code cursor.close(); } Or: if(cursor != null) { if (cursor.moveToFirst()) { // some code }...

Select , Compare and Update using cursors in Oracle

sql,oracle,oracle11g,cursor
I have two tables. Customer_Master has 3 Columns c_id, c_addr, c_trans Customer_Address has 3 Columns c_id, c_addr, pr I fetch Customer_Master into Cursor C1 and Customer_address into Cursor C2. The Select Statement in Cursor C2 has a Where conditions which is fed from Columns c_id and c_addr fetched from Cursor...

How to use sqlite to retrieve single result?

android,sqlite,cursor
I have this code that retrieves the last id public int retrieveLastId() { SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery("select "+ RECORDING_ID +" from " + DATABASE_TABLE + " ORDER BY "+ RECORDING_ID +" DESC LIMIT 1 ", null); int last = 0; last = Integer.parseInt(cursor.getString(0)); Log.e("sfsdlkfjs dfl sd",cursor.getString(0));...

UPDATE statement: Returning into refcursor

oracle,cursor,sql-update,sql-returning
I have a query that updates a set of records based on specific criteria. I want to get columns of the result set of that update statement and pass it back in a refcursor. I can get the result set by using RETURNING INTO, or in my case, RETURNING myrows...

Merging two parent > child table sets

sql,sql-server,cursor,common-table-expression
I need to get the data in two parent > child table sets merged/combined into a third parent > child table. The tables look like this: The only difference in the three sets of tables is that TableC has a TableType column to help discern the difference between a TableA...

Updating DB from onLoadFinished calls onLoadFinished again and again

android,cursor,android-contentprovider,loader,android-cursorloader
I have a situation in which I need to insert a row at a date and update all the entries after a particular date in an Activity For this, I thought I'll load the entries after the date with a LoaderManager Callback and use a ContentProviderOperation array to update all...

Optional output cursor as parameter

oracle,parameters,cursor,default-value,optional-parameters
I'm trying to cater for two applications. One calls a procedure with 2 cursors, the other with 1. Both are OUT SYS_REFCURSOR. Because of the difference in definition of the procedure, the change to one application will break the other. I am wondering if its possible to have the same...

StaleDataException:Attempted to access a cursor after it has been closed

android,cursor,simplecursoradapter
In my application, I'm using SimpleCursorAdapter to update Listviews. This SimpleCursorAdapter takes data from Cursor object. Here when I close cursor in onCreate method then it's throwing StaleDataException:Attempted to access a cursor after it has been closed. but when I removed this close method on cursor then it didn't happen...

Using a cursor in a trigger to change subject of db_sendmail

sql-server,cursor,sql-server-triggers,sp-send-dbmail
SQl Server 2008 R2 - I have a trigger that's set up to send an email to a specific email address that is monitored by a third party system which sends out messages to certain groups of people based upon the subject of that message. The limitation to this is...

CSS Cursor Event Change

javascript,jquery,html,css,cursor
I'm trying to make the cursor change on a specific event.. I don't know how to explain it but as an example, I want to change the cursor to progress when it's currently a pointer cursor (hovering links, buttons, else...) and I don't wanna type everything that has a pointer...

Error when query Empty SQLite DB

android,database,sqlite,cursor
I am writing an Android App and I have a DB Helper class to do just about anything that is related to a SQLite DB. Name of the class is "ResultsDbAdapter". Following are some info about the DB: private static final String DATABASE_NAME = "PROJECT_RESULTS"; private static final String DATABASE_TABLE...

How to convert a pymongo.cursor.Cursor into a dict?

python,dictionary,cursor,pymongo,square
I am using pymongo to query for all items in a region (actually it is to query for all venues in a region on a map). I used db.command(SON()) before to search in a spherical region, which can return me a dictionary and in the dictionary there is a key...

Using a cursor to access a MySQL database using Python?

python,mysql,cursor
I'm in the process of writing a simple Python script which grabs some data from an API and inserts it into my database. I would use a language I'm more familiar with, but as far as I'm aware, the API I'm working with is only accessible in Python. Naturally, I'm...

confused on how to properly use %rowtype for many tables

plsql,cursor,rowtype
I'm attempting to create a derived table of country data from several other tables. Those tables look something like this: Countries ID | Name Country_demographics ID | date | Population | urban_pop | birth_rate country_financials ID | date | GDP | GDP_per_capita Now, I'm trying to make a new table...

RuntimeException on Retrieving Contact Data Android

java,android,cursor,android-contacts,runtimeexception
As a part of a simple practice program I am working on, I would like to retrieve data from my cell phone's contacts, specifically the phone number of a selected contact, or all of them, if there is more than one. I begin by launching the Contacts application and allowing...

How to process an integer list row by row sent to a procedure in SQL Server 2008 R2?

c#,tsql,sql-server-2008-r2,cursor
I have an ArrayList (in C#) that contains some int numbers (those are IDs in a table), I want to select some data for each number(s) in this ArrayList and return a table variable or a #temporary table :) I found a solution for passing this ArrayList as an user-defined...

Dynamic query in Cursor for %rowtype

stored-procedures,plsql,oracle11g,cursor,oracle-cursor
I need to create a record type to contain the result set of the above query of V_SQL VARCHAR2(200) := 'SELECT T1.'||record_id||',T1.'||card_no||',T2.TEST_CARD_NO, T1.'||type_cc||' FROM '|| table_name||' T1 INNER JOIN TEST T2 ON T2.ID = T1.'||record_id; So that I can use t1 C_BRNGB_EXTRACT%ROWTYPE (plus another column for t2.col4%TYPE inside l_BRNGB_EXTRACT) inside...

If statement with cursor?

android,sqlite,if-statement,cursor
So what I am trying to do is display some information from my sqlite database into a listview. I got the basics down for that but how I display the information needs to be conditional from what the cursor gets back. Currently my cursor comes back liek this. { id_number=1234...

access the system caret blink rate in java

java,swing,textbox,cursor,caret
I am implementing a simple embedded text editor in java. For the convenience of my users I would like to use the caret blink rate they have set as a system property in their operating system. I am not using a swing or awt text box, but rather building one...

Cannot update, READ-ONLY - Visual Foxpro

cursor,append,visual-foxpro
This is my code CURSORSETPROP("Buffering",4) SELECT course APPEND BLANK replace course.name with thisform.txt_course.value this works fine during the development of the project, however,when i convert the project to .exe file, I cant write to the table and it brings the error Cannot update the cursor course, since it is read-only...

What code is required to swap a javascript variable (trailimage) to another when clicking within a website

javascript,jquery,image,variables,cursor
When clicking (onmousedown or onclick) for example, I would like to change the variable of the trailimge in the javascript to another image. You see, I have an image (a hand) that is following the cursor coordinates. I am unable to code and change the current image to swap to...

Creating a trigger instead of UPDATE on a view

sql,sql-server,triggers,cursor
I have a view and a trigger that overwrites UPDATE. I try to understand the code, however I am having some troubles with line from deleted and from inserted - Are these automatically created by original update? Does it mean that if I call this trigger, first the update gets...

Using Prepare and Execute

mysql,stored-procedures,cursor,into-outfile
I have a table that has training records. Each record has a field with an Agency value. I have another table of just agency values. I want to export the records into CSV files for each agency. There are over 2 million records so I don't want to export the...

Set onclick to item that isn't visible

android,listview,onclick,cursor,adapter
So I have been looking around for about 4 hours now and maybe I just don't know how to word my search, but I am not finding out what I need. I am using a custom adapter to setup my listview from items I have stored into an sqlite database....

In multiline textbox, my cursor automatically goes to next line

c#,winforms,textbox,cursor,multiline
I am making a messenger application using winForms. So when I type a message in the sender's text box and press enter, the message gets delivered but the cursor on my text box automatically goes to the next line for the first time. And then it stays there for all...

Why fgets takes cursor to next line?

c,string,cursor,scanf,fgets
I have taken a string from the keyboard using the fgets() function. However, when I print the string using printf(), the cursor goes to a new line. Below is the code. #include<stdio.h> int main() { char name[25]; printf("Enter your name: "); fgets(name, 24, stdin); printf("%s",name); return 0; } And below...

SQLite database query returns only one row

java,android,database,sqlite,cursor
Below is the code I'm using to grab all results stored in an SQLite table. The problem I am having is that it is only returning a single row when I know there are 21 rows in the DB. public HashMap<String, String> fetchResults(String TABLE_NAME, String sql) { HashMap<String, String> table...

How to hide console cursor in c?

c,cursor,windows-console
I have a simple C program that represents a loading screen within the console but I can't get the cursor to hide. I tried cranking up the speed of the sleep function so that the cursor timer would be reset and the cursor would be gone but that doesn't work....

Need help running 2 queries in a Cursor PLSQL

variables,plsql,cursor,records,sys-refcursor
I'm new to PLSQL and need to run one of either 2 queries based of the user input. I created this so far... Set serveroutput on; Declare cv_prod SYS_REFCURSOR; rec_d dd_pledge%ROWTYPE; rec_s dd_pledge%ROWTYPE; userinput varchar(1):='&Enter'; Begin If lower(userinput)= 'd' THEN OPEN cv_prod FOR Select dd_payment.idpay, dd_pledge.idpledge, dd_pledge.iddonor, dd_payment.paydate, pledgeamt/paymonths from...

Why cursor goes to next line while printing a file of one line?

c,file,io,cursor,printf
I have below C program to print the content of a file and to count total number of characters in it. #include<stdio.h> #include<stdlib.h> int main() { /*Declaring a FILE pointer fp.*/ FILE *fp; char ch; int noc = 0; /*Using fopen() to get the address of the FILE structure, and...

Failed to read row 0 column 3730

java,android,cursor,spinner,adapter
This is my code: dbAdapterdepartamento = new DBAdapterDepartamento(new Sqlitebbdd( getApplicationContext())); Cursor cdept=dbAdapterdepartamento.getAllDepartamentos(); cdept.moveToFirst(); while (cdept.isAfterLast() == false) { if (cdept.getFloat(cdept.getColumnIndex("_id")) == 0) { String title = cdept.getString(cdept.getColumnIndex("departamento")); Log.e("",""+title); } cdept.moveToNext(); } cdept.moveToNext(); departamentoSpinnerAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_dropdown_item, cdept, new...

Query Unread Texts for Specific Contact Android

java,android,cursor,sms
From this question I can see how to get total unread: Get number of unread sms I have searched for this on Google but unfortunately do not understand how I may go about this. I am wondering if it is possible to get the number of texts (unread) for a...

SQL stored procedure: increment months from a starting date to an end date

sql-server,tsql,date,stored-procedures,cursor
I'm trying to create a stored procedure in SQL Server that basically increments the months from a given start date up to a given end date and updates them into a predefined table. Problem: Somewhat like this: Exec MonthRunner @Start ='2014-01-01', @End = '2014-06-01' Should give me a table like...

Creating Stored Procedure to compare Date Column and update Status Column

sql,stored-procedures,plsql,cursor
I need a stored procedure to be created for comparing EXPIRYDATE column with SYSTEMDATE and if they match equal, then an additional column called MATCHSTATUS must be updated with value 1 and if they don't match then it must be update with value 0. Both EXPIRYDATE and MATCHSTATUS are present...

Infinite loop with sql cursor (Oracle 10)

sql,oracle,cursor,plsqldeveloper
I have an infinite loop with Cursor : DECLARE CURSOR cursor_ab IS SELECT num_ab FROM abonne; BEGIN OPEN cursor_ab; LOOP FETCH cursor_ab INTO numeroAb; dbms_output.put_line(numeroAb); END LOOP; CLOSE cursor_ab; END; / Do you have an idea ? Thank,...

How get information from multiple tables using cursor?

sql,cursor,teradata
I have a query, that returns multiple tables, something like that: SELECT TableName, DatabaseName +'.'+ TableName, ColumnName FROM DBC.Columns WHERE ColumnName = 'id' And I need to loop through these tables by looking to the information stored in these tables, in order to get only specific tables. I tried something...

Fetching data of a dynamic column from a dynamic view using cursor

oracle,plsql,cursor
The requirement is to check data consistency of a view. It's a bit complicated, so let's move step by step. A table check_data_column has basically 5 imp. columns: ViewName, ColumnName, Mandatory, MaxLength, DataType. It will contain Information about each field of a particular view. For example: ViewName: Employee_V ColumnName: EmployeeNo...

DatabaseUtils cursorRowToContentValues converts blob to string

android,cursor,blob,android-cursor
I just stumbled upon a problem with Android's DatabaseUtils.cursorRowToContentValues method. In the cursor the blob is correctly stored as a byte array. cursor.getBlob() also returns the correct value. However after using the utils method to convert it, the ContentValues contain a string and calling getAsByteArray returns null, because there is...