How to Call one EJB from another
Hi all
I am trying to call one EJB in one system from another EJB residing on diferent system...
Both are Stateless session beans ...
I can't use No-args Intialcontext() as i need to specify the Ip address of other system to be looked up.....
So i am using properties Dorg.omg.CORBA.ORBInitlalHost....
But its not looking up..Its telling not bound...But i called it from standalone client remotely...
Am i wrong..?
I hope I am in right path....
I hope ill get reply as fast as possible...
Gopal V
Hi ken Thanks for replying....
Ya i packed it as a jar (using Export tool in Eclipse3.2)....
I am using SUN AS 9.....
I packed bean1 and bean2 as two different jars in the same domain...
Here is my code...
Bean1:
@Stateless(mappedName="ejb/Second")
public class SecondIMPL implements SecondRemote {
public FirstRemote obj;
public String connect() {
try{
InitialContext ctx= new InitialContext();
FirstRemote obj =(FirstRemote)ctx.lookup("ejb/First");
System.out.println("Client :"+obj.bMethod());
}catch(Exception e){
e.printStackTrace();
return "Check server Log";
}Bean2 :
@Stateless(mappedName="ejb/First")
public class FirstIMPL implements FirstRemote {
public String bMethod() {
return "From First Bean";
Client:
public static void main(String[] args) {
try{
InitialContext ctx= new InitialContext();
SecondRemote obj =(SecondRemote)ctx.lookup("ejb/Second");
System.out.println("Client :"+obj.connect());
}catch(Exception e){
e.printStackTrace();
Here is my Stack Trace...
[#|2007-05-24T18:35:17.214+0530|WARNING|sun-appserver-pe9.0|javax.enterprise.system.stream.err|_ThreadID=18;_ThreadName=p: thread-pool-1; w: 19;_RequestID=bb4848e7-829a-421d-a560-93659898eb02;|
javax.naming.NamingException: ejb ref resolution error for remote business interfacecom.SecondRemote[Root exception is java.lang.ClassNotFoundException: com.SecondRemote]
at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:350)
at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:61)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:314)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.FirstBean.rediff(FirstBean.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
at $Proxy36.rediff(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
Caused by: java.lang.ClassNotFoundException: com.Second
at com.sun.enterprise.loader.EJBClassLoader.findClassData(EJBClassLoader.java:701)
at com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:614)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.sun.ejb.EJBUtils.getBusinessIntfClassLoader(EJBUtils.java:568)
at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:320)
... 31 more
|#]
Similar Messages
-
How to call one EJB in another EJB?
How to call one EJB in another EJB? Please explain with some example code.
To refer a Ejb from another Ejb include <ejb-ref> element in ejb-jar.xml
<session>
<ejb-name>EjbA</ejb-name>
<ejb-ref>
<ejb-ref-name>EjbB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.ejb.EjbBHome</home>
<remote>com.ejb.EjbB</remote>
</ejb-ref>
</session>
Include a <reference-descriptor> in weblogic-ejb-jar.xml
<weblogic-enterprise-bean>
<ejb-name>EjbA</ejb-name>
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>EjbB</ejb-ref-name>
<jndi-name>com.ejb.EjbBHome</jndi-name>
</ejb-reference-description>
</reference-descriptor>
</weblogic-enterprise-bean>
In EjbA Bean class refer to EjbB with
a remote reference to EjbB.
InitialContext initialContext=new InitialContext();
EjbBHome EjbBHome=(EjbBHome)
initialContext.lookup("com.ejb.EjbBHome");
EjbB ejbB=EjbBHome.findByPrimaryKey(primarykey); -
How to call one .SWF from another?
How do I call one .SWF from another. I built a very beefy
base .SWF, and want to add music overlay, and an intro slide show
to the exsting Flash animation, but put it in a second .FLA/.SWF
file. How do I call one from the other?
This will be embedded in an HTML file but I assume this is
superfluous to my question.
F.Z.I think you should open that Another SWF (FLA),
and add some actionscript..
For example, you could create a movie clip, and write
actionscript in the
first keyframe:
loadMovie("
http://www.somewebpage.com/movie.swf",
this);
"FredZimmerman" <[email protected]> wrote in
message
news:ftnjas$mj5$[email protected]..
> How do I call one .SWF from another. I built a very
beefy base .SWF, and
> want
> to add music overlay, and an intro slide show to the
exsting Flash
> animation,
> but put it in a second .FLA/.SWF file. How do I call one
from the other?
>
> This will be embedded in an HTML file but I assume this
is superfluous to
> my
> question.
>
> F.Z.
> -
How to call one program from another program
Hai,
How to call one program through another program.
Example.
I have two programs 1.ZPROG1 2. ZPROG2.
When i execute ZPROG1 at that time it should call ZPROG2.Hi ,
u can use submit statement to call a program .
DATA: text TYPE c LENGTH 10,
rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab,
range_tab LIKE RANGE OF text,
range_line LIKE LINE OF range_tab.
rspar_line-selname = 'SELCRIT1'.
rspar_line-kind = 'S'.
rspar_line-sign = 'I'.
rspar_line-option = 'EQ'.
rspar_line-low = 'ABAP'.
APPEND rspar_line TO rspar_tab.
range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'H'.
APPEND range_line TO range_tab.
range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'K'.
APPEND range_line TO range_tab.
SUBMIT report1 USING SELECTION-SCREEN '1100'
WITH SELECTION-TABLE rspar_tab
WITH selcrit2 BETWEEN 'H' AND 'K'
WITH selcrit2 IN range_tab
AND RETURN.
regards,
Santosh thorat -
How to call one procedure from another procedure
Hi all,
Could anyone give me clue how to call a procedure contains out parameters
from another procedure.
I had following procedures.
1)
create or replace procedure INS_PUR_ORDER
p_poamt in number,
p_podate in date,
p_poid out number
is
begin
select pkseq.nextval into p_poid from dual;
insert into pur_order(poamt,podate,poid)
values (p_poamt,p_podate,p_poid);
end;
2)
create or replace procedure INS_PUR_ORDER_DETAIL
p_pounits in number,
p_poddate in date,
p_poid in number)
is
begin
Insert into pur_order_detail(podid,pounits,poddate,poid)
values(pdseq.nextval,p_pounits,p_poddate,p_poid);
end;
I need to write a 3rd procedure which calls above two procedures.
like
call first procedure ,basing on the return value
i.e if p_poid != 0 then
we need to call second procedure
in the loop.
thanks in advance.
rampa.Not sure what are you doing, you can not assign cursor to another cursor, may be you are looking for this?
SQL> create or replace procedure proc1 ( result out sys_refcursor)
2 is
3
4 begin
5 open result for
6 select 'HELLO WORLD' from dual ;
7 end proc1 ;
8 /
Procedure created.
Elapsed: 00:00:00.01
SQL> create or replace procedure proc2
2 is
3 l_cursor sys_refcursor ;
4 begin
5 l_cursor := proc1 ;
6
7
8 open l_cursor;
9 fetch l_cursor into l_text;
10 dbms_output.put_line(l_text);
11 close l_cursor;
12
13
14 end proc2 ;
15 /
Warning: Procedure created with compilation errors.
Elapsed: 00:00:00.01
SQL> show error;
Errors for PROCEDURE PROC2:
LINE/COL ERROR
5/4 PL/SQL: Statement ignored
5/16 PLS-00306: wrong number or types of arguments
in call to 'PROC1'
6/4 PLS-00201: identifier 'L_TEXT' must be
declared
6/4 PL/SQL: Statement ignored
8/4 PLS-00382: expression is of wrong type
8/4 PL/SQL: SQL Statement ignored
9/4 PL/SQL: SQL Statement ignored
9/24 PLS-00201: identifier 'L_TEXT' must be
declared
10/4 PL/SQL: Statement ignored
10/25 PLS-00201: identifier 'L_TEXT' must be
declared
---- this is the correct waySQL>ed
1 create or replace procedure proc2
2 is
3 l_cursor sys_refcursor ;
4 l_text varchar2(100);
5 begin
---- procedure call
6 proc1(l_cursor);
7 -- open l_cursor;
8 fetch l_cursor into l_text;
9 dbms_output.put_line(l_text);
10 close l_cursor;
11* end proc2 ;
SQL> /
Procedure created.
Elapsed: 00:00:00.01
SQL> set serveroutput on
SQL> execute proc2;
HELLO WORLD
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> -
How to call an EJB from another EJB
Hi
I have a problem here. I need to execute a second EJB which has to get the input from the first EJB as data for execution. So when I call the first EJB, the first EJB should give the data to the second EJB and execute it and provide the result.
Cheers,
Rajok.. Here it goes.. I am writing a sample code..
public class EJB1LogBean implements SessionBean {
// test is a method of stateless session beam
public void test ( TestVal val )
throws RemoteException{
try {
EJB2LogHome ejb2Home= (EJB2LogHome)getHome("java:comp/env/ejb/EJB2LogHome",1);
EJB2Log ejb2Log = ejb2LogHome.create ( val );
} catch ( CreateException e ) {
System.out.println("Create Exception occurred ");
e.printStackTrace();
} catch ( RemoteException e ) {
System.out.println( "RemoteException Occured");
e.printStackTrace();
throw new RemoteException () ;
} catch(Exception ee) {
ee.printStackTrace();
private EJBHome getHome(String jndiName,int type) {
try {
Context context = new InitialContext();
Object ref = context.lookup( jndiName );
switch(type)
case 1:
EJB2LogHome ejb2LogHome = ( EJB2LogHome )
PortableRemoteObject.narrow( ref, EJB2LogHome.class );
return ejb2LogHome;
} catch ( Exception e ) {
e.printStackTrace();
return null;
}//EJB1LogBean ends
Here as you can see, EJB1LogBean(session bean) is calling a second EJB, EJB2LogBean (entity bean). TestVal is a sample value object passed. It is plain java class and can vary from app to app and it has got nothing to do with ejbs.
"java:comp/env/ejb" is a J2EE standard and while getting a home interface, you have to append the home interface class name to "java:comp/env/ejb". Here I am passing "java:comp/env/ejb/EJB2LogHome" and "1" to getHome method, whose job is to get a reference to a home interface. getHome method is a local method. "1" is passed just to give a flexibility to getHome method as you can have more ejbs to invoked. In that case, you can go on adding different case statements for 2, 3 etc.
The only thing you have to keep in mind is that your deployment descriptor for EJB1LogBean will contain the entires for both the beans i.e. for EJB1LogBean and EJB2LogBean. This is because EJB2LogBean is wrapped by EJB1LogBean.
Hope this helps.
Please let me know if you need anything more.
- Amit -
CallerPrincipal when calling one sessionbean from another
Hi all,
I have a little problem when calling one sessionbean from another sessionbean. The problem is, that in the method, which is called, is used SessionContext's getCallerPrincipal().getName(). This works great from client, but from other sessionbeans getCallerPrincipal() retuns an "ANONYMOUS" principal. How can I set the correct principal (the principal from the first sessionbean)?
Thank you
My env: Glassfish 2.1.1, Netbeans 6.8, Eclipselink 2.0.0, Java 1.6.0.18
My code:
@Stateless
public class ABean implements ASessionRemote{
@Resource
SessionContext ctx;
@Override
public void aMethod(){
String name = ctx.getCallerPrincipal().getName(); // the name is ANONYMOUS, when the call is done from other sessionbean
@Stateless
public class BBean implements BSessionRemote{
@Resource
SessionContext ctx;
@EJB
private ASessionRemote aSessionBean;
@Override
public void bMethod(){
aSessionBean.aMethod();
}"This works great from client"
What do you mean by this, i.e what sort of client are you using (stand alone app, servlet) ?
what shows up if you printout the caller principal in the calling bean ?
are the two ejbs in the same ear ?
what security meta-information are you using in ejb-jar.xml and sun-ejb-jar.xml, if any ? -
How to call a servlet from another servlet
hi everybody,
i have a problem, i have to call one servlet from another one.
Everything works on my pc, but when i install the application on the customer's server i got an error about an Uknown URL followed by the name of the machine.
Wjat i do is the folloqing :
String urlString = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+servletName;
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
the variable servletName is the name of the servlet i have to call.
Is there another way to call the servlet ?
All the servlet are installed in the same server.
Any suggestion ?
Cheers.
StefanoSweep is correct about requestDispatcher being another approach for inter-servlet delegation; the only issue that i recall with this approach is that it defaults the method of the destination servlet to the one it was called from...for example, calling servlet2 from within servlet1.post() resulted in the dispatcher attempting to utilize servlet2.post() - i believe that i searched for a parameterize solution to no avail :( (ended up handling the request by placing a "fake" doPost() in servlet2 that simply called servlet2.doGet())
however, if your application is functioning correctly on your pc/webserver then the problem may be external to servlet communication (e.g. client webserver's ports not configured or blocked, missing runtime classes, etc.)
my suggestion would be to set aside the programmatic concerns for the moment - what is the response if you open a browser on a client's machine and access the URL in question (i.e. http://clientserver:port/stefanoServlet)? If it will not respond to access in this manner then it certainly won't when your application calls for it.
It's possible that there is a coding error but, given the info supplied, i'd start examining the environment, first. Let us know if you have any luck with the test i recommended or not (please provide abundant detail). Or, if you've found the solution then you may want to post back with a quick blub so the next person knows how to escape the trap.
D -
How to call a BSP from another BSP?
Hi All,
I've created a BSP for hiring new employees. I have a situation whereby when the user presses a button a pop window will be displayed listing all the positions in the company. The user selects the correct position, which then populates an input box on the originating page and the pop up window closes.
This pop up window is a page in another bsp which goes off and gets the positions and stores the selection in a cookie.
Now my problem is how do i call this 'get postions' bsp from my originating bsp?
I've tried using the <%@ include file="/sap/bc/bsp/sap/z_hr_org_model"%> but i get the error only page fragments can be included.
So how do i call one bsp from another??
Any help would be much appreciated,
Kind Regards,
Liz.Look at the below [link|http://****************/Tutorials/BSP/F4Help/Tutorial.htm]
The only difference in your case is, you need to call the popup from different BSP Application.
To do that, just add the full path when you call the document.open..
For example,
document.open("/sap/bc/bsp/sap/z_hr_org_model/main.do", ............)
Raja -
How to refer one view from another view?
Hi,
I have 2 views in my Adobe Flash Builder mobile app. I need to refer the first view in my second view.
How to refer one view from another view? Or how to create a reference to a view wherever needed?I don't need any data from my first view. In a certain flow, I need to make my first view to be invisible.
for eg., My First view is in portrait mode. I change the device to Landscape. In the landscape mode, I want to show a completely different view (second view).
In this case, what happens is, I see my first view in Landscape mode for a second. Then the second view appears. When I change to Landscape mode, only the second view should be seen. I need to make my first view to be completely invisible in the OnOrientationChanging event of
StageOrientationEvent
As stage object and StageOrientationEvent works at application level, I need to know how to refer my first view object in the application level.
private function onOrientationChanging(soe:StageOrientationEvent):void
MyFirstView.Visible = False; ====> don't know how to refer MyFirstView here
Is my question clear now? -
How to call one JSFF into another JSFF
Hi,
I am very new to ADf. Could you please tell me how to call one JSFF inside another JSFF. We have a common pop-up written in one JSFF. Is there any best approach to get this pop-up into other JSFF.
Thanks in Advance.
Regards
NarasimhaIf you want to resue the jsff code, make use of bounded task flow with page fragment and then use it as a region.
For more details you can refer: http://docs.oracle.com/cd/E21764_01/web.1111/b31974/taskflows_regions.htm
One more:
http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_57/jdtut_11r2_57.html -
HOW TO CALL A FORM FROM ANOTHER FORM
HOW TO CALL A FORM FROM ANOTHER FORM [local machine]
Balraj wrote:
HOW TO CALL A FORM FROM ANOTHER FORM [local machine]The way you asked question is this bit of request or order?
Secondly, you used capital latters which are being treated as Shouting Language. So, always try to switch off the Capslock of your keyboard.
Thirdly, you are very lazy to serach on forum or google for your problem instead of waiting someone to anwer your question.
Your should seriously have a look at FAQ.
http://wikis.sun.com/display/Forums/Forums+FAQ
Also here.
http://www.catb.org/~esr/faqs/smart-questions.html
Please read documentation for the initial questions.
-Ammad -
How to call a process from another project
Hi;
How to calling a process from another process in another project? Which activity that i need or web service, direct binding? I use 11gHi Tulasi ;
I have wsdl of the process i need to call. Also wsdl address on the server. But CALL activity can't use to service call. CALL activity can use only to reusable process call.
I think, this operation must make on composite.xml. But I have a same problem with this method and it don't work.
I create a base process that looking at below. It's include a direct binding. Is it include a direct binding?
[Base Process|http://d1201.hizliresim.com/t/s/21wqu.png]
Then i create a process that call to base process:
[Caller Process|http://d1201.hizliresim.com/t/s/21wqx.png]
I paste to base process' wsdl address on the server. Then i select port type (BaseProcessPortType) and a warning has occured that you see the picture above. Base Process contain Oracle SOA Composite Type. What's the wrong? It happened for Callback Port Type.
And second question is what's the Address? (under Reference Binding Setails option).
I think, i create the this direct binding correctly, i call to base process into my caller process via service activities. -
Calling one script from another
InDesign has a nice mechanism for calling one script from another, so code can be made modular. What about FrameMaker ExtendScript? What methods are people using to call one script from another? Thanks for any suggestions.
Rick QuatroHi Trevor,
Note that ExtendScript is Javascript plus FM objects and methods, so you need to stick to Javascript syntax rules. The right way to include another script source is as follows:
#include "scriptname.jsx";
If this works when running the main script from the ESTK, you know it finds the included script. When you then Export the script to Binary (from the File menu of the ESTK), the binary will include the embedded script as well. After this you have a jsxbin file, which you can drop into one of the two available startup folders to make it fire automatically when FM starts. Or you can move it anywhere else and run it via the File > Script > Run command. The main idea here is that when compiling a script into binary format, all include references are resolved and the script contains the complete code. If you run the jsx, the script is interpreted and requires a correct relative reference to any included script.
I hope this clarifies things a little
Ciao
Jang -
How to update one table from another
I am creating scripts in Oracle 10g. I have a table that has data corruption on three date fields.
I created a table with the following sql of all the affected rows:
CREATE TABLE LSU_INTER_FIX_DATE AS
select request_id,received_date,planned_start_date, actual_start_date
from lsu_inter2_requests_t
where received_date < to_date('01-JAN-1900')
OR planned_start_date < to_date('01-JAN-1900')
OR actual_start_date < to_date('01-JAN-1900')
I then repaired all of the rows with three data fixes
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET planned_start_date = TO_CHAR(planned_start_date,'YY-MON') ||'-'||(TO_CHAR(planned_start_date,'RRRR') + 2000)
where planned_start_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET actual_start_date = TO_CHAR(actual_start_date,'YY-MON') ||'-'||(TO_CHAR(actual_start_date,'RRRR') + 2000)
where actual_start_date < to_date('01-JAN-1900')
I now want to update the original base table with the corrected data so I wrote the following SQL UPDATE command:
UPDATE lsu_inter2_requests_t aaa
SET aaa.received_date = bbb.received_date
FROM LSU_INTER_FIX_DATE bbb WHERE aaa.request_id = bbb.request_id
When I run this sql Oracle returns the error “ORA-00933 SQL command not properly ended.” How do I update multiple rows in one table from another table that share the same primary key?Comet wrote:
I am creating scripts in Oracle 10g. I have a table that has data corruption on three date fields.
I created a table with the following sql of all the affected rows:
CREATE TABLE LSU_INTER_FIX_DATE AS
select request_id,received_date,planned_start_date, actual_start_date
from lsu_inter2_requests_t
where received_date < to_date('01-JAN-1900')
OR planned_start_date < to_date('01-JAN-1900')
OR actual_start_date < to_date('01-JAN-1900')
I then repaired all of the rows with three data fixes
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET planned_start_date = TO_CHAR(planned_start_date,'YY-MON') ||'-'||(TO_CHAR(planned_start_date,'RRRR') + 2000)
where planned_start_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET actual_start_date = TO_CHAR(actual_start_date,'YY-MON') ||'-'||(TO_CHAR(actual_start_date,'RRRR') + 2000)
where actual_start_date < to_date('01-JAN-1900')
I now want to update the original base table with the corrected data so I wrote the following SQL UPDATE command:
UPDATE lsu_inter2_requests_t aaa
SET aaa.received_date = bbb.received_date
FROM LSU_INTER_FIX_DATE bbb WHERE aaa.request_id = bbb.request_id
When I run this sql Oracle returns the error “ORA-00933 SQL command not properly ended.” How do I update multiple rows in one table from another table that share the same primary key?I am not convinced you have what you think you have
>
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
When you want to produce a DATE datatype when starting with a string,
you must use TO_DATE() on the SET line!
(TO_CHAR(received_date,'RRRR') + 2000)since when do you do add characters (from TO_CHAR) with a constant number (2000)?
You should NEVER EVER rely on implicit datatype conversion
Edited by: sb92075 on Jul 27, 2011 7:09 PM
Maybe you are looking for
-
Fcx-creating multicam clip with two different frame rate
I have created a multicam clip with 2 clips, one shot with iphone 3gs, 15 fps, and the otherone with a dslr i remember that with fc7 the main task to accomplish this was to shot with same setting but now it seems to work althought they are not same.
-
6th generation Ipod nano not recognised in itunes
When I plug my ipod into my laptop, it is recognised in my computer but not in itunes or as a device when trying to safely remove it. I tried plugging my 4th generation ipod nano into my laptop but again the same thing happens. I tried plugging it in
-
Coding in webdynpro for abap - reference documents
Hi, Kindly let me know where can I get the reference documents for coding in web dynpro for ABAP ? im specifically looking for continuation of these four documents - [link|http://www.octavia.de/fileadmin/octavia_files/content_bilder/Hauptnavigation/S
-
Is it possible to add Attribute(column) to entity via Excel addin?
I can create an entity via the excel addin and update data in it but i cannot add additional columns (attributes) to it via the excel addin once its created. am i missing something or is it just not possible?
-
Hi All, We have created a manual planned order for one buy item in ASCP workbench for some qty and released it. But, we are not able to get its requisition created in source. When we check the PO_Interface _Errors table, we found that it is errored o