SQLite Select * from table1 - cannot see last line
Hello
I did some testing with SQLite component on the Simulator and ran into a problem. When I try to retrieve the data from the database (storage works great... open the db to an observer and data file has been stored properly), I can't get the last line of the query. I have something in the sense of the following:
try { Statement _statement = m_db.createStatement("SELECT * FROM TABLE1"); _statement.prepare(); _statement.execute(); Cursor _cursor = _statement.getCursor(); if (_cursor != null) { while (_cursor.next()){ Row _row = (Row)_cursor.getRow(); // Read row. For example: int idx1 = _row.getColumnIndex("id"); int idx2 = _row.getColumnIndex("name"); String _id = _row.getString(idx1); String _name = _row.getString(idx2); } } _statement.close(); _cursor.close(); } catch (Throwable e) { Dialog.alert("unable to get row data"); }
The first problem is that _cursor.next does not succeed, and the loop is not executed. If I change the code to force it to enter the loop (ie. cursor.first and run the .getPixel etc... in any case), I always get the LAST row, even when I use the position (1, 2, 3, 4... etc) function. It's pretty boring. I develop this 5.0 and testing with 9700 Simulator. Any ideas why I would see only the last row?
Why the next file in the thropugh code above, I can't retrieve a row in the database?
Note I tried dogin cursor.first ()... . Run the .GetPixel and the. next(), don't always gets me the line after line and the other always returns false. I do a select empty in the database, all lines should be there (checked the structure of data in another program... it is fine), no idea why it isn't here?
Thanks in advance.
Figured this out, the _statement.execute (); should not be there.
Tags: BlackBerry Developers
Similar Questions
-
Select * from v$ PDB returning some lines of non - sys account DBA
I am unable to find any documentation related to this privilege can benefit a common user in CBD root of database that allows the user to select from V$ PDB
Server11:CPPPRD:Oracle: / u01/app > sqlplus C ##IMDBA - this user has a DBA role in the base of the root
SQL * more: Production of the version 12.1.0.2.0 on Mon Sep 14 08:26:17 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter the password:
Last successful login time: Fri Sep 11-2015 15:55:05-0600
Connected to:
Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production
With the partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified audit options
SQL > select * from v$ PDB;
no selected line
SQL > exit
Disconnected from the database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production
With the partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified audit options
Server11:CPPPRD:Oracle: / u01/app > sqlplus / as sysdba
SQL * more: Production of the version 12.1.0.2.0 on Mon Sep 14 08:26:36 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production
With the partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified audit options
SQL > select name from v$ PDB;
NAME
------------------------------
PDB$ SEEDS
APPPROD
SQL > exit
Disconnected from the database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production
With the partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified audit options
If you want that the common user will be able to view this data across all containers, you will need to use the container_data clause.
Run through the user SYS to the CBD$ ROOT the following command:
change user C ##IMDBA set container_data = container all = current
BTW, you can also specify that C ##IMDBA will have the ability to view the data across all the container only for V$ PDB by running:
change user ##IMDBA set container_data = all Molok sys.v_ C $pdbs = current
And you can also check the settings of data container by selecting CDB_CONTAINER_DATA
According to the Oracle doc:
container_data_clause
The
container_data_clause
allows the game and changeCONTAINER_DATA
to a common user attributes. Use of theFOR
clause to indicate whether to set or change the defaultCONTAINER_DATA
attribute or a specific objectCONTAINER_DATA
attribute. These attributes determine all of the containers (which can never exclude the root) whose data will be visible viaCONTAINER_DATA
objects to the common user specified when the current session is the root.Read more here:
http://docs.Oracle.com/database/121/Admin/cdb_mon.htm#ADMIN13931
http://docs.Oracle.com/database/121/SQLRF/statements_4003.htm#SQLRF01103
-
How to get data in the procedure after CREATE TABLE table1 AS SELECT * from table2
Hello
can any body tell me how to get the data in the new table created in the procedure. because it gives following error.
- Error (47,21): PL/SQL: ORA-00942: table or view does not exist
tableName: = "BCKUP_" | TO_CHAR (sysdate, 'ddmmrrrr');
tableDDL: = 'CREATE TABLE' | tableName. "AS SELECT * FROM Table1 where to_char(MSG_IN_TIME,''dd-mon-rrrr'') < sysdate - ' | daysNumber;
EXECUTE IMMEDIATE backUpDDL;
COMMIT;
DELETE FROM Table1;
How to select the data in the newly created table. as...
Select * from ". tableName;
Do not choose anything to get the number...
Just after backupDDL EXECUTE IMMEDIATE, simply refers to SQL % ROWCOUNT - who will be the number of lines.
Oh and DDL engages automatically, your commitment is redundant.
-
Cannot select from view even if she appears in ALL_VIEWS
Oracle documentation says that all_views "describes the views available to the user:
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14237/statviews_2117.htm
DBA_OBJECTS appears in the ALL_VIEWS, but I get an error "table or view does not exist" when I try to choose in this one.
Any thoughts on why this is happening?
SQL> SELECT COUNT(1) FROM all_views WHERE owner = 'SYS' AND view_name = 'DBA_OBJECTS' COUNT(1) ---------- 1 1 row selected. SQL> SELECT * FROM sys.dba_objects SELECT * FROM sys.dba_objects * Error at line 2 ORA-00942: table or view does not exist
Having the privilege of system "SELECT ANY TABLE" will let you see DBA_OBJECTS on ALL_VIEWS but does not let you choose in this one. You need explicit grant DBA_OBJECTS or DBA role to choose from in this one.
Check your session privileges:
SQL> select * from session_privs order by 1; PRIVILEGE ---------------------------------------- CREATE CLUSTER CREATE INDEXTYPE CREATE OPERATOR CREATE PROCEDURE CREATE SEQUENCE CREATE SESSION CREATE TABLE CREATE TRIGGER CREATE TYPE SELECT ANY TABLE UNLIMITED TABLESPACE 11 rows selected. SQL> SELECT COUNT(1) FROM all_views WHERE owner = 'SYS' AND view_name = 'DBA_OBJECTS'; COUNT(1) ---------- 1 SQL> select * from sys.dba_objects; select * from sys.dba_objects * ERROR at line 1: ORA-00942: table or view does not exist
Published by: birlenbach Chase on January 5, 2010 11:07
Added example -
SQL to update two columns in a TABLE2 from TABLE1
I know it's a simple question for some of you, but I am new to SQLs, so please help...
I have two tables, TABLE1 and TABLE2 as below, the two tables contains more records 50million then:
Now, I tried to use the following SQL to update the columns ID of WORK & STATIONID in TABLE2 but failed. BUS_FID in the two tables have been UNIQUE indexed and they can be used as primary keys to join these two tables.SELECT * FROM TABLE1. &&&&&&&&&&&&&&&&&&&&&&&&&&& ID BUS_FID WORKID STATIONID ---------------------- ---------------------- ---------------------- ---------------------- 28400000117234 245 13461428.25 16520877.8 28400000117513 403 13461428.25 16520877.8 28400000117533 423 13461428.25 16520877.8 28400000117578 468 13461428.25 16520877.8 28400000117582 472 13461428.25 16520877.8 SELECT * FROM TABLE2. &&&&&&&&&&&&&&&&&&&&&&&&&&& BUS_FID ID TRPELID RELPOS WORKID STATIONID ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- 114 28400000117658 28400000035396 23.225 115 28400000117659 28400000035396 23.225 116 28400000117660 28400000035396 23.225 117 28400000117661 28400000035396 23.225 118 28400000117662 28400000035396 23.225 119 28400000117663 28400000035396 23.225 120 28400000117664 28400000035396 23.225 121 28400000117665 28400000035396 23.225 122 28400000117666 28400000035396 23.225 123 28400000117667 28400000035396 23.225 124 28400000117668 28400000035396 23.225 125 28400000117669 28400000035396 23.225 126 28400000117670 28400000035396 23.225
with above code, Oracle gave following errors:UPDATE ( SELECT p.WORKID px, p.STATIONID py, p.BUS_FID pid, temp.WORKID tempx, temp.STATIONID tempy, temp.BUS_FID tempid FROM TABLE1 temp, TABLE2 p WHERE pid = tempid ) SET px = tempx, py = tempy; COMMIT;
Can someone help me fix it? Thank you ~ ~ ~SQL Error: ORA-00904: "TEMPID": invalid identifier 00904. 00000 - "%s: invalid identifier"
BTW, both two tables contains documents more than 50 million. So, if you have a better SQL to perform the same task, please let me know!
Appreciated your help in advance.Alias cannot be used in the query (sub-) where they are defined.
Concerning
Etbin
-
Select * from tbl1 less select * from tbl2 is null
Hi all
I have 2 tables with the same 8 column, a column has the value zero from top to bottom.
60 000 lines, tbl1 tbl2 has 70 000 lines.
I need to see the 10,000 lines of tbl2 that are distinguished by the lines of tbl1.
If I run select * from tbl1 intersect select * from tbl2, I get all the 60,000 tbl1 lines.
However, if I run select * from tbl2 less select * from tbl1 I get no line?
I can't understand why, can anyone help, please.
Thank you
KowalskyAre you sure that it's really 10,000 TBL2 lines which are distinguished by a line any in TBL1? Instead of 10,000 additional rows in double?
Justin
-
This morning my XP machine could see my Windows7, another XP machine and my own machine on the network.
Mine and the other XP are on MSHOMEAfter that improvement with the last XP fixed, it cannot see any other machine on the network, including himself.
Tried the wizard network on my machine
Apply the seven 2011 Msoft fixit.Restored the machine backwards from 5 days.
Still no luck
Any ideas?
I have reset the router and everything is now OK :(
-
ORA-22992: cannot use LOB Locators selected from the remote tables...
Oracle 10.2.1.0.4
Solaris 10
We try to access a table in another database via a db_link.
The table we are trying to access has a LOB.
We get the following error: ora-22992: cannot use LOB Locators selected from the remote tables.
Is there a way to get around this? We need the data in the BLOB field.
Thank you.See on metalink:
ORA-22992 has a workaround solution in 10 gr 2
DOC - ID: 436707.1Werner
-
Updated the MacBook Pro to ElCapita to Apple's Service. Now cannot restore last July 7 from Time Machine backup. Help, please.
Visit Time Machine FAQ of Pondini helps with Time Machine. It is a vast site with almost everything that you need for using Time Machine. You will not find a better resource for Time Machine in one place. Due to the disappearance of James Pondini is the site is no longer updated. Therefore, some information may be somewhat outdated.
-
I can not eject a dvd from my drive iPhoto super-cannot see the drive open up Adobe Photo Elements and organizer and then apps get hung up "not responding" and cannot do anything - I've fixed dozens of times w msg success drive. Help, please. Thank you!
Hello golden2,.
I understand that you have a DVD picture in your SuperDrive drive, but it is not mount on the desktop and will not eject.
Please, try the procedure described in this article using the disc is ejected.
Get help with the SuperDrive slot on your Mac - Apple Support loading
Do not eject discs or discs eject slowly
- If the drive ejects discs slowly or appears to have difficulty, insert and eject a disc several times. Check the disc to see if it has a label or other material stuck to the disc which increases the thickness. Remove the label if possible.
- If the disc does not eject, try pressing the eject on the keyboard button. Some older keyboards may use the F12 key to eject the disc.
- If the disc does not eject, try dragging the icon of the disk to the trash.
- If the disc will still not eject, try to hold down the mouse or trackpad button after you restart the computer. The Superdrive should attempt to eject the disc.
- If the disc still does not eject, reset the System Management Controller (SMC) and repeat steps 1 to 4.
- If the disc still does not eject, Contact Apple or an provider of services authorized Apple, or make an appointment with a Store Apple Store for further assistance.
Take care.
-
Can select last line of dynamically built DataGrid
It comes, essentually, what I'm doing:
private var dg:DataGrid = new DataGrid();
private var dgCols:Array = new Array();
private var dgArray:Array = new Array();
This section is too simplistic for tests only, it turns out that it was a good thing
var temp: Object = {};
temp [« 1 »] = « a » ;
dgArray.push (temp);
dgArray.push (temp);
dgArray.push (temp);
dgArray.push (temp);
dgArray.push (temp);
Build the columns in the data grid
of the col: DataGridColumn var = new DataGridColumn();
col.dataField = "1";
dgCols.push (col);
CGI Columns = dgCols;
dg.dataProvider = dgArray;
dg.allowMultipleSelection = true;
dataGridHolder.addElement (dg);
Nothing is really that the complex and datagrid generates very well. The problem that I am running is that whenever I scroll on the data grid, only the last line becomes highlighted. If I did the editable datagrid, I can select lines, other than the last of them and modify them, but only the last row is highlighted. If I build a datagrid is created at compile time, I do not understand this problem, I can highlight and select all the different lines and even several lines.
Someone at - he no clue as to what is happening and how to fix it?
List MX classes require that are unique to each dataprovider item. You have
put the same point there several times.
-
How to transfer a line of table (instance) from table1 to table2?
Hello - I am an active user of the following Adobe LC designer but I'm getting into difficult (for me) territory regarding the javascript coding!
My problem is the following: how to transfer an instance of array (lines) of the object table 1 to table 2?
that is, there are 2 tables on a form and I want to click a button that removes the first line from Table1 and insert this same line (data intact) at the bottom of table 2
the code I used below does not work! (it could be complete rubbish but, like miles off the mark)
var oTransferInstance = form1.pg1.subformRow [0];
var nIndexFrom = oTransferInstance.index;
var nIndexTo = form1.pg2.subformRow.index + 1;Form1.PG1.subformRow.instanceManager.moveInstance (nIndexFrom, nIndexTo);
Help, please! I'll be very grateful
concerning
David
Sure, send it to [email protected] and include a descriptionof the question.
Paul
-
SELECT count VS table1 (column1) select count (*) from table1
SELECT count VS table1 (column1) select count (*) from table1
Which is faster, or are they equal in the aspect of the effectiveness and the cost of memory?Hello
Reading this thread Øvre Asktom. You do not need to read anything except this, that would be perfectly answer to your question.
http://asktom.Oracle.com/pls/asktom/f?p=100:11:P11_QUESTION_ID:1156159920245
HTH
Aman... -
Hallo,
Sometimes, in the code for my application, I need to run smaller queries to retrieve data from the database.
I wonder if for these queries, it is necessary to define a View object or if I can avoid this for example creation and execution of a VO on the fly.
In this case I would not define a VO, given that queries will be never used to display data, but only for the internal logic.
A use case, I want to solve it next.
I would like to create a function to be used after validation for last inserted record by a user in a TableVO.
For example
Select the Id of the Table where UserId =? and Type =?
The query should be run in a managed bean...
public String okButton_action() {} OperationBinding operationBinding is BindingsUtils.getBindings () .getOperationBinding ("Commit");.
Object result = operationBinding.execute ();
If (! operationBinding.getErrors () .isEmpty ()) {}
Error handling
return;
}
Here, I need to:
1. run the query to get the Id of the last inserted record
2 call the setCurrentRowWithKey on the TableVO to update the display
and get the Id (identity/auto-increment) than the database
assigned to the field
return "return";
}
If I can create a function that creates / runs the VO on the fly and return the value ID... It is best to create it in a class of public services or in the implementation class TableVO?
I need to get the Id of the last line inserted since the ADF is not able to manage MS SQL Server identity fields (it seems that REFRESH AFTER INSERT cannot be used with non - Oracle DB).
Any notice will be welocome.
Thank you
Federico
The query should be run in a managed bean...
Much better to execute the query in the template project.
Example query: http://amit-adf-work.blogspot.com/2013/09/how-to-execute-sql-using-adf-application.html
If I can create a function that creates / runs the VO on the fly and return the value ID... It is best to create it in a class of public services or in the implementation class TableVO?
If you have the function that accepts the SQL as a parameter, then this should go to class util.
Dario
-
How to set the text in the last line of the table to be bold
Hi all
I have two tables in the report on my page and I would like to have the last line of the table as a "BOLD" text data.
I found a jQuery selector to select the last row of the table, but I do not know how to implement it in the Apex. I want to control what table will have changed last row and who won't.
Could someone help me how to create a dynamic action to accomplish, or if y at - there another solution?$("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
My test app:
user name: [email protected]
passwd: kurintest
appl: REPORT_APPL 12451
Thanks in advance,
JiriNico Martens wrote:
PS: If you worry about sql plsql context switching, use a box instead of my function. Which probably could increase performance.
Using this technique , analytics, and casewould be more effective and offer the best separation of concerns:
Source report
select product_id , sum(quantity_on_hand) qty , avg(quantity_on_hand) avg , case when count(*) over () = row_number() over (order by product_id nulls last) then 'bold' else 'normal' end font_weight from oehr_inventories group by rollup(product_id) order by product_id nulls last
HTML column expression
#PRODUCT_ID#
Avoid generating HTML in the query when it is possible that its impact on the ability to use the features of declarative report as column sorting and setting in the form. (See examples on page 3)
If you have a table with 100 rows and you show only 15 lines. Do you want the 15th line "BOLD" or just line 100Le.
It is really the important issue here. If the reports do not use paging and always show all lines, then it's trivial to implement using dynamic Action (as shown on page 2):
H4. WhenEvent: After refresh
Selection type: jQuery Selector
jQuery Selector: .report-standardH4. Real Action
Action: Run the JavaScript Code
Fire on loading the Page: Yes
Code:$(".report-standard tr:last-child td").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
(Here is to use appropriate DA / jQuery selectors to make sure that only reports including totals get this formatting applied...)
For more complex presentations, a report of custom line model is the way forward, as in the link in the previous thread of the OP: + {: identifier of the thread = 2436912} +.
Also note that the columns hidden, based on the GROUP_ID/GROUPING/GROUPING_ID functions are very useful in these reports. They can be used to report conditions of line to avoid the additional conditions to be ready in the query (as in the case above) and provide the break several levels of formatting.
Maybe you are looking for
-
Satellite A100-153: Adobe Premiere blocks - BSOD
HelloAs a result of this topic on the A100 and creation: http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=16384 I want to fix this problem on my girlfriend's cell phone.We have all two models Toshiba A100 (she has an A100-153 an
-
Re: Satellite L750 0% available, hip, charge
Hello I just bought a new Satellite L750-1XH today, but the battery does not fresh. It has now been plugged for hours, and he still says 0% avaiable, although she says that she is in charge. If I unplug the power cord it turns off immediately. I remo
-
Over the 5 days I had to format and reinstall a new OS on my HD 5 times. After 30 to 45 minutes of perfect use whenever the laptop simply crashes and I get an error that reflects a software or hardware failure. Evidence suggests that I get from peopl
-
HP Deskjet 2540 connected wireless to PC running Windows 8 With my previous printer that I could scan directly to my PC via the program "HP solution Center". I can't find instructions on how to do this on the PC above or a file on the installation di
-
HP: Please help - Mirror Image printing HP 6520 via windows 8.1
Please help :-( OK so I tried to figure this out for 5 hours as to believe I can do it but don't know how. I have a HP Photosmart 6520 printer all-in-one and I recently turned to a new laptop which is running windows 8.1. I try to print using mirror