cursor

Update oldID for the records recursively

泄露秘密 提交于 2019-12-11 07:58:57
问题 I asked a very similar question here but I need more advance query now. The situation is, we have about 20,000 records of customers. Customers can renew and we just create a new record for it. There is no exact tracing back to which record was actually renewed. Now we have added the old ID field and I want to populate it with the exact old record. Now if it is renewed one time, that has been taken care of my old question and I can do it. The problem is if a record was renewed 3 or more time,

Jquery-rotate cursor angle

耗尽温柔 提交于 2019-12-11 07:55:19
问题 I need rotate arrow with Jquery-rotate, but i dont know cursor's angle :( I try calculate it, but script not work. I want result like this http://www.lonhosford.com/content/html5/canvas/rotate_to_mouse.html <script type="text/javascript"> //<![CDATA[ $(document).ready(function(){ function diff(x, y) { var a = (x * Math.PI / 180) - Math.PI; var b = (y * Math.PI / 180) - Math.PI; return Math.atan2(Math.sin(b - a), Math.cos(b - a)) * (180 / Math.PI); } $('body').mousemove(function(e){ var x = e

ArangoDB Cursor Timeout

半城伤御伤魂 提交于 2019-12-11 07:40:59
问题 Using ArangoDB 2.3.1. It seems my cursors are expiring within a couple minutes. I would like them to last for an hour. I've set up my AQL query object with the TTL parameter as follows: { "query": 'removed actual query', "count": true, "batchSize": 5, "ttl": 3600000 } My understanding is that the TTL parameter should tell the server to keep the server for 3600000 milliseconds or 1 hour. But it expires within about 60 seconds. In fact, I've tried changing the TTL to several different numbers

read data from SYS_REFCURSOR in a Oracle stored procedure and reuse it in java

假装没事ソ 提交于 2019-12-11 07:27:15
问题 I have this table: CREATE TABLE "QMS_MODEL"."BOOKING" ( "ID" NUMBER ( 19, 0 ) CONSTRAINT "QMS_BOOKING_NN_1" NOT NULL ENABLE ,"CALL_TIME" TIMESTAMP ( 6 ) ); Then i have a simple stored procedure in Oracle that: 1.get a record from a table 2.update a column on the found record 3.returns by an OUT parameter a SYS_REFCURSOR that points to the found record : CREATE OR REPLACE PROCEDURE GET_BOOKING ( refCursorValue OUT SYS_REFCURSOR, bookingId IN QMS_MODEL.booking.id%type ) AS bookingResult QMS

How to search through a DB using a cursor( sqlite query) in android

北城以北 提交于 2019-12-11 07:11:39
问题 I am an android beginner. I am trying to design this simple application which takes the name of a city from the user using an editText View , compares that in the database , and returns the ZIP code of that city. Now ,I'm having a problem with the implementation of cursors. Please help.How can i query the database to fetch the corresponding code. EditText city; Button add,show1; RadioGroup choose; String k; @Override public void onCreate(Bundle savedInstanceState) { try { super.onCreate

Cannot filter ListView with CursorAdapter subclass

两盒软妹~` 提交于 2019-12-11 06:36:47
问题 I have a subclass of CursorAdapter and I would like to filter my listview. I know that this can be accomplished with an ArrayAdapter as stated here and that way using a custom CursorAdapter does not work for me. I would like to do this with a custom CursorAdapter . What should I override and can I have an example? 回答1: You can use CursorAdapter.setFilterQueryProvider to filter the list. I have an example on my blog -- it's in the context of an AutoCompleteTextView , but it should work the

CURSOR vs. UPDATE

二次信任 提交于 2019-12-11 06:35:41
问题 A company uses a SQL Server database to store information about its customers and its business transactions. A new area code has been introduced for your city. The area code 111 remains the same for telephone numbers with prefixes that are less than 500. The numbers with prefixes that are 500 and greater will be assigned an area code of 222. All telephone numbers in the Phone column in the Customers table are stored as char(12) strings of the following format, ‘999-999-9999’. i must make the

How to convert Row by row execution in to SET based approach in SQL

天大地大妈咪最大 提交于 2019-12-11 06:15:32
问题 I'm working on a huge SQL code and unfortunately it has a CURSOR which handles another two nested CURSORS within it (totally three cursors inside a stored procedure), which handles millions of data to be DELETE,UPDATE and INSERT. This takes a whole lot of time because of row by row execution and I wish to modify this in to SET based approach From many articles it shows use of CURSORs is not recommend and the alternate is to use WHILE loops instead, So I tried and replaced the three CUROSRs

Can't get data from database

♀尐吖头ヾ 提交于 2019-12-11 05:29:42
问题 I have three buttons to save, load and delete data from my database. TotalResults.java package com.example.simplegame; android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.util.Log; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class TotalResults extends Activity { DatabaseManager db = new DatabaseManager(this); String name; int score;

JTextPane - Make Caret Normal Size?

眉间皱痕 提交于 2019-12-11 05:23:06
问题 So I am trying to make the text in a JTextPane double spaced. Here's my code: MutableAttributeSet attrs = editor.getInputAttributes(); StyleConstants.setLineSpacing(attrs, 2); editor.getStyledDocument().setParagraphAttributes(0, doc.getLength() + 1, attrs, true); The problem with this, is, the curser (caret) is as big as three or four line spaces. How can I resize the caret to normal size? Here is a screen snip 回答1: Try this: editor.setCaret(new DefaultCaret() { public void paint(Graphics g)