Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Data Select based on 2 columns

632265Jun 4 2010 — edited Jun 4 2010
Hi

I have table like this ,
Version: 

Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
PL/SQL Release 9.2.0.5.0 - Production
CORE	9.2.0.6.0	Production
TNS for 32-bit Windows: Version 9.2.0.5.0 - Production
NLSRTL Version 9.2.0.5.0 - Production
CREATE TABLE EMPSELECT( EMP NUMBER , CAR1 CHAR(2),CAR2 CHAR(2) );

INSERT INTO EMPSELECT VALUES( 100 ,   'XX',    'YY');
INSERT INTO EMPSELECT VALUES( 100 ,   'CC',    'YY');
INSERT INTO EMPSELECT VALUES( 100 ,   'CS',    'XX');
INSERT INTO EMPSELECT VALUES( 101 ,   'XX',    'YY');
INSERT INTO EMPSELECT VALUES( 102 ,   '2X',    'YY');
INSERT INTO EMPSELECT VALUES( 102 ,   'SS',    'Y2');
INSERT INTO EMPSELECT VALUES( 103 ,   'RR',    'XX');
INSERT INTO EMPSELECT VALUES( 103 ,   'RC',    'XX');
INSERT INTO EMPSELECT VALUES( 103 ,   'CC',    'CS');
INSERT INTO EMPSELECT VALUES( 101 ,   'TC',    'XX');
INSERT INTO EMPSELECT VALUES( 109 ,   'TC',    'FF');
I would like to select Emp records where XX not present in the two columns CAR1,CAR2 If find 1 row containing XX

OUTPUT:
Emp
102
109

Thanks
Ananda

Edited by: Ananda on Jun 4, 2010 4:19 PM

Edited by: Ananda on Jun 4, 2010 4:20 PM
This post has been answered by 009 on Jun 4 2010
Jump to Answer

Comments

User_64CKJ
From [Primitive Data Types|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html]
int: The int data type is a *32-bit* signed two's complement integer.
843807
Thanks, Andrew.

But the maximum value of the int data type is 2,147,483,647. The value that I passed in the int array size is only 90,189,840.

new int[size] -- size is 90,189,840

I assumed that one element in the int array is 1 byte. Thus, it tries to allocate about 90,189,840 bytes or ~86MB.

Thanks.
User_64CKJ
rei_xanther wrote:
..But the maximum value of the int data type is 2,147,483,647.
That is the maximum positive integer value that can be stored in (the 4 bytes of) a signed int, but..
..The value that I passed in the int array size is only 90,189,840.
..its only connection with RAM is that each int requires 4 bytes of memory to hold it.
new int[size] -- size is 90,189,840
Sure. So the number of bytes required to hold those 90,189,840 ints is 360,759,360.
I assumed that one element in the int array is 1 byte. ..
Your assumption is wrong. How could it be possible to store 32 bits (4 bytes) in 8 bits (1 byte)? (a)

a) Short of some clever compression algorithm applied to the data.
843807
Thanks Andrew for the information.

I increased the java heap size (-Xmx) to 512M and javaplugin.maxHeapSize to 512M.

Using the same data, I still encounter OutOfMemory error.

Same logs I provided, the difference is the display of the heap space used:
max heap: 508
javaplugin.maxHeapSize: 512M

Thanks.
843807
We are able to resolve the issue by calling System.gc() manually before processing the Print Preview.

But as far as I know, it is not recommended to call System.gc() in the codes.

Thanks.
843807
It seems that there are times JVM does not perform garbage collection, that's why there are some instances wherein the OutOfMemory error are replicated.

Kindly advise. Thanks.
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 2 2010
Added on Jun 4 2010
9 comments
1,341 views