Problem in using case
Can I use comparison operators like <,> etc. in case? I was trying to run the following query but its not working
SELECT ENAME,
CASE SAL
WHEN SAL>4000 THEN 500
END FROM EMP;
Can any one please help me?
Thanks in advance
Two types of case statements you can write.
1. Simple case
2. Searched case
refer the link..
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm
simple case
PRAZY@11gR2> select ename, case job when 'CLERK' then
2 'Job is CLERK'
3 else
4 'Not a CLERK'
5 end Job_Desc
6 from emp;
ENAME JOB_DESC
SMITH Job is CLERK
ALLEN Not a CLERK
WARD Not a CLERK
JONES Not a CLERK
MARTIN Not a CLERK
BLAKE Not a CLERK
CLARK Not a CLERK
SCOTT Not a CLERK
KING Not a CLERK
TURNER Not a CLERK
ADAMS Job is CLERK
JAMES Job is CLERK
FORD Not a CLERK
MILLER Job is CLERK
14 rows selected.
Elapsed: 00:00:00.00Searched case
PRAZY@11gR2> select ename, case when job = 'CLERK' then
2 'Job is CLERK'
3 else
4 'Not a CLERK'
5 end Job_Desc
6 from emp;
ENAME JOB_DESC
SMITH Job is CLERK
ALLEN Not a CLERK
WARD Not a CLERK
JONES Not a CLERK
MARTIN Not a CLERK
BLAKE Not a CLERK
CLARK Not a CLERK
SCOTT Not a CLERK
KING Not a CLERK
TURNER Not a CLERK
ADAMS Job is CLERK
JAMES Job is CLERK
FORD Not a CLERK
MILLER Job is CLERK
14 rows selected.
Elapsed: 00:00:00.06In searched case you can have different search conditions in each when clause and you can use relational operators.
HTH,
Prazy
Similar Messages
-
Problems with use cases in JDeveloper 11.1.1.1.0
Use cases made with JDeveloper 11.1.1.0.2 can not be used and edited in JDeveloper 11.1.1.1.0.
Same problems with Use Case Diagrams.
And it seems to be impossible to create new use cases in JDeveloper 11.1.1.1.0.
What are the differences between 11.1.1.0.2 and 11.1.1.1.0 if you look at use cases??In JDeveloper 11.1.1.0.2 each use case has one file with the folllowing name: *.xhtml_usc.
In JDeveloper 11.1.1.1.0 each use case has two files with a names like *.xhtml_usc and *.uml_usc (after standard migration with JDeveloper). I can still edit the *.xhtml_usc files, but I have no idea what to do with the *.uml_usc files. I can only open a Property-editor, but the properties I see have no relation with the text I used in my original use cases . New use cases only have a *.uml_usc file and a Property-editor. In javadoc the new use case does not appear.
My question is: why do I have two different use case files in JDeveloper 11.1.1.0 and how can I use the Property editor?? -
Problems with Use Cases for Process Integration
Hi there,
I'm reading the "Simple Use Cases for Process Integration" (http://service.sap.com/xi -> Media Library ->
Documentation) and try to setup the variants 1 up to 4. As per description I created the Technical and Business Systems in the SLD. Everything worked fine. But I can't find the created business systems in the Integration Directory When I click on Objects tab page -> Services without party and and choose Assign Business System, I can't see the desired business systems in the list. What am I doing wrong?
Cheers
Marchi Marc,
maybe the business system was already assigned?
1. check if the business system exists in the SLD
2. check if the business system exists in directory
3. refresh SLD cache (in directory menu)
4. try assigning once more
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
I've got problem in using CASE statetement Expression (OWB 9.0.4)
Here's my code :
CASE INGRP1.PARVW
when 'RG' then '1'
when 'WE' then '2'
end
then result is "Invalid relational operator" ???
What does it means ?
Please send me the correct syntax for using CASE statement
Thanks
VincentHere is example from one of my mappings:
case when trim(INGRP1.STATUS) = INGRP1.L_A then trunc(INGRP1.ACT_DATE)
when trim(INGRP1.STATUS) = INGRP1.L_S then trunc(INGRP1.ACT_DATE_ALFA)
when trim(INGRP1.STATUS) = INGRP1.L_C then trunc(INGRP1.ACT_DATE) end
The datatype of INGRP1.L_A,INGRP1.L_S,INGRP1.L_C,INGRP1.STATUS is char.
The datatype of output and INGRP1.ACT_DATE is date.
Your problem might be incompatible datatypes. Please check if the output has the same datatype as your return value. -
HP Prime crashes while using CAS and loses stored variables
As the title suggests I'm experiencing some problems while using CAS whit my new Prime (it arrived 3 days ago). While doing operations like scrolling up the screen and copying/pasting things, or simply defining new variables it happens that the prime crashes (sometimes it also restart itself) and loses all the variables I've stored.
The prime is running the latest FW (6030). I've also noticed that after the firmware upgrade the DataStreamer icon in the app library has became grey and an exclamation mark appears when I try to start it.
Any help or suggestion would be great.
Thank you in advnce,
M1cha3lI have only a little experience with Primes RPN.
It does seem that for user variable, you do need to first create them before storing anything to them. a ENTER OK creates user variable a and puts a 0 on stack 1:
123 ENTER, 'a' ENTER, Shift Sto> or 123_'a'_Shift Sto> ( _ = space key) store 123 in a and put 123 on stack 1:
Other more expert users may offer better advice. -
Problem in using aggregate functions inside case statement
Hi All,
I am facing problem while using aggregate functions inside case statement.
CASE WHEN PSTYPE='S' THEN MAX(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ELSE SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) END,
how can I achieve above requirement ? Con anyone help me.
Thanks and Regards
DGHi All,
Below is my query:
SELECT
CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT
ELSE POS.PACCT || '-' || DECODE(POS.SYSTEMCODE,'GMI1','1', 'GMI2','2', 'GMI3','4', 'GMI4','3', '0') ||POS.PFIRM|| NVL(POS.POFFIC,'000') END,
CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-')
ELSE POS.PFIRM||POS.POFFIC||POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-') END,POS.SYSTEMCODE,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,POS.PEXCH||DECODE(POS.PSUBEX,'<NULL>',''),
POS.PCURSY,
CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END ,
NVL(POS.PSUBTY,'F') ,POS.PSTRIK,*SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ,SUM(DECODE(POS.PBS,2,ABS(POS.PPRTQ),0))* ,
POS.PCLOSE,SUM(POS.PMKVAL) ,
TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
POS.UBS_ID,POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER ,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,TO_CHAR(POS.BUSINESS_DATE,'YYYYMMDD'),
POS.SOURCE_GMI_LIB,
--DECODE(POS.SYSTEMCODE,'GMI1','euro','GMI2','namr','GMI3','aust','GMI4','asia','POWERBASE','aust','SINACOR','namr',POS.SYSTEMCODE),
DECODE(p_reportid,'RVPOS_SING','euro','RVPOS_AUSTDOM','aust','RVPOS_AUSTEOD','euro','RVPOS_GLBLAPAC','asia','POS_RV_SN','namr','POS_PB','aust',POS.SYSTEMCODE),
POS.RIC,
CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
NVL(C.SSECID,POS.PCUSIP),
NULL,
POS.PYSTMV,
POS.PMINIT,
POS.PEXPDT,
CASE WHEN POS.PSUBTY='S' THEN SUBSTR(C.ZDATA2,77,1) ELSE NULL END,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
FROM POSITIONS_WRK POS LEFT OUTER JOIN
(SELECT * FROM CDS_PRODUCTS CP INNER JOIN FUTURE_MASTER FM ON
(CP.STRXCH=FM.ZEXCH AND CP.SFC=FM.ZFC AND CP.BUSINESS_DATE = FM.BUSINESS_DATE )) C ON POS.PCUSIP = C.SCUSIP
AND NVL(POS.PCUSP2,'X') = NVL(C.SCUSP2,'X')
WHERE
POS.PEXCH NOT IN ('A1','A2','A3','B1','B3','C2','D1','H1','K1','L1','M1','M3','P1','S1')
AND (POS.PSBCUS IS NOT NULL OR POS.PCTYM IS NOT NULL OR POS.PSTYPE ='S')
AND POS.BUSINESS_DATE = run_date_char
GROUP BY
POS.UBS_ID,POS.SYSTEMCODE,POS.RECIPIENTCODE,POS.BUSINESS_DATE,POS.PACCT,POS.PFIRM,POS.POFFIC,POS.PCUSIP,POS.PBS,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,
POS.PEXCH,POS.PSUBEX,POS.PCURSY,
CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END,
NVL(POS.PSUBTY,'F') ,POS.PSTRIK,POS.PCLOSE,TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,POS.PSUBTY,POS.SOURCE_GMI_LIB,RIC,
CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
NVL(C.SSECID,POS.PCUSIP),
POS.PYSTMV,
POS.PMINIT,
POS.PEXPDT,
CASE WHEN PSUBTY = 'S' THEN SUBSTR(C.ZDATA2,77,1) ELSE NULL END;Now, could you plz help me in replacing the bold text in the query with the requirement.
Thanks and Rgds
DG
Edited by: BluShadow on 16-May-2011 09:39
added {noformat}{noformat} tags. Please read: {message:id=9360002} for details on how to post code/data -
Problem in using socket streams with encryption and decryption
Hi,
I am developing a client/server program with encryption and decryption at both end. While sending a message from client it should be encrypted and at the receiving end(server) it should be decrypted and vice versa.
But while doing so i got a problem if i use both encryption and decryption at both ends. But If i use only encryption at one (only outputstream) and decryption at other end(only inputstream) there is no problem.
Here is client/server pair of programs in which i am encrypting the outputstream of the socket in client side and decrypting the inputstream of the socket in server side.
serverSocketDemo.java
import java.io.*;
import java.net.*;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.util.*;
import java.util.zip.*;
class serverSocketDemo
public static void main(String args[])
try
{ //server listening on port 2000
ServerSocket server=new ServerSocket(2000);
while (true)
Socket theConnection=server.accept();
System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
System.out.println("Connection request from : "+theConnection.getInetAddress());
//Input starts from here
Reader in=new InputStreamReader(getNetInStream(theConnection.getInputStream()),"ASCII");
StringBuffer strbuf=new StringBuffer();
int c;
while (true)
c=in.read();
if(c=='\n' || c==-1)
break;
strbuf.append((char)c);
String str=strbuf.toString();
System.out.println("Message from Client : "+str);
in.close();
theConnection.close();
catch(BindException e)
System.out.println("The Port is in use or u have no privilage on this port");
catch(ConnectException e)
System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
catch(IOException e)
System.out.println("Connection disconnected");
catch(Exception e)
public static BufferedInputStream getNetInStream(InputStream in) throws Exception
// register the provider that implements the algorithm
Provider sunJce = new com.sun.crypto.provider.SunJCE( );
Security.addProvider(sunJce);
// create a key
byte[] desKeyDataDec = "This encryption can not be decrypted".getBytes();
DESKeySpec desKeySpecDec = new DESKeySpec(desKeyDataDec);
SecretKeyFactory keyFactoryDec = SecretKeyFactory.getInstance("DES");
SecretKey desKeyDec = keyFactoryDec.generateSecret(desKeySpecDec);
// use Data Encryption Standard
Cipher desDec = Cipher.getInstance("DES");
desDec.init(Cipher.DECRYPT_MODE, desKeyDec);
CipherInputStream cin = new CipherInputStream(in, desDec);
BufferedInputStream bin=new BufferedInputStream(new GZIPInputStream(cin));
return bin;
clientSocketDemo.java
import java.io.*;
import java.net.*;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.util.*;
import java.util.zip.*;
class clientSocketDemo
public static void main(String args[])
try
Socket theConnection=new Socket("localhost",2000);
System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
System.out.println("Connecting to : "+theConnection.getInetAddress());
//Output starts from here
OutputStream out=getNetOutStream(theConnection.getOutputStream());
out.write("Please Welcome me\n".getBytes());
out.flush();
out.close();
theConnection.close();
catch(BindException e)
System.out.println("The Port is in use or u have no privilage on this port");
catch(ConnectException e)
System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
catch(IOException e)
System.out.println("Connection disconnected");
catch(Exception e)
public static OutputStream getNetOutStream(OutputStream out) throws Exception
// register the provider that implements the algorithm
Provider sunJce = new com.sun.crypto.provider.SunJCE( );
Security.addProvider(sunJce);
// create a key
byte[] desKeyDataEnc = "This encryption can not be decrypted".getBytes();
DESKeySpec desKeySpecEnc = new DESKeySpec(desKeyDataEnc);
SecretKeyFactory keyFactoryEnc = SecretKeyFactory.getInstance("DES");
SecretKey desKeyEnc = keyFactoryEnc.generateSecret(desKeySpecEnc);
// use Data Encryption Standard
Cipher desEnc = Cipher.getInstance("DES");
desEnc.init(Cipher.ENCRYPT_MODE, desKeyEnc);
CipherOutputStream cout = new CipherOutputStream(out, desEnc);
OutputStream outstream=new BufferedOutputStream(new GZIPOutputStream(cout));
return outstream;
Here is client/server pair in which i use both encrypting outpustream and decrypting inputstream at both ends.
serverSocketDemo.java
import java.io.*;
import java.net.*;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.util.*;
import java.util.zip.*;
class serverSocketDemo
private Cipher desEnc,desDec;
serverSocketDemo()
try
// register the provider that implements the algorithm
Provider sunJce = new com.sun.crypto.provider.SunJCE( );
Security.addProvider(sunJce);
// create a key
byte[] desKeyData = "This encryption can not be decrypted".getBytes();
DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey desKey = keyFactory.generateSecret(desKeySpec);
desEnc = Cipher.getInstance("DES");
desEnc.init(Cipher.ENCRYPT_MODE, desKey);
desDec = Cipher.getInstance("DES");
desDec.init(Cipher.DECRYPT_MODE, desKey);
catch (javax.crypto.NoSuchPaddingException e)
System.out.println(e);
catch (java.security.NoSuchAlgorithmException e)
System.out.println(e);
catch (java.security.InvalidKeyException e)
System.out.println(e);
catch(Exception e)
System.out.println(e);
startProcess();
public void startProcess()
try
ServerSocket server=new ServerSocket(2000);
while (true)
final Socket theConnection=server.accept();
System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
System.out.println("Connection request from : "+theConnection.getInetAddress());
Thread input=new Thread()
public void run()
try
//Input starts from here
Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");
StringBuffer strbuf=new StringBuffer();
int c;
while (true)
c=in.read();
if(c=='\n'|| c==-1)
break;
strbuf.append((char)c);
String str=strbuf.toString();
System.out.println("Message from Client : "+str);
catch(Exception e)
System.out.println("Error caught inside input Thread : "+e);
input.start();
Thread output=new Thread()
public void run()
try
//Output starts from here
OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
System.out.println("it will not be printed");
out.write("You are Welcome\n".getBytes());
out.flush();
catch(Exception e)
System.out.println("Error caught inside output Thread : "+e);
output.start();
try
output.join();
input.join();
catch(Exception e)
theConnection.close();
catch(BindException e)
System.out.println("The Port is in use or u have no privilage on this port");
catch(ConnectException e)
System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
catch(IOException e)
System.out.println("Connection disconnected");
catch(Exception e)
public static void main(String args[])
serverSocketDemo server=new serverSocketDemo();
clientSocketDemo.java
import java.io.*;
import java.net.*;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.util.*;
import java.util.zip.*;
class clientSocketDemo
private Cipher desEnc,desDec;
clientSocketDemo()
try
// register the provider that implements the algorithm
Provider sunJce = new com.sun.crypto.provider.SunJCE( );
Security.addProvider(sunJce);
// create a key
byte[] desKeyData = "This encryption can not be decrypted".getBytes();
DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey desKey = keyFactory.generateSecret(desKeySpec);
desEnc = Cipher.getInstance("DES");
desDec = Cipher.getInstance("DES");
desEnc.init(Cipher.ENCRYPT_MODE, desKey);
desDec.init(Cipher.DECRYPT_MODE, desKey);
catch (javax.crypto.NoSuchPaddingException e)
System.out.println(e);
catch (java.security.NoSuchAlgorithmException e)
System.out.println(e);
catch (java.security.InvalidKeyException e)
System.out.println(e);
catch(Exception e)
System.out.println(e);
startProcess();
public void startProcess()
try
final Socket theConnection=new Socket("localhost",2000);
System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
System.out.println("Connecting to : "+theConnection.getInetAddress());
Thread output=new Thread()
public void run()
try
//Output starts from here
OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
out.write("Please Welcome me\n".getBytes());
out.flush();
catch(Exception e)
System.out.println("Error caught inside output thread : "+e);
output.start();
Thread input=new Thread()
public void run()
try
//Input starts from here
Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");
System.out.println("it will not be printed");
StringBuffer strbuf=new StringBuffer();
int c;
while (true)
c=in.read();
if(c=='\n' || c==-1)
break;
strbuf.append((char)c);
String str=strbuf.toString();
System.out.println("Message from Server : "+str);
catch(Exception e)
System.out.println("Error caught inside input Thread : "+e);
input.start();
try
output.join();
input.join();
catch(Exception e)
theConnection.close();
catch(BindException e)
System.out.println("The Port is in use or u have no privilage on this port");
catch(ConnectException e)
System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
catch(IOException e)
System.out.println("Connection disconnected");
catch(Exception e)
public static void main(String args[])
clientSocketDemo client=new clientSocketDemo();
**** I know that the CInput tries to read some header stuff thats why i used two threads for input and output.
Waiting for the reply.
Thank you.Do not ever post your code unless requested to. It is very annoying.
Try testing what key is being used. Just to test this out, build a copy of your program and loop the input and outputs together. Have them print the data stream onto the screen or a text file. Compare the 1st Output and the 2nd Output and the 1st Input with the 2nd Input and then do a static test of the chipher with sample data (same data which was outputted), then do another cipher test with the ciphertext created by the first test.
Everything should match - if it does not then follow the steps below.
Case 1: IO Loops do not match
Case 2: IO Loops match, but ciphertext 1st run does not match loop
Case 3: IO Loops match, 1st ciphertext 1st run matches, but 2nd run does not
Case 4: IO Loops match, both chiphertext runs do not match anything
Case 5: Ciphertext runs do not match eachother when decrypted correctly (outside of the test program)
Problems associated with the cases above:
Case 1: Private Key is changing on either side (likely the sender - output channel)
Case 2: Public Key is changing on either side (likely the sender - output channel)
Case 3: Private Key changed on receiver - input channel
Case 4: PKI failure, causing private key and public key mismatch only after a good combination was used
Case 5: Same as Case 4 -
Transactions documentation and a difficult(?) use-case...
I would like detailed information about how TransactionMap work with different isolation levels, ie how both changes performed by the application holding the map and in the distributed cache is propagated between them etc.
More detailed information about the TransactionMap.Validator would also be very appreciated.
We also have one specific "use case" I would like advice about - it goes like this:
We use one type of main object that has a very tight coupling to a varying number (0 to a few hundred in the extreme case) small detail objects. All the detail objects are always required as soon as the main object is used. A given detail object is never referenced from more than one main object. We have (for performance reasons) decided to treat the detail objects as "part of" the main object. The main objects are stored in the cache.
Users can make changes to the main objects themselves or to there detail objects. A user should be able to perform many changes to many main objects (and there detail objects) and "commit" them all at once pressing a button.
Now to the problem:
We would like to allow users to make "non conflicting" changes to a main objects detail objects - ie if two users has changed different detail objects we want to merge the changes instead of refusing the modification at commit. To be able to do this we intend to keep version numbers not only on the main object but also on the detail objects.
We would like to use "transactions" to handle the requirement that all a users changes should be "committed" at once and either all be introduced or not introduced at all (in the event of hardware failure during update for instance!) but the default behavior of Transaction is as I understand it (I have so far just read about it not played around with it much!) to compare the "whole object" for equality in the prepare (and commit?) steps. We also need exact information about WHAT object(s) that had been concurrently modified in the case a commit cant be performed allowing the user to "refresh" the relevant detail object only and retry committing his changes.
How would we be able to implement our "use case" in a good and reasonably efficient way given Coherents features? Would it for instance be possible (with a reasonable effort) to create our own transaction validation that could perform "merging of "non-conflicting" changes to the same object and in that case how should we go about it?
Best Regards
MagnusHi Magnus,
Our entry processor functionality is your best solution, but unfortunately is not fully supported within a transactional context.
I would suggest using a combination of explicit locking (as opposed to implicit transactions) and our entry processor functionality (new in 3.1).
Using explicit locking, you can enforce atomic access to cache entries. Using the entry processor you can perform partial updates locally on the server (allowing you to send only changes).
So the sequence would be:
* lock all "main objects"
* if necessary, validate the main objects (see below)
* use entry processors to perform "delta updates" against those main objects
* unlock the main objects
The locking is only required for atomicity (ensuring that updates don't overlap), and does require that all modifiers follow the same locking pattern. You may either design your objects so that you know the delta updates will complete successfully, or you'll need to verify the updates will succeed prior to actually executing the updates.
Jon Purdy
Tangosol, Inc. -
Using case when statement or decode stament in where clause
hi gems..
i have a problem in the following query..
i am trying to use case when statement in the where clause of a select query.
select cr.customer_name || ' - ' ||cr.customer_number as cust_name,
cr.salary as salary
from customer_details cr
where (case when '>' = '>' then 'cr.salary > 5000'
when '>' = '<' then 'cr.salary < 5000'
when '>' = '=' then 'cr.salary = 5000'
else null
end);
the expression in the when clause of the case-when statement will come from UI and depending on the choice i need to make the where clause.
thats why for running the query, i have put '>' in that place.
so the original query will look like this(for your reference):
select cr.customer_name || ' - ' ||cr.customer_number as cust_name,
cr.salary as salary
from customer_details cr
where (case when variable = '>' then 'cr.salary > 5000'
when variable = '<' then 'cr.salary < 5000'
when variable = '=' then 'cr.salary = 5000'
else null
end);
so, in actual case,if the user selects '>' then the filter will be "where cr.salary > 5000"
if the user selects '<' then the filter will be "where cr.salary < 5000"
if the user selects '=' then the filter will be "where cr.salary = 5000"
but i am getting the error "ORA 00920:invalid relational operator"
please help..thanks in advance..Hi,
select cr.customer_name || ' - ' ||cr.customer_number as cust_name,
cr.salary as salary
from customer_details cr
where ( v_variable = 'bigger'
and cr.salary > 5000
or ( v_variable = 'less'
and cr.salary < 5000
or ( v_variable = 'eq'
and cr.salary = 5000
)Edited by: user6806750 on 22.12.2011 14:56
For some reason I can't write in sql '<', '>', '=' -
Problem in using SAX parser.
Hai All,
I have got a problem in using SAX parser.
My XML looks like this:
<authorizer>
<first-name>HP</first-name>
<last-name>Services</last-name>
<phone>800-22-1984</phone>
</authorizer>
<destination>
<first-name>John</first-name>
<last-name>Doe</last-name>
<company>John Doe Enterprises, Inc.</company>
<department>Manufacturing</department>
<phone>800-555-1234</phone>
<address>
<street-one>1654 Peachtree Str</street-one>
<street-two>Suite Y</street-two>
<city>Atlanta</city>
<province>GA</province>
<country>US</country>
<postal-code>30326</postal-code>
</address>
</destination>
my part of SAX parser code is:
public void startElement (String name, AttributeList attrs)
throws SAXException
accumulator.setLength(0);
public void characters (char buf [], int offset, int len)
throws SAXException
accumulator.append(buf, offset, len);
public void endElement (String name)
throws SAXException
if (name.equals("first-name") )
firstname=accumulator.toString().trim();
if (name.equals("last-name"))
lastname=accumulator.toString().trim();
My problem is that i have to store the values of first-name and last-name.
but i have that in both
<authorizer> </authorizer> Tag and
<destination> </destination>
I need to retrive authorizer's firstname,lastname and
destination's firstname and lastname.
what i mean is i need to store authorizerFirstName,authorizerLastName
destinationFirstname and destinationLastname.
Pls let me know how to do that.
Thanks in advance.
Pooja.hi pooja,
I think you are using DataHandler for parsing. Its deprecated. try using contentHandler . You can get the value of the element at the beginning. say for example
<firstname>sdfs</firstname>
the startElement will be firstname
the next method that it invokes will be characters method which has the text associated with the element. I am sending a sample code for your problem. try using it .
boolean m_boolinAuth = false;
boolean m_boolinDest = false;
boolean m_bAuthFName = false;
boolean m_bAuthLName = false;
public void startElement(String namespaceURI, String elementName, String qName, Attributes atts)
//does the logic for startElement
if(qName.equals("Authorization"))
m_boolinAuth = true;
m_boolinDest = false;
else if(qName.equals("Destination"))
m_boolinDest = true;
m_boolinAuth = false;
if(qName.equals("firstname"))
m_bFirstName = true;
if(qName.equals("lastname"))
m_bLastName = true;
public void characters(char[] ch, int start, int length)
//does the logic for characters.
String str = new String(ch,start,length);
if(m_bFirstName)
if(m_boolinAuth)
m_strAuthFirstName =str;
else if(m_boolinDest)
m_strDestFirstName = str;
m_bFirstName = false;
if(m_bLastName)
//same as first name case;
} -
Problem in using Unit of Work with executeNonSelectingCall() method
Hi,
I am using external Connection Pooling and Transaction Controller of JBoss in Toplink.
When I am getting the data from DB and do "clientSession.release();", it works fine.
I get the clientSession as follows:
serversession = (Server) SessionManager.getManager().getSession(new XMLSessionConfigLoader(),"Session", Thread.currentThread().getContextClassLoader(), false, true);
serversession.login();
ClientSession clientsession = serversession.acquireClientSession();
I am facing the problems in two cases:
Case 1: But when I get the UOW through "transaction = clientSession.getActiveUnitOfWork();" and insert the data, commit and do "clientSession.release();", I get the following error:
[CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c42091
I removed clientSession.release(); from my finally{} block still I am getting the same error.
Case 2: But when I get the UOW through "transaction = clientSession.acquireUnitOfWork();" and insert the data, commit and do "clientSession.release();", I get the following error:
17:48:55,670 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract java.lang.String com.pearson.pix.business.purchaseorder.interfaces.PurchaseOrderLocal.saveOrderConfirmation(com.pearson.pix.dto.purchaseorder.POHeader) throws com.pearson.pix.exception.AppException, causedBy:
org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=asad/139, BranchQual=, localId=139] status=STATUS_NO_TRANSACTION; - nested throwable: (java.lang.NullPointerException)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:354)
I am not able to understand what to do. Pls. help.
ThanksLocking a row that does not exist can be difficult.
On most database you can lock an entire table through "LOCK TABLE <table>", however this may be extreme. Potentially you could also insert an empty row into the table with the id that you want to lock, then you would have a write lock on the row until you commit the transaction. -
Problem when using weblogic.jspc from an IDE
I am trying to call JSPC from an IDE (as part of an Eclipse Builder). To optimize performance I want to avoid to spwan a new process. So I am trying to call weblogic.jspc's main method directly from the IDE. Everything works fine for simple simple pages.
But when the page refers to a tag library with a tag providing a TagExtraInfo class, weblogic.jspc complains about the class not extending the TagExtraInfo base class although it does:
Errors encountered while compiling 'D:\vrp-localdeploy\applications\wot\WOT' :
Translation of /rentalcar/tiles/i18n/CarCapacityView.jsp failed: (line 17): Error in using tag library uri='/tags/i18n' prefix='i18n': For tag 'bundle', extra info class 'org.apache.taglibs.i18n.BundleTEI' does not extend javax.servlet.jsp.tagext.TagExtraInfo
I could not figure out what exactly causes the problem. Using exactly the same settings workes just fine.
Any suggestions?The full stack trace reads as follows:
<p>
Errors encountered while compiling 'D:\vrp-localdeploy\applications\wot\WOT' :
<p>
Translation of /common/include/i18n/definitions.inc failed: (line 17): Error in using tag library uri='/tags/i18n' prefix='i18n': For tag 'bundle', extra info class 'org.apache.taglibs.i18n.BundleTEI' does not extend javax.servlet.jsp.tagext.TagExtraInfo
<br>
at weblogic.jspc.runJspc(jspc.java:559)
at weblogic.jspc.runBodyInternal(jspc.java:410)
at weblogic.jspc.runBody(jspc.java:319)
at weblogic.utils.compiler.Tool.run(Tool.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:103)
at weblogic.jspc.main(jspc.java:708)
at tui.vrp.tools.presentation.builder.PresentationBuilder.compileJSP(PresentationBuilder.java:1173)
at tui.vrp.tools.presentation.builder.PresentationBuilder.checkResource(PresentationBuilder.java:718)
at tui.vrp.tools.presentation.builder.PresentationBuilder$PresentationDeltaVisitor.visit(PresentationBuilder.java:102)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
at tui.vrp.tools.presentation.builder.PresentationBuilder.incrementalBuild(PresentationBuilder.java:1268)
at tui.vrp.tools.presentation.builder.PresentationBuilder.build(PresentationBuilder.java:677)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:253)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:282)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:139)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
<p>
Unfortunately it doesn't really give any real reason - it is a general piece of code in jspc to report problems.
<p>
But I dug a lot bit deeper into the code and realized that the original problem is a ClassCastException in line 1290 of class StandardTagLib, which reads as follows:
<p>
tagextrainfo = (TagExtraInfo)Beans.instantiate(classloader, s3);
<p>
This looks quite obvious that the class named by s3 simply is no extension of TagExtraInfo, but unfortunately the only class with that name being referenced by the class path does extend this class. I wondered what the problem might be and came up with the following answer:
<p>
The class of the bean instantiated by Beans.instantiate extends a class with the name "javax.servlet.jsp.tagext.TagExtraInfo" which is cast to another class with exactly <b>the same name, but a different class loader</b>. Since neither of the class loaders is parent of the other one, both classes are not considered being the same class although they have the same name. Sounds weird, but exactly this is the problem!
<p>
Where does it come from and why it works fine when the tool is executed in a separate thread or on the console?
<p>
From my understanding the problem is caused in line 395 of the class weblogic.jspc:
<p>
GenericClassLoader genericclassloader = new GenericClassLoader(classpathclassfinder);
<p>
This line of code creates a class loader not knowing a parent class loader by which the class weblogic.jspc was loaded. All classes weblogic.jspc is using or calling will be loader by either the same or a parent class loader - this is important to understand. Since TagExtraInfo is directly referenced by StandardTagLib one instance of the class object (the object of type class) will be generated and linked when the class StandardTagLib is instantiated for the first time by the class loader which loaded weblogic.jspc (or by its parent). This is consequence which can not be avoided.
<p>
But now look at line 1290 of class StandardTagLib: It explicitly requests the class to be loaded by the GenericClassLoader instantiated in line 395 of the class weblogic.jspc. This class loader, off course, is not aware of the same class just being loaded by another class loader since it has no knowledge of it. It simply creates a fresh copy of the class object, which only differs in the reference to the class loader which created this class object.
<p>
Actually, I figured that the following line of code replacing the upper one, would resolve the problem:
<p>
GenericClassLoader genericclassloader = new GenericClassLoader(classpathclassfinder, this.getClass().getClassLoader());
<p>
Doing this, the GenericClassLoader would know its logical parent by reference and would implicitly - thanks to the implementation of java.lang.ClassLoader - try to find the class using its parent first, would find a valid class, and hence use the same instance of the class object instantiated by the parent class loader. The problem would be solved.
<p>
It works fine in the console or under a running application server, because they will always have the weblogic jar in their system class path. ClassLoaders not having a parent are implied to have the system class loader as their parent - the piece of code does work in this case.
<p>
Under Eclipse this is no option, off course. We would restrain us to exactly this version of the APIs used by the weblogic version in the system class path.
<p>
I was trying to patch this myself by extending weblogic.jspc by my own class to pass on a proper class loader knowing its parent, and I was sort of successful: The problem disappeared. But I can't gain exactly what I am looking for, because the method runJspc with four parameters (around line 447) of weblogic.jspc is private to the class and its public brother always passes true to this method as the fourth parameter - causing jspc to recompile all JSPs instead of just the requested ones.
<p>
Everything refers to WL81SP3.
<p>
That's were I got stuck currently. I have read some postings about this problem in the internet - some dating far back into the history. So, I have the impression that there have been some folks around with the same problem. I think the patch I suggested does not any harm and I could simply use jspc in my builder without any problems.
<p>
Regards,
<p>
Elmar Schwarz -
I am stuck at Use Case Diagrams generator, which takes Problem Statement or Requirement in english and generated Use Case Diagrams from it.
I am successful at finding and seperating Parts of Speech from English sentances using PoS Taggers.
how can i model them?
are there any tips/open source programs available.learn English so the software understands you.
-
Using case statement in merge when matched
Hi,
I want to use case statement in the when matched clause of merge statement to ensure that I update only those fields that are undated.
create table TEST1
NAME1 VARCHAR2(25),
NAME2 VARCHAR2(25),
ID NUMBER not null
create table TEST2
ID NUMBER not null,
ID2 NUMBER not null,
NAME1 VARCHAR2(25),
NAME2 VARCHAR2(25)
merge into test1 t1
using
test2 t2
ON (t1.id = t2.id)
when matched
then
case
when t1.name1 != t2.name1
then
update set t1.name1 != t2.name1
when t1.name2 != t2.name2
then
update set t1.name2 != t2.name2
else
null;
end
it does not work and raises invalid sql command. Any idea how can I do that?
Thanks.
Sajid
Edited by: 808255 on Nov 12, 2010 4:22 AMHi
In that case you would have to use multiple statements and you may as well just use UPDATE instead of MERGE. Also, are you sure that you aren't trying to to fix a problem that doesn't actually exist.
Think about where the execution time is going to come from...
I would be tempted to do 1 UPDATE like this...
UPDATE test1 t1
SET (t1.name1,
t1.name2) = (SELECT t2.name1,
t2.name2
FROM test2 t2
WHERE t1.id = t2.id
AND (t1.name1 != t2.name1
OR t1.name2 != t2.name2))If you get specific performance issue with this, then post an explain plan and trace and I'll have a look.
I don't this the cost of the update is going to be as great as you think.
Cheers
Ben -
Problem in using BLOB and callablestatement
Hi
I am doing an insert into the database , of which one of the clomn is
BLOB
when i do it using prepared statement , it does it fine
but if i do it using the callable statment (Stored procedure)its not
doing it .....
and gives an error like below
does anybod know what the problem is
java.sql.SQLException: ORA-06550: line 1, column 9:
PLS-00306: wrong number or types of arguments in call to 'IN
SERT_EVENT_LOG'
ORA-06550: line 1, column 9:
PL/SQL: Statement ignored
at weblogic.db.oci.OciCursor.getCDAException(OciCurs
or.java:228)
at weblogic.jdbcbase.oci.Statement.executeUpdate(Sta
tement.java:869)
at weblogic.jdbc20.pool.PreparedStatement.executeUpd
ate(PreparedStatement.java:47)
at weblogic.jdbc20.rmi.internal.PreparedStatementImp
l.executeUpdate(PreparedStatementImpl.java:54)
at weblogic.jdbc20.rmi.SerialPreparedStatement.execu
teUpdate(SerialPreparedStatement.java:55)
at com.expertcommerce.core.log.DatabaseLogService.in
ternalLog(DatabaseLogService.java:73)
at com.expertcommerce.core.log.BaseLogService.log(Ba
seLogService.java:33)
at com.expertcommerce.core.log.biz.ServerLogAdapter.
log(ServerLogAdapter.java:113)
at com.expertcommerce.core.log.biz.ServerLogAdapter.
logError(ServerLogAdapter.java:135)
at com.expertcommerce.core.users.biz.UserEntityBean.
ejbFindByPrimaryKey(UserEntityBean.java:409)
at com.expertcommerce.core.users.biz.UserEntityBeanH
omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:81)
at com.expertcommerce.core.users.biz.UserEntityBeanH
omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:49)
at weblogic.ejb.internal.EJBHomeImpl.remove(EJBHomeI
mpl.java:297)
at com.expertcommerce.core.users.biz.UserEntityBeanH
omeImpl_ServiceStub.remove(UserEntityBeanHomeImpl_ServiceStu
b.java:378)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBean.removeUser(UserManagerSessionBean.java:172)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBean.handle(UserManagerSessionBean.java:47)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBeanEOImpl.handle(UserManagerSessionBeanEOImpl.java:146)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBeanEOImpl_ServiceStub.handle(UserManagerSessionBeanEOImp
l_ServiceStub.java:255)
at com.expertcommerce.core.event.CoreEventDispatcher
.dispatch(CoreEventDispatcher.java:17)
at com.expertcommerce.core.event.biz.CoreEventDispat
cherSessionBean.dispatch(CoreEventDispatcherSessionBean.java
:24)
at com.expertcommerce.core.event.biz.CoreEventDispat
cherSessionBeanEOImpl.dispatch(CoreEventDispatcherSessionBea
nEOImpl.java:105)
at com.expertcommerce.core.event.biz.CoreEventDispat
cherSessionBeanEOImpl_WLSkel.invoke(CoreEventDispatcherSessi
onBeanEOImpl_WLSkel.java:159)
at weblogic.rmi.extensions.BasicServerObjectAdapter.
invoke(BasicServerObjectAdapter.java:338)
at weblogic.rmi.extensions.BasicRequestHandler.handl
eRequest(BasicRequestHandler.java:69)
at weblogic.rmi.internal.BasicExecuteRequest.execute
(BasicExecuteRequest.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.j
ava:120)
com.expertcommerce.core.log.LogServiceException: ORA-06550:
line 1, column 9:
PLS-00306: wrong number or types of arguments in call to 'IN
SERT_EVENT_LOG'
ORA-06550: line 1, column 9:
PL/SQL: Statement ignored
at com.expertcommerce.core.log.DatabaseLogService.in
ternalLog(DatabaseLogService.java:111)
at com.expertcommerce.core.log.BaseLogService.log(Ba
seLogService.java:33)
at com.expertcommerce.core.log.biz.ServerLogAdapter.
log(ServerLogAdapter.java:113)
at com.expertcommerce.core.log.biz.ServerLogAdapter.
logError(ServerLogAdapter.java:135)
at com.expertcommerce.core.users.biz.UserEntityBean.
ejbFindByPrimaryKey(UserEntityBean.java:409)
at com.expertcommerce.core.users.biz.UserEntityBeanH
omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:81)
at com.expertcommerce.core.users.biz.UserEntityBeanH
omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:49)
at weblogic.ejb.internal.EJBHomeImpl.remove(EJBHomeI
mpl.java:297)
at com.expertcommerce.core.users.biz.UserEntityBeanH
omeImpl_ServiceStub.remove(UserEntityBeanHomeImpl_ServiceStu
b.java:378)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBean.removeUser(UserManagerSessionBean.java:172)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBean.handle(UserManagerSessionBean.java:47)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBeanEOImpl.handle(UserManagerSessionBeanEOImpl.java:146)
at com.expertcommerce.core.users.biz.UserManagerSess
ionBeanEOImpl_ServiceStub.handle(UserManagerSessionBeanEOImp
l_ServiceStub.java:255)
at com.expertcommerce.core.event.CoreEventDispatcher
.dispatch(CoreEventDispatcher.java:17)
at com.expertcommerce.core.event.biz.CoreEventDispat
cherSessionBean.dispatch(CoreEventDispatcherSessionBean.java
:24)
at com.expertcommerce.core.event.biz.CoreEventDispat
cherSessionBeanEOImpl.dispatch(CoreEventDispatcherSessionBea
nEOImpl.java:105)
at com.expertcommerce.core.event.biz.CoreEventDispat
cherSessionBeanEOImpl_WLSkel.invoke(CoreEventDispatcherSessi
onBeanEOImpl_WLSkel.java:159)
at weblogic.rmi.extensions.BasicServerObjectAdapter.
invoke(BasicServerObjectAdapter.java:338)
at weblogic.rmi.extensions.BasicRequestHandler.handl
eRequest(BasicRequestHandler.java:69)
at weblogic.rmi.internal.BasicExecuteRequest.execute
(BasicExecuteRequest.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.j
ava:120)
with parameter
exitsfalse
Retuening result to CoreEventcom.expertcommerce.core.users.e
vents.RemoveUserEvent@6dcc33
Stored Procedure .....
CREATE or replace procedure insert_Event_Log
pEvent_ID in out number,
pEvent_Severity in number,
pEvent_Data in blob,
pEvent_Action in number,
pEvent_Time in date,
pEvent_Source in char,
pEvent_Status in char,
pEvent_User in char,
pEvent_Subject in char,
pEvent_Subject_ID in char
AS
tEvent_ID number;
BEGIN
/* Get the sequence key */
if (pEvent_ID is null ) then
select event_id_seq.nextval into tEvent_ID from dual;
insert into Event_ID (pkey, justabit) values ( tEvent_ID, 1);
end if;
/* Insert the values in the table */
INSERT INTO Event_Log
Event_ID,
Event_Severity,
Event_Data,
Event_Action,
Event_Time,
Event_Source,
Event_Status,
Event_User,
Event_Subject,
Event_Subject_ID
VALUES (
tEvent_ID,
pEvent_Severity,
pEvent_Data,
pEvent_Action,
pEvent_Time,
pEvent_Source,
pEvent_Status,
pEvent_User,
pEvent_Subject,
pEvent_Subject_ID
pEvent_ID := tEvent_ID;
END;
My TEst Program
import java.sql.*;
import java.util.Properties;
import oracle.jdbc.driver.*;
import oracle.sql.*;
class rfxtest{
public static void main(String[] args){
rfxtest test = new rfxtest();
CallableStatement m_stmt = null;
PreparedStatement pStmt = null;
String rfxdata = "this is the test data for the event-blob-test";
try{
Connection con = test.getConnection();
String temp = "call insert_event_log ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
m_stmt = con.prepareCall(temp);
m_stmt.setNull(1, java.sql.Types.INTEGER);
m_stmt.setInt(2, 123);
m_stmt.setBytes(3, (byte[])rfxdata.getBytes());
m_stmt.setInt(4, 123);
m_stmt.setTimestamp(5, new java.sql.Timestamp(System.currentTimeMillis()));
m_stmt.setString(6, "xxxxxxxxxx");
m_stmt.setString(7, "xxxxxxxxxx");
m_stmt.setString(8, "xxxxxxxxxx");
m_stmt.setString(9, "xxxxxxxxxx");
m_stmt.setString(10, "xxxxxxxxxx");
m_stmt.executeUpdate();
String selectStmt = " select event_data from event_log where event_id = 12345" ;
pStmt = con.prepareStatement(selectStmt);
ResultSet rs = pStmt.executeQuery();
if(!rs.next()){
System.out.println("error");
} else {
Blob b = rs.getBlob(1);
byte[] blob = (byte[])b.getBytes(1,(int)b.length());
String s = new String(blob);
System.out.println("The blob content is : "+s);
}catch(Exception e){
e.printStackTrace();
public Connection getConnection(){
try{
Properties props = new Properties();
props.put("user", "nexgen");
props.put("password", "nexgen");
Driver myDriver = (Driver) new oracle.jdbc.driver.OracleDriver();
Connection conn =
myDriver.connect("jdbc:oracle:thin:@192.168.254.6:1521:ecw",props);
return conn;
catch(Exception e){
e.printStackTrace();
return null;
appreciate response
venki
nullNavid,
JHeadstart checks whether the attribute definition is queryable before adding it to the list of advanced search attributes. A transient VO attribute can still be set to queryable, for a transient EO attribute this is not possible. We will remove this check on queryability in the upcoming patch release, since you have a valid use case. For now, you can subclass JhsSearchBean and override method createArgumentListForAdvancedSearch and comment out the check for "def.isQueryable()".
Steven Davelaar,
JHeadstart Team.
Maybe you are looking for
-
How to buy a CS3 Design Standard License today ?
Company's Marketing Communication Group used CS3. I need to work on their files and I need to buy a license of CS3 Design Standard. On the Adobe site, I can't. What is the solution for me ?
-
Bug: Change Case as you Type
For some reason the option "Change case as you type" (Preferences > Code Editor > Completion Insight) keeps changing. It will remain the same for a while but changes at some random point. Each time I restart SQL Developer it seems to go back to "+Low
-
Why does my iPad not show up in manage storage?
Why does my iPad not show up in manage storage?
-
PNG thumbnails don't show up in thunar
My first post as an Arch user I just installed thunar and it works great. However I have one problem - thumbnails for PNG and SVG images do not show up. JPG thumbnails work fine, and the icon theme I have chosen for folders, etc. also shows up. Onl
-
I have a new iPad and am trying to open my Uni website. I have allowed pop ups but it just opens a new blank page. I'm using a sim not wifi, would this have anything to do with it?