Mass SQL executing from standalone app to sever  - Suggestion only.

Which way can be the best way to execute the SQL to server in mass form.
I 'm trying to make a program which executes the mass SQL to server from the local SQL server.I even need to show the progress of excuted SQL in percentage form (multi-threading via SwingWorker) and futher more it must be recoverable when there is interrupt / crash during SQL executing process.
According to my idea I'm suceeded to execute the mass SQL from local SQL via these steps (Algorithm).
1.Query for the SQL which are not being updated in server e.g "SELECT 'SQL' FROM 'PENDING' WHERE UPLOADED=0"
2.Getting SQL one by one via Loop.
3.Creating TEMP FILE in client and write "1"
4.Execute the SQL to Server
5.Change the value of '1' to '2' in TEMP FILE
6.Update the value of UPLOADED=0 to 1 in PENDING Table
7.Finally delete the TEMP FILE from client computer .
8.Goes to next SQL until the Loop ends
I'm using TEMP_FILE so that i can know whether the SQL executing process was completed sucessfully or not. And to correct the interrupted/crashed SQL process i've used 1,2 in TEMP FILE as the step of executing process.
But somehow I think there is good way to handle this problem.So I posted here to get better solution for my problem . I 've even thought about SQL Batch Processing but I don't think it's good idea for recovering SQL from crashes and interrupt

Hello DynamicBasics
I've followed the tutorial but not working for me!
public boolean uploadData(){
        boolean isUploaded = true;
        Statement s = null;
        ResultSet rs = null;     
        connectServer();
        try{
          //disabling autocommit = false
                getServerConnection().setAutoCommit(false);
                String sql = ("INSERT INTO transaction VALUES(?,?)");               
                PreparedStatement stmt = getServerConnection().prepareStatement(sql);
                stmt.setString(1,"SALES");
                stmt.setInt(2,0);
                stmt.executeUpdate();   //does it update as seperately
                PreparedStatement stmt2 = getServerConnection().prepareStatement(sql);
                stmt2.setString(1, "PURCHASE");
                stmt2.setInt(2, 1);
                stmt2.executeUpdate();  //does it update as seperately    
          //i've not done commit() but even it's being executed                    
        catch(SQLException se){
            se.printStackTrace();
         isUploaded = false;
        return isUploaded;
}As I read using Transaction is meant to execute many sql as a single unit but it's being executed seperately even i've not done commit().
I think executeUpdate() already executes the sql . Or do i need to used batch for it ??
Please help

Similar Messages

  • I bought an iPad and an iTunes card, I want to buy an application from the Apps store but it only gives me the option of credit card.  How can I buy Pages with my iTunes card to my iPad? thank you

    I bought an iPad and an iTunes card, I want to buy an application from the Apps store but it only gives me the option of credit card.  How can I buy Pages with my iTunes card to my iPad? thank you

    Have you redeemed your iTunes card to an account associated with an Apple ID?
    Once you have your iPad associated with an Apple ID AND you have an account with a credit card associated with the same Apple ID AND you have some 'store credit' (from redeeming your iTunes card) then purchases use the store credit before they charge the credit card, so you should be ok!
    Personally, I use 'store credit' as a way to monitor whether or not there have been any 'unauthorised' purchases because as soon as the store credit is zero, the security code from the credit card is needed for further purchases!  It does mean that I have sometimes to top up store credit before making a purchase, but 'better safe than sorry'! 

  • Suddenly I can't find the volume bar on iPod nor YouTube apps. Also I can't hear anything from both apps. Any suggestions? I have an iphone 3gs

    Suddenly I can't find the volume bar on iPod nor YouTube apps. Also I can't hear anything from both apps. Any suggestions? I have an iphone 3gs

    Have you taken the steps recommended in the User Guide--restart, reset, restore from backup, restore as new?
    What happened after taking each of those steps?

  • Uploading a file from standalone app to another machine

    hi there,
    i wrote a awt application which can read a file in the local machine. after that i need to upload it to another machine in the internet. I got permissions to access that machine.
    if anybody knows the way how i can do this please help me.
    batta

    Yeah well if the machine has a webinterface, look for a package which can do HTTP uploads. Else check the apache commons.net which contains a nice FTP api.
    http://jakarta.apache.org/commons/net/

  • How do I purchase Keynote from the app store when it only shows "update"

    I bought a Macbook Pro from my office and the Keynote program was purchased by another employee. I want my own copy, however, the App Store shows "Update" rather than "Buy App" so I cannot just buy another copy. Am I missing something? Is there another way to buy  Keynote other than through the App Store (other than physically going to an Apple Store?)

    Your profile shows Mac OS 10.6 Snow Leopard, if you want to remain in 10.6 you will need to install iWorks 09, this is available from Ebay or Amazon at a very reasonable cost.
    To purchase the latest version of Keynote, you need  Yosemite installed:
    Log out of the Mac App Store (store > sign out)
    Log in using your own Apple ID
    If you don't have an Apple ID select create Apple ID from the login pane
    Delete Keynote from the applications folder
    in purchases tab of Mac App Store, purchase Keynote and click

  • I dont have a credit card and i cant purchase anything from the app store coz it only accepts credit cards, is there a different option for me to purchase?

    please help

    Choose the None, no credit card, option.
    This user, mountaingoatgirl, explains how to get a None option in your account details in the iTunes app on a Mac or PC. -
    https://discussions.apple.com/message/24907941

  • SQL exception from servlet

    Can anyone suggest why i get an sql expection from my servlet? Or suggest another way performing this. I just get a my table but no results becuase of an sql exception in tomcat server console. degree id is the parameter from the html page
    try{
         conn = DriverManager.getConnection(url, user, password);
         String selectSQL = "SELECT * from book2readinglist WHERE readinglist = " + degreeid + ""; // change * to book_id or whatever it is
         System.err.println("DEBUG: Query: " + selectSQL);
         Statement stmt = conn.createStatement();
         ResultSet rs1 = stmt.executeQuery(selectSQL);
         //print out html head element
         out.println("<head>"+
              "<meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">" +
              "<title>books</title>" +
              "</head>");
         // print out table header
         out.println("<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">" +
              "<tr><th><h4>Title</th></h4><th><h4>Author</th></h4><th><h4>Category</th></h4><th><h4>Cover</th></h4><th><h4>Publisher</th></h4><th><h4>Price</th></h4><th></th></tr>");
         //print out table rows one for each row returned in rs1
         while(rs1.next()){
              String selectSQL2 = "SELECT book from book2readinglist WHERE readinglist = " + degreeid + "";
              System.err.println("DEBUG: Query: " + selectSQL2);
    Statement stmt2 = conn.createStatement();
    ResultSet rs2 = stmt2.executeQuery(selectSQL2);
              while(rs2.next()){
              String selectSQL3 = "SELECT * from books WHERE idcol = " + rs2.getString("book") + ""; /
              System.err.println("DEBUG: Query: " + selectSQL3);
    Statement stmt3 = conn.createStatement();
    ResultSet rs3 = stmt3.executeQuery(selectSQL3);
         out.print("<tr>");
         out.print("<td><h5>" + rs3.getString("title") + "</td>");
         out.print("<td><h5>" + rs3.getString("author") + "</td>");
         out.print("<td><h5>" + rs3.getString("category") + "</td>");
         out.print("<td><img src=\"/assignment1/img/" + rs3.getString("cover") + "\" /></td>");
         out.print("<td><h5>" + rs3.getString("publisher") + "</td>");
         out.print("<td><h5>" + rs3.getString("price") + "</td></h5>");
    Thanks
    Nick

    i am afraid, exception stack trace would help us a lot in identifiyin wat, where, why an exception occured...

  • How can I avoid the message "Can't install java script because it was not downloaded from the App Store?

    I am trying to install an update for Java. The system won't allow it, saying I have specified "in Security" not to install any download not from the App Store. The only preferences pane I know of is the one on Safari, and it doesn't have anything about this. Am I looking in the wrong place? How can I get around it? I had the same trouble trying to install an Adobe Flash upgrade.

    When I use your hot link "these instructions" I get a  blank page.
    Here is the message I get on trying to install a Java Script update:
    This is frustrating in that
    the update is not available on the App store.
    it refers to security preferences I did not set and can't identify or locate--no such settings appear in Safari> security.
    Can you be more specific? Thanks.
    RWS
    Like Show 0 Likes (0) Reply This solved my question This helped me Reply to Linc DavisThis is the message:

  • I can't redownload Lion from the APP store.

    I can't re-download lion from the APP store.  I only downloaded it yesterday and it stopped during the night. I can't find it in my purchases. I got a receipt today so I did purchasee it! Any help??

    Glad to help. 
    When the download is finished, it'll start the installer.  You should quit the installer and drag a copy of the 4Gig installer out of the apps directory to another location. (the desktop is ok).
    The last step of the install will delete that huge download from the apps directory so if you needed it again, you'd have to download again.
    Edit:  To restart the installer, just double click it on the desktop or wherever you move it.

  • Cannt execute stored proc of one schema in another schema from java app.

    I am posting my problem in this forum as i i though it could be server-independent.
    I am working on apache tomcat and spring framework with Oracle db (schema/user A)
    We access oracle db from our java application by setting jndi and works fine.We have sqlstatements, stored procs and functions all run fine.
    Now we create a role (DBROLE) with all permissions to that original db schema/user(A) . We created another empty schema B and assigned that role(DBROLE) to that user B.
    (We grant all kind of permissions on tables/packages of schema A to user role DBROLE and also created synonyms)
    Intentions are: to access the schema A though schema B from application and avoiding direct access.
    In our spring application, we replaced database-settings with schema B.
    Things work fine: When its plain SQL statement is run from Java code but Stored proc wont run and we get
    'Wrong num of arguments/data types' error.
    Also all stored procs are in packages.To execute stored proc in java code, we use SimpleJdbcCall.
    I also checked run stored proc from schema B and its works. Only from web app, it doesnt work.
    Please suggest,what should be done to make this working or if there is other alternative.
    Thanks

    Instead of importing a scema in another schema specifiy the schemas in the external-schemaLocation property.
    SAXParser saxParser = new SAXParser();
    saxParser.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation", "xmlschema1.xsd, xmlschema2.xsd");

  • How to execute a script(.sql) file from a PL\SQL procedure

    I would like to know how to execute a .sql file from a stored procedure and the result of it should update a table. My .sql file contains select statements.

    Hi!
    just go through the following piece of code -
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    str varchar2(200);
      3  begin
      4    str := '@C:\RND\Oracle\Misc\b.sql';
      5    execute immediate(str);
      6* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at line 5ORA-00900: invalid SQL statement
    Cause: The statement is not recognized as a valid SQL statement. This error can occur if the Procedural Option is not installed and a SQL statement is issued that requires this option (for example, a CREATE PROCEDURE statement). You can determine if the Procedural Option is installed by starting SQL*Plus. If the PL/SQL banner is not displayed, then the option is not installed.
    Action: Correct the syntax or install the Procedural Option.
    Regards.
    Satyaki De.

  • Weblogic server is not responding when executing pl/sql procedure from jdev

    Dear Sir,
    i am using jdeveloper11g and oracle database with oracle spatial and i wrote procedure in database and executed perfect from sql plus
    but same procedure when i am trying to execute from jdeveloper its like hanging and giving following error here i am posting my jdeveloper code
    and error
    public String cb1_action() {
    // Add event code here...
    String tbName = (String)FacesContext.getCurrentInstance().getApplication().createValueBinding("#{bindings.tb}").getValue(FacesContext.getCurrentInstance());
    String colName = (String)FacesContext.getCurrentInstance().getApplication().createValueBinding("#{bindings.col}").getValue(FacesContext.getCurrentInstance());
    try {
    Context cnx = new InitialContext();
    Class.forName("oracle.jdbc.OracleDriver");
    RmiDataSource rds =
    (RmiDataSource)cnx.lookup("java:comp/env/jdbc/db1DS");
    //(RmiDataSource)cnx.lookup("env/jdbc/db1DS");
    Connection cn = rds.getConnection();
    System.out.println("table name " + tbName);
    System.out.println("column name " + colName);
    PreparedStatement delStmt = cn.prepareStatement("delete from geometry_errors");
    delStmt.execute();
    System.out.println("delStmt = " + delStmt);
    cn.commit();
    delStmt.close();
    CallableStatement ps = cn.prepareCall("{call validate_geom(?,?)}");
    ps.setString(1, tbName);
    ps.setString(2, colName);
    ps.execute();
    ps.close();
    cn.close();
    cnx.close();
    System.out.println("Done validating geom ....");
    } catch (Exception sqle) {
    sqle.printStackTrace();
    BindingContainer bc = getBindings();
    OperationBinding oper = bc.getOperationBinding("Execute");
    oper.execute();
    System.out.println("done.....");
    return null;
    Target URL -- http://127.0.0.1:7101/kabtest-ViewController1-context-root/faces/test1.jsp
    table name JEDDAH_SECTORS_8307
    column name GEOM
    <Jul 29, 2010 1:22:49 PM AST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "621" seconds working on the request "weblogic.servlet.internal.ServletRequestImpl@13a7ecf[
    POST /kabtest-ViewController1-context-root/faces/test1.jsp?_adf.ctrl-state=xumczak86_4 HTTP/1.1
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Referer: http://127.0.0.1:7101/kabtest-ViewController1-context-root/faces/test1.jsp?_afrLoop=1305015256967&_afrWindowMode=0&_adf.ctrl-state=xumczak86_4
    Cookie: JSESSIONID=7qmnMRTWld4BzJDnLB4BF1hvxgl0NYTJrg9lT3VnWNYJpCmzGYJm!-1863071826
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 247
    ]", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         oracle.net.ns.Packet.receive(Packet.java:293)
         oracle.net.ns.DataPacket.receive(DataPacket.java:92)
         oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:174)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:119)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:94)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:79)
         oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122)
         oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78)
         oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1040)
         oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1016)
         oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:589)
         oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
         oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1223)
         oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
         oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
         oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
         weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:98)
         view.backing.Test1.cb1_action(Test1.java:132)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
         com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         java.security.AccessController.doPrivileged(Native Method)
         oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    >
    <Jul 29, 2010 1:22:49 PM AST> <Notice> <Diagnostics> <BEA-320068> <Watch 'StuckThread' with severity 'Notice' on server 'DefaultServer' has triggered at Jul 29, 2010 1:22:49 PM AST. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND (MSGID = 'BEA-000337')
    WatchData: DATE = Jul 29, 2010 1:22:49 PM AST SERVER = DefaultServer MESSAGE = [STUCK] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "621" seconds working on the request "weblogic.servlet.internal.ServletRequestImpl@13a7ecf[
    POST /kabtest-ViewController1-context-root/faces/test1.jsp?_adf.ctrl-state=xumczak86_4 HTTP/1.1
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Referer: http://127.0.0.1:7101/kabtest-ViewController1-context-root/faces/test1.jsp?_afrLoop=1305015256967&_afrWindowMode=0&_adf.ctrl-state=xumczak86_4
    Cookie: JSESSIONID=7qmnMRTWld4BzJDnLB4BF1hvxgl0NYTJrg9lT3VnWNYJpCmzGYJm!-1863071826
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 247
    ]", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         oracle.net.ns.Packet.receive(Packet.java:293)
         oracle.net.ns.DataPacket.receive(DataPacket.java:92)
         oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:174)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:119)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:94)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:79)
         oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122)
         oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78)
         oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1040)
         oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1016)
         oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:589)
         oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
         oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1223)
         oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
         oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
         oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
         weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:98)
         view.backing.Test1.cb1_action(Test1.java:132)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
         com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         java.security.AccessController.doPrivileged(Native Method)
         oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    SUBSYSTEM = WebLogicServer USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-000337 MACHINE = lpt09-mkabeer TXID = CONTEXTID = TIMESTAMP = 1280398969203
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 600000
    >
    <JMXWatchNotificationListener><handleNotification> failure creating incident from WLDF notification
    oracle.dfw.incident.IncidentCreationException: DFW-40116: failure creating incident
    Cause: DFW-40112: There was an error executing adrci commands; the following errors have been found "DIA-48415: Syntax error found in string [create home base=C:\\Documents and Settings\\mkabeer\\Application] at column [65]
    DIA-48447: The input path [C:\\Documents and Settings\\mkabeer\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr] does not contain any ADR homes
    DIA-48447: The input path [diag\ofm\defaultdomain\defaultserver] does not contain any ADR homes
    DIA-48494: ADR home is not set, the corresponding operation cannot be done
    Action: Ensure that command line tool "adrci" can be executed from the command line.
         at oracle.dfw.impl.incident.DiagnosticsDataExtractorImpl.createADRIncident(DiagnosticsDataExtractorImpl.java:708)
         at oracle.dfw.impl.incident.DiagnosticsDataExtractorImpl.createIncident(DiagnosticsDataExtractorImpl.java:246)
         at oracle.dfw.spi.weblogic.JMXWatchNotificationListener.handleNotification(JMXWatchNotificationListener.java:195)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor$ListenerWrapper.handleNotification(DefaultMBeanServerInterceptor.java:1732)
         at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:257)
         at javax.management.NotificationBroadcasterSupport$SendNotifJob.run(NotificationBroadcasterSupport.java:322)
         at javax.management.NotificationBroadcasterSupport$1.execute(NotificationBroadcasterSupport.java:307)
         at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:229)
         at weblogic.management.jmx.modelmbean.WLSModelMBean.sendNotification(WLSModelMBean.java:824)
         at weblogic.diagnostics.watch.JMXNotificationProducer.postJMXNotification(JMXNotificationProducer.java:79)
         at weblogic.diagnostics.watch.JMXNotificationProducer.sendNotification(JMXNotificationProducer.java:104)
         at com.bea.diagnostics.notifications.JMXNotificationService.send(JMXNotificationService.java:122)
         at weblogic.diagnostics.watch.JMXNotificationListener.processWatchNotification(JMXNotificationListener.java:103)
         at weblogic.diagnostics.watch.Watch.performNotifications(Watch.java:621)
         at weblogic.diagnostics.watch.Watch.evaluateLogRuleWatch(Watch.java:546)
         at weblogic.diagnostics.watch.WatchManager.evaluateLogEventRulesAsync(WatchManager.java:765)
         at weblogic.diagnostics.watch.WatchManager.run(WatchManager.java:525)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: oracle.dfw.common.DiagnosticsException: DFW-40112: failed to execute the adrci commands "create home base=C:\\Documents and Settings\\mkabeer\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr product_type=ofm product_id=defaultdomain instance_id=defaultserver
    set base C:\\Documents and Settings\\mkabeer\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr
    set homepath diag\ofm\defaultdomain\defaultserver
    create incident problem_key="BEA-337 [WebLogicServer]" error_facility="BEA" error_number=337 error_message="null" create_time="2010-07-29 13:22:49.219 +03:00" ecid="0000IcTiSfuEKQWzLwbQ8A1CKL6r00000V"
    Cause: There was an error executing adrci commands; the following errors have been found "DIA-48415: Syntax error found in string [create home base=C:\\Documents and Settings\\mkabeer\\Application] at column [65]
    DIA-48447: The input path [C:\\Documents and Settings\\mkabeer\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr] does not contain any ADR homes
    DIA-48447: The input path [diag\ofm\defaultdomain\defaultserver] does not contain any ADR homes
    DIA-48494: ADR home is not set, the corresponding operation cannot be done
    Action: Ensure that command line tool "adrci" can be executed from the command line.
         at oracle.dfw.impl.incident.ADRHelper.invoke(ADRHelper.java:1052)
         at oracle.dfw.impl.incident.ADRHelper.createIncident(ADRHelper.java:786)
         at oracle.dfw.impl.incident.DiagnosticsDataExtractorImpl.createADRIncident(DiagnosticsDataExtractorImpl.java:688)
         ... 19 more
    <Jul 29, 2010 1:23:49 PM AST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "681" seconds working on the request "weblogic.servlet.internal.ServletRequestImpl@13a7ecf[
    POST /kabtest-ViewController1-context-root/faces/test1.jsp?_adf.ctrl-state=xumczak86_4 HTTP/1.1
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Referer: http://127.0.0.1:7101/kabtest-ViewController1-context-root/faces/test1.jsp?_afrLoop=1305015256967&_afrWindowMode=0&_adf.ctrl-state=xumczak86_4
    Cookie: JSESSIONID=7qmnMRTWld4BzJDnLB4BF1hvxgl0NYTJrg9lT3VnWNYJpCmzGYJm!-1863071826
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 247
    ]", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         oracle.net.ns.Packet.receive(Packet.java:293)
         oracle.net.ns.DataPacket.receive(DataPacket.java:92)
         oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:174)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:119)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:94)
         oracle.net.ns.NetInputStream.read(NetInputStream.java:79)
         oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122)
         oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78)
         oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1040)
         oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1016)
         oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:589)
         oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
         oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1223)
         oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
         oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
         oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
         weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:98)
         view.backing.Test1.cb1_action(Test1.java:132)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
         com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
         oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         java.security.AccessController.doPrivileged(Native Method)
         oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    please some one help me to solve this problem either this problem from java code or weblogic server... because i am sure about oracle database is
    not having any problem because the same procedure i executed through the sql plus and its give me results just in time
    Thanks
    Kabeer

    Hi, Nodex,
    Avoid implicit conversions.
    For example:
    TO_CHAR(TRUNC(NEXT_DAY(ADD_MONTHS(substr(partition_name, -8, length(partition_name)), -3), 'MONDAY')-7), 'YYYYMMDD')ADD_MONTHS expects a DATE as its first argument.
    SUBSTR returns a VARCHAR2, so you're calling ADD_MONTHS with a VARCHAR2 where it expects a DATE.
    For good or ill, the system tries to avoid raising an error in this case by implicitly converting the VARCHAR2 to a DATE. Exactly how it does that depends on
    (a) the tool you are using (SQL*Plus or Toad, for example),
    (b) the version (Oracle 10 behaved quite different form Oracle 9),
    (c) environmental settings (such as NLS_DATE_FORMAT), which in turn may depend on initialization parameneters, and
    (d) who knows what else.
    When you have to convert, do so explicitly.
    You can convert a VARCHAR2 to a DATE using TO_DATE, like this:
    TO_CHAR ( TRUNC ( NEXT_DAY ( ADD_MONTHS ( TO_DATE ( SUBSTR ( partition_name
                                                       , -8
                                          , LENGTH (partition_name)
                                     , 'YYYYMMDD'     -- or whatever
                             , -3
                      , 'MONDAY'
              - 7
         , 'YYYYMMDD'
         )

  • Standalone webcache or Web cache from Oracle Apps Server 10.1.2.0.2?

    Hi
    I am installing web cache on two servers in web tier and J2EE server (with OHS) on another two servers in apps tier. Should I use standalone webcache or install from Oracle Apps Server package? If I choose Oracle Apps Server package, I have to disable Home, HTTP components. But it is DCM managed. Any suggestions?
    And should I deploy my OHS servers on web cache servers in the web tier? In future we want to expand J2EE installation, we will deploy Portal with SSO, OID etc.
    Regards
    Shen Jie

    Shen Jie,
    Please review the Enterprise Deployment to see what are the best architectures.
    Hope this helps.
    Deepak

  • How to execute a  .sql file from a batch file

    Hi all
    I've to take backup of a database weekly twice on every wednesday & Friday @ 5pm IST. I've written a hot backup script, which works every well.
    now i want to automate the script. ie i want this script to run on wednesday & friday @ 5pm without any human interfearance ie with out actually any1 executing this script.
    i created a batch file prod.bak with the following lines
    @echo off
    set oracle_sid=testdb
    set oracle_home=d:\oracle\ora92
    sqlplus /nolog
    connect sys as sysdba/oracletest@testdb
    this batch file when eexecuted connects me to sql prompt.
    Now i want to execute my backup script bkp.sql automatically when it is connected to sql prompt.
    (i tried with these lines in the above batch file...
    call bkp.sql---it just opens the bkp.sql file in notepad & displays the script
    start bkp.sql---same as call
    connect / as sysdba/pwd@[email protected] --- does not work simply remains a the sql prompt.
    At 17:00 /Every:w,f "d:\bkp.sql"---does not work simply remains at the sql promt.)
    Can any1 let me know what should i write in the batch file that will execute the bkp.sql file automatically after it gets connected to sql prompt. M using oracle 9i.
    I'll manage he time through windows utility of scheduling task.. Let me know how to execute the .sql file from a batch file.
    Thanks
    Tripti

    Try
    sqlplus "sys/oracletest as sysdba" @bpk.sql
    Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
    Remember to put an exit at the end of the bpk.sql script.

  • Strange problem with executing PL/SQL procedure from sqlplus.

    Hello,
    basicly, I'm strugling with executing a procedure written in PL/SQL from sqlplus.
    It's all because I convert a data in procedure by other function.
    SELECT partition_name
    INTO strpartition
    FROM user_tab_partitions
    WHERE table_name = tablename_in
    and substr(partition_name, -8, length(partition_name)) = (SELECT F_CONVERT_DATE(tablename_in,p_date) from dual);
    /tablename_in and p_date are input parameters/
    Function F_CONVERT_DATE looks more less like :
    select
    TO_CHAR(TRUNC(NEXT_DAY(ADD_MONTHS(substr(partition_name, -8, length(partition_name)), -3), 'MONDAY')-7), 'YYYYMMDD')
    END
    AS p_date
    INTO v_okr
    FROM user_tab_partitions
    where substr(partition_name, -8, length(partition_name)) = p_date;
    Well, the thing is that procedure is executable from TOAD without any errors !! But when I try to execute it straight from sqlplus it returns:
    ORA-01861: literal does not match format string
    ORA-06512: at "F_CONVERT_DATE", line 13
    ORA-06512: at "NAME_OF_PROCEDURE", line 17
    Tip: When I don't use functions ADD_MONTHS, NEXT_DAY and TO_CHAR in function F_CONVERT_DATE sqlplus can execute it. But only when I use them it returns an error.
    Anybody has a clue how to solve it?
    Regards !

    Hi, Nodex,
    Avoid implicit conversions.
    For example:
    TO_CHAR(TRUNC(NEXT_DAY(ADD_MONTHS(substr(partition_name, -8, length(partition_name)), -3), 'MONDAY')-7), 'YYYYMMDD')ADD_MONTHS expects a DATE as its first argument.
    SUBSTR returns a VARCHAR2, so you're calling ADD_MONTHS with a VARCHAR2 where it expects a DATE.
    For good or ill, the system tries to avoid raising an error in this case by implicitly converting the VARCHAR2 to a DATE. Exactly how it does that depends on
    (a) the tool you are using (SQL*Plus or Toad, for example),
    (b) the version (Oracle 10 behaved quite different form Oracle 9),
    (c) environmental settings (such as NLS_DATE_FORMAT), which in turn may depend on initialization parameneters, and
    (d) who knows what else.
    When you have to convert, do so explicitly.
    You can convert a VARCHAR2 to a DATE using TO_DATE, like this:
    TO_CHAR ( TRUNC ( NEXT_DAY ( ADD_MONTHS ( TO_DATE ( SUBSTR ( partition_name
                                                       , -8
                                          , LENGTH (partition_name)
                                     , 'YYYYMMDD'     -- or whatever
                             , -3
                      , 'MONDAY'
              - 7
         , 'YYYYMMDD'
         )

Maybe you are looking for