ALTER TABLE with the column NULL time consuming
Hello
I have a table with nearly 2 million documents (about 10 GB size table) when I perform the following change statement its run fast
ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);
but when I do not give the NOT NULL in the alter its taking a long time to complete this i.e tbl_1 of ALTER TABLE ADD (NUMBER col_4 by DEFAULT 100); once I do the column as NOT NULL.
Can someone explain why is it happening like that regarding the execution point.
Thanks in advance.
I can reproduce the effect in 11.2.0.1 - but not in 12.1.0.1.
drop table tbl_1;
create table tbl_1
as
Select rownum id
, lpad ('* ', 50,' *') padding
of the double
connect by level<=>=>
ALTER TABLE tbl_1 ADD (NUMBER col_4 by DEFAULT 100);
--> slow in 11.2.0.1; fast 12.1.0.1
ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);
--> Quick 11.2.0.1 and 12.1.0.1
A SQL trace for two operations (11g) shows that the altar slow (without the constraint explicit non-null) made explicit (and tedious) update of any row in the table:
Update 'TBL_1"set"COL_4"= 100
call the query of disc elapsed to cpu count current lines
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.02 0 1 0 0
Run 1 11,63 33.56 8336 1016125 2053531 1000000
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Total 2 11,63 33,58 8336 1016126 2053531 1000000
The other trace file does not contain the explicit Update. I guess in the optimized case that oracle stores somewhere that col_4 has the value 100 and updates only the line of the block after completing DML operations. But that's just a guess.
Tags: Database
Similar Questions
-
update to column values (false) in a copy of the same table with the correct values
Database is 10gr 2 - had a situation last night where someone changed inadvertently values of column on a couple of hundred thousand records with an incorrect value first thing in the morning and never let me know later in the day. My undo retention was not large enough to create a copy of the table as it was 7 hours comes back with a "insert in table_2 select * from table_1 to timestamp...» "query, so I restored the backup previous nights to another machine and it picked up at 07:00 (just before the hour, he made the change), created a dblink since the production database and created a copy of the table of the restored database.
My first thought was to simply update the table of production with the correct values of the correct copy, using something like this:
Update mnt.workorders
Set approvalstat = (select b.approvalstat
mnt.workorders a, mnt.workorders_copy b
where a.workordersoi = b.workordersoi)
where exists (select *)
mnt.workorders a, mnt.workorders_copy b
where a.workordersoi = b.workordersoi)
It wasn't the exact syntax, but you get the idea, I wanted to put the incorrect values in x columns in the tables of production with the correct values of the copy of the table of the restored backup. Anyway, it was (or seem to) works, but I look at the process through OEM it was estimated 100 + hours with full table scans, so I killed him. I found myself just inserting (copy) the lines added to the production since the table copy by doing a select statement of the production table where < col_with_datestamp > is > = 07:00, truncate the table of production, then re insert the rows from now to correct the copy.
Do a post-mortem today, I replay the scenario on the copy that I restored, trying to figure out a cleaner, a quicker way to do it, if the need arise again. I went and randomly changed some values in a column number (called "comappstat") in a copy of the table of production, and then thought that I would try the following resets the values of the correct table:
Update (select a.comappstat, b.comappstat
mnt.workorders a, mnt.workorders_copy b
where a.workordersoi = b.workordersoi - this is a PK column
and a.comappstat! = b.comappstat)
Set b.comappstat = a.comappstat
Although I thought that the syntax is correct, I get an "ORA-00904: 'A'. '. ' COMAPPSTAT': invalid identifier ' to run this, I was trying to guess where the syntax was wrong here, then thought that perhaps having the subquery returns a single line would be cleaner and faster anyway, so I gave up on that and instead tried this:
Update mnt.workorders_copy
Set comappstat = (select distinct)
a.comappstat
mnt.workorders a, mnt.workorders_copy b
where a.workordersoi = b.workordersoi
and a.comappstat! = b.comappstat)
where a.comappstat! = b.comappstat
and a.workordersoi = b.workordersoi
The subquery executed on its own returns a single value 9, which is the correct value of the column in the table of the prod, and I want to replace the incorrect a '12' (I've updated the copy to change the value of the column comappstat to 12 everywhere where it was 9) However when I run the query again I get this error :
ERROR on line 8:
ORA-00904: "B". "" WORKORDERSOI ": invalid identifier
First of all, I don't see why the update statement does not work (it's probably obvious, but I'm not)
Secondly, it is the best approach for updating a column (or columns) that are incorrect, with the columns in the same table which are correct, or is there a better way?
I would sooner update the table rather than delete or truncate then re insert, as it was a trigger for insert/update I had to disable it on the notice re and truncate the table unusable a demand so I was re insert.
Thank youHello
First of all, after post 79, you need to know how to format your code.
Your last request reads as follows:
UPDATE mnt.workorders_copy SET comappstat = ( SELECT DISTINCT a.comappstat FROM mnt.workorders a , mnt.workorders_copy b WHERE a.workordersoi = b.workordersoi AND a.comappstat != b.comappstat ) WHERE a.comappstat != b.comappstat AND a.workordersoi = b.workordersoi
This will not work for several reasons:
The sub query allows you to define a and b and outside the breakets you can't refer to a or b.
There is no link between the mnt.workorders_copy and the the update and the request of void.If you do this you should have something like this:
UPDATE mnt.workorders A -- THIS IS THE TABLE YOU WANT TO UPDATE SET A.comappstat = ( SELECT B.comappstat FROM mnt.workorders_copy B -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES WHERE a.workordersoi = b.workordersoi -- THIS MUST BE THE KEY AND a.comappstat != b.comappstat ) WHERE EXISTS ( SELECT B.comappstat FROM mnt.workorders_copy B WHERE a.workordersoi = b.workordersoi -- THIS MUST BE THE KEY AND a.comappstat != b.comappstat )
Speed is not so good that you run the query to sub for each row in mnt.workorders
Note it is condition in where. You need other wise, you will update the unchanged to null values.I wouold do it like this:
UPDATE ( SELECT A.workordersoi ,A.comappstat ,B.comappstat comappstat_OLD FROM mnt.workorders A -- THIS IS THE TABLE YOU WANT TO UPDATE ,mnt.workorders_copy B -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES WHERE a.workordersoi = b.workordersoi -- THIS MUST BE THE KEY AND a.comappstat != b.comappstat ) C SET C.comappstat = comappstat_OLD ;
This way you can test the subquery first and know exectly what will be updated.
This was not a sub query that is executed for each line preformance should be better.Kind regards
Peter
-
Grant table with the nested column.
Hello
I looked for an answer to this question, but I couldn't find it. So, here goes. I am trying to grant select on a table with a column that is nested in another user and still will not work select it. Here is an example.
FIRST_USER@TST > create type test_object as an object (ref01 varchar2 (3));
0 m
Type of creation.
FIRST_USER@TST > create type test_type is the table of the test_object;
0 m
Type of creation.
"afiedt.buf" 3 lines, 100 characters
1 create table table1 (x varchar2 (1), y test_type)
2 * store table is nested as type1_nt back as a value
FIRST_USER@TST > /.
Table created.
FIRST_USER@TST > grant select on table1 to SECOND_USER;
Grant succeeded.
SECOND_USER @TST > select * from FIRST_USER.table1;
Select * from FIRST_USER.table1
*
ERROR on line 1:
ORA-01031: insufficient privileges
I don't know I'm missing something. I may have to give the grant another way maybe? Help, please.
Thank you.See http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14260/adobjmng.htm#sthref786.
You must grant execute of the consumer on the underlying type.
-
Hi everyone, yet once landed upward with a problem.
After trying many things to myself, finally decided to post here...
I created a form in form builder 6i in which clicking on a button, the data gets exported to the excel sheet.
It works very well with a single table. The problem now is that I cannot do the same with 2 tables.
Because the tables have the same number of columns and the columns names.
Here are the 2 tables with column names:
Table-1 (MONTHLY_PART_1) Table-2 (MONTHLY_PART_2) SL_NO SL_NO MODEL MODEL END_DATE END_DATE U-1 U-1 U-2 U-2 U-4 U-4 .......... ........ .......... ........ U-20 U-20 U-25 U-25 Given that the tables have the same column names, I get the following error :
402 error at line 103, column 4
required aliases in the SELECT list of the slider to avoid duplicate column names.
So how to export data to excel that has 2 tables with the same number of columns and the column names?
Should I paste the code? Should I publish this query in 'SQL and PL/SQL ' Forum?
Help me with this please.
Thank you.
Wait a second... is this a kind of House of partitioning? Shouldn't it is a union of two tables instead a join?
see you soon
-
How to create the table with the rows and columns using the layout?
One of my friends advised me to put my site on the mode of provision as it is better than the standard as he said
but I couldnot make an ordinary table with the rows and columns in mode available th
y at - there someone who can tell me how to?
Thank you very muchWednesday, April 18, 2007 21:01:38 + 0000 (UTC), "Mr.Ghost".
wrote: > A friend of mine advised me to put my whole site on the mode of disposal as its
> better than standard, as he saysYour friend won't. Don't listen to him any more. Mode of disposal creates
very fragile and rigid code pauses at the first opportunity.Gary
-
GetLength errors on CLOB. Retrieves the size of a table with CLOB columns
Hello
I try to find the size of a CLOB to a table column and get the error
PLS-00306: wrong number or types of arguments in the call to "GETLENGTH.
When you try to use dbms_lob.getlength. Here is the code
declare
number num.
Start
for rec in (select xmlupload from FILE_TABLE where file_table_id = 33635) loop
NUM: = dbms_lob.getLength (rec.xmlupload);
end loop;
dbms_output.put_line (num);
end;
Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
I'm actually trying to find the size of a table with CLOB columns, is there an easy way to do this Besides using getlength and without having to contact the Administrators (they are outsourced)?It works fine on my computer, the version is also 10g.
SQL> declare 2 num number; 3 begin 4 for rec in (select cntnt from ims_toms_msge where rownum<3) loop 5 num := dbms_lob.getLength(rec.cntnt); 6 dbms_output.put_line(num); 7 end loop; 8 9 end; 10 / 3837 3837 PL/SQL procedure successfully completed.
You should check if xmlupload is the CLOB data type.
In addition, if you just want to get the CLOB size, you can use LENGTH() as well, you will get the same result;SQL> select length(cntnt), dbms_lob.getLength(cntnt) from ims_toms_msge where rownum<2; LENGTH(CNTNT) DBMS_LOB.GETLENGTH(CNTNT) ------------- ------------------------- 3837 3837
Published by: PhoenixBai on September 24, 2009 13:40
-
ALTER TABLE hf_altertest ADD COLUMN does not
I am using ORACLE 11g and my FDI is Developer SQL 4.1.1
It's all free PC version that has limits.
I tried on:
CREATE TABLE hf_altertest
(
contact_id INTEGER NOT NULL
, name VARCHAR (25)
, last_name VARCHAR (35)
PRIMARY KEY (contact_id)
);
ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN;
But when I go to run the ALTER TABLE statement then I get following error:
rror starting at line: 1 323 in command.
ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN
Error report-
SQL error: ORA-00904: invalid identifier
00904, 00000 - '% s: invalid identifier '.
* Cause:
* Action:
I can run the same code in MySQL without error.
This leads me to think that maybe I'm just bumping into a limit in the free version of PC.
Any thoughts?
3003916 wrote:
I am using ORACLE 11g and my FDI is Developer SQL 4.1.1
It's all free PC version that has limits.
ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN;
But when I go to run the ALTER TABLE statement then I get following error:
rror starting at line: 1 323 in command.
ALTER TABLE hf_altertest State to add a CHAR (2) COLUMN
Error report-
SQL error: ORA-00904: invalid identifier
00904, 00000 - '% s: invalid identifier '.
* Cause:
* Action:
I can run the same code in MySQL without error.
This leads me to think that maybe I'm just bumping into a limit in the free version of PC.
Any thoughts?
There is no LIMIT to the 'free' version If you read the error message he said THAT was not a valid identifier. Just to show you that I tried your erroneous statement
ALTER TABLE hf_altertest ADD COLUMN state2 CHAR(2);
and here is the indicator error message in SQL +.
SQL * more: Production of liberation 12.1.0.2.0 Tue Oct 15 14:34:57 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
With the partitioning, Real Application Clusters, Automatic Storage Management, OLAP
and Data Mining options
Add a COLUMN state2 TANK (2)
*
ERROR on line 2:
ORA-00904: invalid identifier
As you can see (and as the previous poster of response indicates), the 'COLUMN' KEYWORD is not necessary when adding new columns. Only when 'RENAME' is used, then you add the keyword COLUMN.
See the documentation for the syntax of ALTER TABLE here--> http://docs.oracle.com/database/121/SQLRF/statements_3001.htm#SQLRF01001
See specific clause RENAME syntax here--> http://docs.oracle.com/database/121/SQLRF/statements_3001.htm#i2183480
-
Manipulation of the table with the recurrence
I have a 2D chart which is similar to an adjacency matrix. The table contains information that I need to analyze following a set of simple rules, but I'm unable to implement them. Here is a simple example of the table (I would like to get the simple example job, and then expand as needed to work with the greatest examples). The table is a table of 6 x 6 and the columns contain information about a procedure of transition between nodes in a map. There is a root column (column we will begin by) and there are sheet columns, columns, we strive to achieve by browsing through other nodes in the graph (other columns in the table). In the example below there is that a single root and a leaf, root is column zero and the leaf column 6 (I chose the marking of the nodes so that the zero column would be the root and column 6 would be the leaf but it doesn't have to be the case and I'm writing the software so that it is not dependent on the labelling of the map). Outside the entrance to 2D table, there will be an array of column headers that maps the label of node to the right column of the table, a table of leaves and a digital control for the root. That's what I try to do, refer to the image below.
I look at the root and see that this is node 1, the column header looking I see that node 1 is column zero of my table. I start with the line 0 in column 0 (the root column) and work my way down looking for integers not dummies. I'm a rank, then see the integer 2, that tells me that I need to move the column 1 of the table (because the column 2 header) and store the integer 2. I start with row 0 column and work my way down looking for integers not dummies. I just rank 2 and see integer 3, that tells me that I have to move to column 2 of the table (column 2 header 3) and store the integer 3 (while I now [1,2,3] as my path I'll build). I start at line 0 in column 2 and work my way down looking for integers no dummies and come in the 4th row is Integer 5, it tells me that I have to move to column 4 of the table (because the column 4 has 5 header) and store the integer while I [1,2,3,5] as my way. I start at line 0 in column four and work my way down looking for an integer not null and come 5th see 6, because integer integer 6 is my current journal (only sheet for this example) I stop and have a path from node 1 to node 6 [1,2,3,5,6]. I didn't even though (and this is the part that gives me bad) because the column 1 (node 2 header) had another line nonzero, rank 3, which contains integer 4. I need to repeat the process from here, give me a second track of [1,2,4,5,6].
You can see how this will get very complex when I have several columns with several lines non-zero. This seems to be a good case for use recursion, but I can't write the code to do this. In the end, I need to find all the ways to get from the root to the leaf, as I said that there is more than one sheet in most of the cases. Having many Leafs should not be a problem because I can repeat the same process for each leaf. I have attaced a VI in 8.0 which has berries that I work with, according to the picture above. I would like ideas on how to achieve this, as I refuse to do it by hand for great examples when I should be able to easily automate this process.
Concerning
This version fixes two problems I mentioned - one was caused by the queues the starting point outside the loop (a legacy of my original idea), the other to not deal with the final loop iteration when there is nothing in the queue (fixed with an additional business structure). You need is a graph (that is to say, have links back and forward)? Otherwise you could do a little more efficient with a directed graph, by removing the link from 2 to 1, 3 and 4 to 2, etc.
-
Update a table with one column of another
Oracle 11g
Helloi'im trying to update the two columns of table SUPPORT (SUPPORT_X, SUPPORT_Y) with two columns of table POST_HTA_BT (POSTHTABT_GPS_X, POSTHTABT_GPS_Y)
Understand that the two tables have the colum below:
SUPPORT (SUPPORT_ID, SUPPORT_PLAQUE, POSTHTABT_ID, SUPPORT_X, SUPPORT_Y,...)
POST_HTA_BT (POSTHTABT_ID, POSTHTABT_GPS_X, POSTHTABT_GPS_Y,...)
The SUPPORT_PLAQUE has type varachar. Except the keys, the other columns are varchar type in both tables.
The point here is to update the support_x, support_y with posthtabt_gps_x and posthtabt_gps_y.But before the update we have Sheik if the fifth number of the support plate is a number of characters from "0" to "9"and the rest of the caracter of the support_plaque is '00000'
Please note that the support_plaque is stored in the table with the form: "0025800000!"
So I did the below script, I try to execute in sql develop.
SET SERVEROUTPUT ON
DECLARE
chiffre_liste varchar (200): = '0 ', '1', '2', '3', '4', ' 5 ', ' 6' ', 7', ' 8 ', ' 9';
CURSOR CUR_GPS_SUPPORT IS
Select MEDIA. SUPPORT_X, SUPPORT. SUPPORT_Y, POSTE_HTA_BT. POSTHTABT_ID, SUPPORT. EXPL_ID,
SUPPORTED. SUPPORT_PLAQUE, POSTHTABT_GPS_X, POSTHTABT_GPS_Y
support,.
POSTE_HTA_BT
where
SUPPORTED. SUPPORT_X IS NULL and
SUPPORTED. SUPPORT_Y IS NULL and
SUPPORTED. POSTHTABT_ID = POSTE_HTA_BT. POSTHTABT_ID and
SUPPORTED. EXPL_ID = POSTE_HTA_BT. EXPL_ID
Order of SUPPORT. POSTHTABT_ID;w_POSTHTABT_ID POSTE_HTA_BT. Type of POSTHTABT_ID %;
w_SUPPORT_X SUPPORT. TYPE % SUPPORT_X;
w_SUPPORT_Y SUPPORT. TYPE % SUPPORT_Y;
w_EXPL_ID SUPPORT. TYPE % EXPL_ID;
w_SUPPORT_PLAQUE SUPPORT. TYPE % SUPPORT_PLAQUE;
w_POSTHTABT_GPS_X POSTE_HTA_BT. TYPE % POSTHTABT_GPS_X;
w_POSTHTABT_GPS_Y POSTE_HTA_BT. TYPE % POSTHTABT_GPS_Y;BEGIN
DBMS_OUTPUT. Put_line ('loading the coordoonnees GPS - GPS Coord update takes care of starting ');FOR HEART LOOPING CUR_GPS_SUPPORT
w_POSTHTABT_ID: = cur. POSTHTABT_ID;
w_SUPPORT_PLAQUE: = cur. SUPPORT_PLAQUE;
w_SUPPORT_X: = cur. SUPPORT_X;
w_SUPPORT_Y: = cur. SUPPORT_Y;
w_POSTHTABT_GPS_X: = cur. POSTHTABT_GPS_X;
w_POSTHTABT_GPS_Y: = cur. POSTHTABT_GPS_X;If substr (cur.support_plaque, 5, 1 chiffre_liste) and substr (cur.support_plaque, 6, 5) = '00000'
w_SUPPORT_X: = CUR. POSTHTABT_GPS_X
w_SUPPORT_Y: = CUR. POSTHTABT_GPS_Y
END if;
EXCEPTION WHEN NO_DATA_FOUND THEN w_SUPPORT_X: = NULL and w_SUPPORT_Y: = NULL;
END;-Updated the table of the supports
Update SUPPORT
Set SUPPORT_X = w_SUPPORT_X,
SUPPORT_Y = w_SUPPORT_Y
where SUPPORT_PLAQUE = w_SUPPORT_PLAQUE;
-On valid imm? immediately
commit;
EXCEPTION when no_data_found then null;
-No details found
END;
END;
/and I got the following errors:
Error report:
ORA-06550: line 2, colum 34:
PLS-00103: symbol ',' met instead of one of the following symbols:* & = - + ; <>/ is mod remains not rem
<>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
like4 likec between | submultiset of type multiset Member
ORA-06550: line 2, column 52:
PLS-00103: symbol ';' met instead of one of the following symbols:), * & = - + <>/ is mod remains not rem = >
<>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
like4 likec between | Member of multiset must
ORA-06550: line 38, colum 48:
PLS-00103: symbol 'CHIFFRE_LISTE' met instead of one of the following symbols:(
Symbol "(" a été substitué à "CHIFFRE_LISTE" verser continuer.) "
ORA-06550: line 39, 12 colum:
PLS-00103: symbol 'W_SUPPORT_X' met instead of one of the following symbols:), * & -+ / at rem mod < Hurst (*) > rest and or.
multiset
ORA-06550: line 40, 12 colum:
PLS-00103: symbol 'W_SUPPORT_Y' met instead of one of the following symbols:. (), * @ % & = - + <>/ is mod remains not rem
<>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
like4 likec between | mult
ORA-06550: line 41, colum 9:
PLS-00103: symbol 'END' met instead of one of the following symbols:. (), * @ % & = - + <>/ is mod remains not rem
<>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
like4 likec between | multiset members
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.
* Action:I checked the line number, but do not see the error in my code.
Please could you help me?
peace
Hello
glad to know that it worked. In fact, I don't see the reason to make these complicated processes.
Remember the mantra:
- If you can do it with SQL then do it with SQL
Good evening!
Alberto
-
Create a table with one column '&; '.
Hi all
I need to create a column on my table with the character &. I try this way:
SQL > CREATE TABLE 'CRIMIS_CARGA '. "" TM_EXCEL_CONSEN ".
2 (NUMBER OF 'LINEA',
3 'ID_INSTITUCION & ASSOCIATE' VARCHAR2 (510 char));
but I can't because that ASD sqlplus to associate value...
The ideas people?
Kind regards
dbajugset the escape ' \'
Oracle@test > CREATE TABLE 'TM_EXCEL_CONSEN '.
2 (NUMBER OF 'LINEA',
3 VARCHAR2 (100)) 'ID_INSTITUCION\ & ASSOCIATE;Table created.
Oracle@test > desc 'TM_EXCEL_CONSEN '.
Name Null? Type
----------------------------------------- -------- ----------------------------
NUMBER OF LINEA
VARCHAR2 (100) ID_INSTITUCION & ASSOCIATE -
Siri in him sending text with the value 'NULL '.
When I say, "Siri, text my wife, 'X', ' Siri responds correctly,"here is your message to Jill: 'X'. "" " "Ready to send it?" I say 'Yes' and sends the message. As soon as I get a text from my carrier saying the recipient of the message was invalid. 100% of the time, I see that Siri has sent a text with the value NULL.
I tried to restart my phone. I tried to remove and re-add my contacts. Anyone else having this problem? Someone knows how to solve?
If it's by the carrier, you should contact them and see what they receive in return for their side. Ive had Siri send messages for me and I have never seen this one IOS.
-
kindly tell how to use the unique value of a table with the index 0
kindly tell how to use the unique value of a table with the index 0
Hi
Yep, use Index Array as Gerd says. Also, using the context help (+ h) and looking through the array palette will help you get an understanding of what each VI does.
This is fundamental LabVIEW stuff, perhaps you'd be better spending some time going through the basics.
-CC
-
Gears - error when you try to insert values into a table with multiple columns
Hello
I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.
I have:
var db = google.gears.factory.create('beta.database'); db.open('developerSet'); db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)'); var devName = "Davy" var devAge = 32; try { db.execute('insert into Developers values (?, ?)', [devName, devAge]); alert('success'); } catch (e) { alert(e); }
I get the error:
net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.
I use this reference: http://code.google.com/apis/gears/api_database.html
Everything works if I have only one field as:
var db = google.gears.factory.create('beta.database'); db.open('developerSet'); db.execute('create table if not exists Developers (DeveloperName text)'); var devName = "Davy" var devAge = 32; try { db.execute('insert into Developers values (?)', [devName]); alert('success'); } catch (e) { alert(e); }
I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56
Thank you
Davy
Yes, a SQLite database will persist between battery pulls. The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.
In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data. This adds extra overhead fresh for the final, delete and insert first for a given table. Instead, define and finalize your drawing before you create your table. Once created, review the static schema.
That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.
See you soon,.
Adam
-
Export an ADF table with default column order
Hello
Jdev 11.1.1.5.0
We have ADF Table with column drag and drop option. Also we have implemented ADF Table with excelHTMl type of export.
Everything works as expected. Only problem is if we try to exchange a few columns by drag-and - drop option and then export the table, we receive the order of the columns with brewing. But our demand is, the user must obtain the export with the initial order table by default.
It would be great, if you can suggest an idea to export the ADF table with default column order.
Thanks in advance,
MSR.
I realized the required functionality. We can restore the default order of the columns to aid
Function richeTableau = this.getFetchResultsTable (); Iterator rItr = rTable.getChildren () .iterator (); {while (rItr.hasNext ())} ((RichColumn) rItr.next ()).setDisplayIndex(-1); } Then we can call the real export help feature
queue the event via a JavaScript inserted into the page FacesContext context = FacesContext.getCurrentInstance (); Erks = ExtendedRenderKitService Service.getService (context.getRenderKit (), ExtendedRenderKitService.class); erks.addScript (context, "customHandler()"); -
Declare a type of table with multiple columns
I have a table with a column of type, and I want to create one with two columns.
My type is:
create or replace type "NUMBER_TABLE" in the table of the number;
And I use it in function:
FUNCTION GetValues()
return NUMBER_TABLE
as
results NUMBER_TABLE: = NUMBER_TABLE();
Start
Select OrderId bulk collect in: results from (select * from tbl_orders);
-Other code...
end;
I want select it be like this:
Select OrderId, OrderAddress bulk collect into: results from (select * from tbl_orders);
How to do this?Is that what you are looking for:
CREATE OR REPLACE TYPE two_col_rec AS OBJECT (empno NUMBER, ename VARCHAR2(10)) / CREATE OR REPLACE TYPE two_col_table AS TABLE OF two_col; / CREATE OR REPLACE FUNCTION GetValues RETURN two_col_table AS results two_col_table := two_col_table(); BEGIN SELECT two_col(empno, ename) BULK COLLECT INTO results FROM emp; -- RETURN results; END; / show errors
Maybe you are looking for
-
Access error in installation with DVD Toshiba RDXV50KF
Hello! When I access the configuration appears for 0.5 seconds, then disappears. seems I enter but will not let me see it. Any idea?
-
horribly slow automatic update download speeds.
Hello.. whenever I leave autoupdate download the updates of windows he thinks I need on my laptop, download speeds falls to the worse than dialup speed, even if im on a cable modem. theres a forum 'out there' that proposes to add 207.46.252.185 glob
-
print ingenvelopes on a PHOTOSMART 6510?
Is it possible to print envelopes on a PHOTOSMART 6510? If so, what should I do?
-
HP envy instalation unsuccessful 5530 network
I am upset beyond now. Less than a month earlier, this stupid printer worked very well. Laast night, it desides it will stop. I tried all the 'suggested solutions", including gel and reinstall the printer software and of course nothing worked. No
-
Large format HP Officejet Pro K8600 printer won't print larger sizes, more
I created a document editor of 13 "x 19". 13 x 19 ". I am trying to print and paper size continues to go to 4 x 6. I went into the settings of the printer and entered the two fron the tab general and on the Advanced tab in the 'printing preferences'.