Help required in a Stored Procedure

I have a stored procedure as follows:
create or replace
PROCEDURE ACCOUNT_HISTORY_PROC_TEST (v_accountid IN VARCHAR2 DEFAULT NULL,
                                        v_enddate IN Date DEFAULT NULL,
                                        cv_1 IN OUT SYS_REFCURSOR,
                                        flag IN INTEGER,
                                        v_Error OUT NOCOPY NVARCHAR2
                                      ) AS
   DAY_1 varchar(4000);
   DAY_2 varchar(4000);
   DAY_3 varchar(4000);
   DAY_4 varchar(4000);
   DAY_5 varchar(4000);
   DAY_6 varchar(4000);
   days_Diff number default 0;
   currdate date;
BEGIN --Stored Procedure Beginning
/*If the Account History Table has the Account Id then the following will be executed*/
   IF flag = 0 THEN --1st IF
     Select CurrentDate,DAY2,DAY3,DAY4,DAY5,DAY6 into currdate,DAY_2,DAY_3,DAY_4,DAY_5,DAY_6 from ACCOUNT_STATS_TABLE where Account_id = v_AccountId;
/*If the transaction is on the same day then the following will be executed*/
      IF currdate = v_endDate THEN --2nd IF
          OPEN cv_1 FOR
                Select DEPOSIT_CNT,DEPOSIT_AMT,WITHDRAWAL_CNT,WITHDRAWAL_AMT,ATM_CREDIT_CNT,ATM_CREDIT_AMT,ATM_DEBIT_CNT,ATM_DEBIT_AMT,CASH_CREDIT_CNT,CASH_CREDIT_AMT,CASH_DEBIT_CNT,CASH_DEBIT_AMT,CLRNG_CREDIT_CNT,CLRNG_CREDIT_AMT,CLRNG_DEBIT_CNT,CLRNG_DEBIT_AMT,TRANSFER_CREDIT_CNT,TRANSFER_CREDIT_AMT,TRANSFER_DEBIT_CNT,TRANSFER_DEBIT_AMT,CUMMULATIVE_CNT,CUMMULATIVE_AMT,CASH_COUNT,CASH_AMOUNT,DAY1,DAY2,DAY3,DAY4,DAY5,DAY6,CDAY_DEPOSIT_COUNT,CDAY_DEPOSIT_AMOUNT,CDAY_WITHDRAWAL_COUNT,CDAY_WITHDRAWAL_AMOUNT,CDAY_ATM_CREDITTXN_COUNT,CDAY_ATM_CREDITTXN_AMOUNT,CDAY_ATM_DEBITTXN_COUNT,CDAY_ATM_DEBITTXN_AMOUNT,CDAY_CASH_CREDITTXN_COUNT,CDAY_CASH_CREDITTXN_AMOUNT,CDAY_CASH_DEBITTXN_COUNT,CDAY_CASH_DEBITTXN_AMOUNT,CDAY_CLEARING_CREDITTXN_COUNT,CDAY_CLEARING_CREDITTXN_AMOUNT,CDAY_CLEARING_DEBITTXN_COUNT,CDAY_CLEARING_DEBITTXN_AMOUNT,CDAY_TRANSFER_CREDITTXN_COUNT,CDAY_TRANSFER_CREDITTXN_AMOUNT,CDAY_TRANSFER_DEBITTXN_COUNT,CDAY_TRANSFER_DEBITTXN_AMOUNT,CDAY_CUMMULATIVETXN_COUNT,CDAY_CUMMULATIVETXN_AMOUNT,CDAY_CASH_TXN_COUNT,CDAY_CASH_TXN_AMOUNT,CURRENTDATE from ACCOUNT_STATS_TABLE where Account_id = v_AccountId;
/*If the transaction is not on the same day then the DAY1,DAY2,DAY3,DAY4,DAY5,DAY6 columns will be shifted which will be done in the following part*/
      ELSE --2nd ELSE
        days_diff:=v_endDate-currdate;
        FOR i IN 1..days_diff LOOP
        DAY_1:=DAY_2;
        DAY_2:=DAY_3;
        DAY_3:=DAY_4;
        DAY_4:=DAY_5;
        DAY_5:=DAY_6;
        DAY_6:='0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0';
        END LOOP;
                  Update ACCOUNT_STATS_TABLE
                            set DAY1 = DAY_1,
                                DAY2 = DAY_2,
                                DAY3 = DAY_3,
                                DAY4 = DAY_4,
                                DAY5 = DAY_5,
                                DAY6 = DAY_6,
                                CDAY_DEPOSIT_COUNT=0,
                                CDAY_DEPOSIT_AMOUNT=0,
                                CDAY_WITHDRAWAL_COUNT=0,
                                CDAY_WITHDRAWAL_AMOUNT=0,
                                CDAY_ATM_CREDITTXN_COUNT=0,
                                CDAY_ATM_CREDITTXN_AMOUNT=0,
                                CDAY_ATM_DEBITTXN_COUNT=0,
                                CDAY_ATM_DEBITTXN_AMOUNT=0,
                                CDAY_CASH_CREDITTXN_COUNT=0,
                                CDAY_CASH_CREDITTXN_AMOUNT=0,
                                CDAY_CASH_DEBITTXN_COUNT=0,
                                CDAY_CASH_DEBITTXN_AMOUNT=0,
                                CDAY_CLEARING_CREDITTXN_COUNT=0,
                                CDAY_CLEARING_CREDITTXN_AMOUNT=0,
                                CDAY_CLEARING_DEBITTXN_COUNT=0,
                                CDAY_CLEARING_DEBITTXN_AMOUNT=0,
                                CDAY_TRANSFER_CREDITTXN_COUNT=0,
                                CDAY_TRANSFER_CREDITTXN_AMOUNT=0,
                                CDAY_TRANSFER_DEBITTXN_COUNT=0,
                                CDAY_TRANSFER_DEBITTXN_AMOUNT=0,
                                CDAY_CUMMULATIVETXN_COUNT=0,
                                CDAY_CUMMULATIVETXN_AMOUNT=0,
                                CDAY_CASH_TXN_COUNT=0,
                                CDAY_CASH_TXN_AMOUNT=0,
                                CurrentDate = v_enddate
                                where Account_id = v_accountid;
      open cv_1 for
          Select DEPOSIT_CNT,DEPOSIT_AMT,WITHDRAWAL_CNT,WITHDRAWAL_AMT,ATM_CREDIT_CNT,ATM_CREDIT_AMT,ATM_DEBIT_CNT,ATM_DEBIT_AMT,CASH_CREDIT_CNT,CASH_CREDIT_AMT,CASH_DEBIT_CNT,CASH_DEBIT_AMT,CLRNG_CREDIT_CNT,CLRNG_CREDIT_AMT,CLRNG_DEBIT_CNT,CLRNG_DEBIT_AMT,TRANSFER_CREDIT_CNT,TRANSFER_CREDIT_AMT,TRANSFER_DEBIT_CNT,TRANSFER_DEBIT_AMT,CUMMULATIVE_CNT,CUMMULATIVE_AMT,CASH_COUNT,CASH_AMOUNT,DAY1,DAY2,DAY3,DAY4,DAY5,DAY6,CDAY_DEPOSIT_COUNT,CDAY_DEPOSIT_AMOUNT,CDAY_WITHDRAWAL_COUNT,CDAY_WITHDRAWAL_AMOUNT,CDAY_ATM_CREDITTXN_COUNT,CDAY_ATM_CREDITTXN_AMOUNT,CDAY_ATM_DEBITTXN_COUNT,CDAY_ATM_DEBITTXN_AMOUNT,CDAY_CASH_CREDITTXN_COUNT,CDAY_CASH_CREDITTXN_AMOUNT,CDAY_CASH_DEBITTXN_COUNT,CDAY_CASH_DEBITTXN_AMOUNT,CDAY_CLEARING_CREDITTXN_COUNT,CDAY_CLEARING_CREDITTXN_AMOUNT,CDAY_CLEARING_DEBITTXN_COUNT,CDAY_CLEARING_DEBITTXN_AMOUNT,CDAY_TRANSFER_CREDITTXN_COUNT,CDAY_TRANSFER_CREDITTXN_AMOUNT,CDAY_TRANSFER_DEBITTXN_COUNT,CDAY_TRANSFER_DEBITTXN_AMOUNT,CDAY_CUMMULATIVETXN_COUNT,CDAY_CUMMULATIVETXN_AMOUNT,CDAY_CASH_TXN_COUNT,CDAY_CASH_TXN_AMOUNT,CURRENTDATE from ACCOUNT_STATS_TABLE where Account_id = v_AccountId;
      END IF; --END 2nd IF
/*If the Account History Table does not have Account Id then the following will be executed*/
ELSE --1st ELSE
/*If the transaction is in the middle of the month then the AH_PROC_REVISED Stored Procedure will be called*/     
          AH_PROC(v_accountid,v_enddate);
      open cv_1 for
      Select DEPOSIT_CNT,DEPOSIT_AMT,WITHDRAWAL_CNT,WITHDRAWAL_AMT,ATM_CREDIT_CNT,ATM_CREDIT_AMT,ATM_DEBIT_CNT,ATM_DEBIT_AMT,CASH_CREDIT_CNT,CASH_CREDIT_AMT,CASH_DEBIT_CNT,CASH_DEBIT_AMT,CLRNG_CREDIT_CNT,CLRNG_CREDIT_AMT,CLRNG_DEBIT_CNT,CLRNG_DEBIT_AMT,TRANSFER_CREDIT_CNT,TRANSFER_CREDIT_AMT,TRANSFER_DEBIT_CNT,TRANSFER_DEBIT_AMT,CUMMULATIVE_CNT,CUMMULATIVE_AMT,CASH_COUNT,CASH_AMOUNT,DAY1,DAY2,DAY3,DAY4,DAY5,DAY6,CDAY_DEPOSIT_COUNT,CDAY_DEPOSIT_AMOUNT,CDAY_WITHDRAWAL_COUNT,CDAY_WITHDRAWAL_AMOUNT,CDAY_ATM_CREDITTXN_COUNT,CDAY_ATM_CREDITTXN_AMOUNT,CDAY_ATM_DEBITTXN_COUNT,CDAY_ATM_DEBITTXN_AMOUNT,CDAY_CASH_CREDITTXN_COUNT,CDAY_CASH_CREDITTXN_AMOUNT,CDAY_CASH_DEBITTXN_COUNT,CDAY_CASH_DEBITTXN_AMOUNT,CDAY_CLEARING_CREDITTXN_COUNT,CDAY_CLEARING_CREDITTXN_AMOUNT,CDAY_CLEARING_DEBITTXN_COUNT,CDAY_CLEARING_DEBITTXN_AMOUNT,CDAY_TRANSFER_CREDITTXN_COUNT,CDAY_TRANSFER_CREDITTXN_AMOUNT,CDAY_TRANSFER_DEBITTXN_COUNT,CDAY_TRANSFER_DEBITTXN_AMOUNT,CDAY_CUMMULATIVETXN_COUNT,CDAY_CUMMULATIVETXN_AMOUNT,CDAY_CASH_TXN_COUNT,CDAY_CASH_TXN_AMOUNT,CURRENTDATE from ACCOUNT_STATS_TABLE where Account_id = v_AccountId;
END IF; --END 1st IF
EXCEPTION
   WHEN OTHERS THEN
  -- open cv_1 for Select DEPOSIT_CNT,DEPOSIT_AMT,WITHDRAWAL_CNT,WITHDRAWAL_AMT,ATM_CREDIT_CNT,ATM_CREDIT_AMT,ATM_DEBIT_CNT,ATM_DEBIT_AMT,CASH_CREDIT_CNT,CASH_CREDIT_AMT,CASH_DEBIT_CNT,CASH_DEBIT_AMT,CLRNG_CREDIT_CNT,CLRNG_CREDIT_AMT,CLRNG_DEBIT_CNT,CLRNG_DEBIT_AMT,TRANSFER_CREDIT_CNT,TRANSFER_CREDIT_AMT,TRANSFER_DEBIT_CNT,TRANSFER_DEBIT_AMT,CUMMULATIVE_CNT,CUMMULATIVE_AMT,CASH_COUNT,CASH_AMOUNT,DAY1,DAY2,DAY3,DAY4,DAY5,DAY6,CDAY_DEPOSIT_COUNT,CDAY_DEPOSIT_AMOUNT,CDAY_WITHDRAWAL_COUNT,CDAY_WITHDRAWAL_AMOUNT,CDAY_ATM_CREDITTXN_COUNT,CDAY_ATM_CREDITTXN_AMOUNT,CDAY_ATM_DEBITTXN_COUNT,CDAY_ATM_DEBITTXN_AMOUNT,CDAY_CASH_CREDITTXN_COUNT,CDAY_CASH_CREDITTXN_AMOUNT,CDAY_CASH_DEBITTXN_COUNT,CDAY_CASH_DEBITTXN_AMOUNT,CDAY_CLEARING_CREDITTXN_COUNT,CDAY_CLEARING_CREDITTXN_AMOUNT,CDAY_CLEARING_DEBITTXN_COUNT,CDAY_CLEARING_DEBITTXN_AMOUNT,CDAY_TRANSFER_CREDITTXN_COUNT,CDAY_TRANSFER_CREDITTXN_AMOUNT,CDAY_TRANSFER_DEBITTXN_COUNT,CDAY_TRANSFER_DEBITTXN_AMOUNT,CDAY_CUMMULATIVETXN_COUNT,CDAY_CUMMULATIVETXN_AMOUNT,CDAY_CASH_TXN_COUNT,CDAY_CASH_TXN_AMOUNT,CURRENTDATE from ACCOUNT_STATS_TABLE where Account_id = v_AccountId;
  v_Error := SQLERRM;
  --dbms_output.PUT_LINE('No data');
END ; --Stored Procedure End hereI want to modify this a little..
What i am doing right now is if flag = 0, then I am getting some values from the Account_Stats_Table and comapring if the current_datereturn from the table is same as the passed date..If same then, i return the cursor having the values for the passed accountid..There is two time querying of the table..
I want to avoid querying the table twice..If current date and passed date both are same then, let it return the results of the opened cursor.. How can i do it.. How can i avoid issuing select queries twice.. Please help..

You can try this:
IF flag = 0 THEN --1st IF
OPEN cv_1 FOR
Select DEPOSIT_CNT,DEPOSIT_AMT,WITHDRAWAL_CNT,WITHDRAWAL_AMT,ATM_CREDIT_CNT,ATM_CREDIT_AMT,ATM_DEBIT_CNT,ATM_DEBIT_AMT,CASH_CREDIT_CNT,CASH_CREDIT_AMT,CASH_DEBIT_CNT,CASH_DEBIT_AMT,CLRNG_CREDIT_CNT,CLRNG_CREDIT_AMT,CLRNG_DEBIT_CNT,CLRNG_DEBIT_AMT,TRANSFER_CREDIT_CNT,TRANSFER_CREDIT_AMT,TRANSFER_DEBIT_CNT,TRANSFER_DEBIT_AMT,CUMMULATIVE_CNT,CUMMULATIVE_AMT,CASH_COUNT,CASH_AMOUNT,DAY1,DAY2,DAY3,DAY4,DAY5,DAY6,CDAY_DEPOSIT_COUNT,CDAY_DEPOSIT_AMOUNT,CDAY_WITHDRAWAL_COUNT,CDAY_WITHDRAWAL_AMOUNT,CDAY_ATM_CREDITTXN_COUNT,CDAY_ATM_CREDITTXN_AMOUNT,CDAY_ATM_DEBITTXN_COUNT,CDAY_ATM_DEBITTXN_AMOUNT,CDAY_CASH_CREDITTXN_COUNT,CDAY_CASH_CREDITTXN_AMOUNT,CDAY_CASH_DEBITTXN_COUNT,CDAY_CASH_DEBITTXN_AMOUNT,CDAY_CLEARING_CREDITTXN_COUNT,CDAY_CLEARING_CREDITTXN_AMOUNT,CDAY_CLEARING_DEBITTXN_COUNT,CDAY_CLEARING_DEBITTXN_AMOUNT,CDAY_TRANSFER_CREDITTXN_COUNT,CDAY_TRANSFER_CREDITTXN_AMOUNT,CDAY_TRANSFER_DEBITTXN_COUNT,CDAY_TRANSFER_DEBITTXN_AMOUNT,CDAY_CUMMULATIVETXN_COUNT,CDAY_CUMMULATIVETXN_AMOUNT,CDAY_CASH_TXN_COUNT,CDAY_CASH_TXN_AMOUNT,CURRENTDATE
from
ACCOUNT_STATS_TABLE
where
Account_id = v_AccountId AND CurrentDate = v_enddate;

Similar Messages

  • Help required in JDBC Stored Procedure

    Hi All,
    i have a requirement where i need to update the Database table using Stored Procedure from PI.
    I have the receiver JDBC channel and have done the mapping.
    The stored procedure has inputs of type NUMBER, VARCHAR2,DATE. in the message mapping i tried passing the same values in the type field, it throwed an error like UnSuppoted Format. Then i changed the type to integer for NUMBER and String for Varchar2 then also it is throwing an error like
    +java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PUT_XXXXX' ORA-06550: line 1, column 7: PL/SQL: Statement ignored +
    Can any please help with what type i need to send from PI to Stored procedure?
    Also, there two out type fileds defined in the Stored procedure..which i didnt create in my PI structure. Do we need to create that fileds in our structure?
    Please help me.
    Thanks,
    Hemanth.

    Hi Hemanth Kumar,
    I understand that you want to execute a stored procedure using JDBC receiver channel and looking at error message, you think there is an issue with type defined in Data Type.
    Now you need to debug step by step.
    Step 1:- In Interface Mapping Determination, do not refer to Operational Mapping (delete only OM from there, not the receiver Message Interface). By doing so, you are not call the OM (which refer to Graphical Mapping (MM refer to Data Type (which you think is wrong)). Note: As there is no OM, we need to send the exact payload required by receiver JDBC from Runtime Work Bench, for testing purpose.
    Step 2:- In receiver JDBC channel, change u2018Message Protocolu2019 from u201CXML SQL Formatu201D to u201CNative SQL Stringu201D. By doing this, you can do testing very fast; receiver JDBC channel will take only String. And we need to send the exact String which is needed by JDBC Stored Procedure. [Link1|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm]
    Step 3:- Now from RWB test the scenario. Payload should like this, please take help of Data base team to find the String which needs to send.
    EXECUTE PUT_uspAddress @City = 'New York'
    OR If you have access to the database, logon to it directly and try running the Stored Procedure.
    Step 4:- Now, you should have the string which executes the Stored Procedure correctly to go ahead. Your job is 60% done.
    Step 5:- Now, in receiver JDBC channel, change u2018Message Protocolu2019 from u201CNative SQL Stringu201D to u201CXML SQL Formatu201D. So that receiver JDBC channel will take only XML.
    Step 6:- So now, you have to construct equalant XML structure to String you got in Step 4.
    It may look like this [Link2|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b72b2fde93673e10000000a114a6b/frameset.htm]
    <StatementName>
        <storedProcedureName action=u201D EXECUTEu201D>
           <table> PUT_uspAddress </table>
            < City [isInput=u201Dtrueu201D] type=SQLDatatype>val1</ City>
        </storedProcedureName >
      </StatementName>
    Step 7:- Now use the XML you have constructed in Step 6, to test the scenario from RWB. Try to correct if you come up with some errors. Your job is 90% done.
    Step 8:- Now, in Interface Mapping Determination refer back the Operational Mapping again, which contain the Message Mapping. Make sure that Message Mapping give the XML output same as XML you have developed in Step 6.
    FYI. 1. Whatever youu2019re sending, it will be converted to JDBC statement and will be executed on the database. logSQLStatement(JDBC Additional parameters sapnote_0000801367) will be show in logging not in payload.
    2. Most of the cases, type defined in Data Type has no control of what we can send in that element (except Date type). Let say, you can define an element u2018Ageu2019 as u2018numberu2019, but you can always send u201Casdfasdfu201D as input in Message Mapping.
    Regards,
    Raghu_Vamsee

  • Help me in calling stored procedure and getting results

    hi
    i have a SP like this
    CREATE OR REPLACE PACKAGE P1 AS
    TYPE g_con_ref_cursor is REF CURSOR ;
    TYPE g_con_error IS RECORD
      error_code NUMBER,
      error_desc varchar2(2000)
    PROCEDURE PROC_CURSOR
    (i_str_userid  IN VARCHAR2,
      o_cur_ref_cur OUT g_con_ref_cursor,
      o_rec_error   OUT g_con_error,
      o_num_status  OUT NUMBER);
    END;
    and i now i am trying to call this SP using my java program
    i am able to register the out put params for 2nd and 4 th variable
    my doubt is how i can register the output param for g_con_errorand how i can get result from this ????
    my java program is like this
    Connection connection = DatabaseHelper.prepareConnection();
    CallableStatement proc = connection.prepareCall("{ call P1.PROC_CURSOR(?, ?, ?, ?) }");
    proc.setString(1,"jn26557");
    proc.registerOutParameter(2,oracle.jdbc.driver.OracleTypes.CURSOR);
    proc.registerOutParameter(3,Types.STRUCT,); //HOW TO SET  THIS ?????
    proc.registerOutParameter(4,oracle.jdbc.driver.OracleTypes.NUMERIC);
    proc.execute();
    plz help me in this
    i have no idea how to do it
    any help would be appreciated
    Thanks in advance
    Jaya Prakash Nalajala

    You have the requirements to build the stored procedure, what have you got so far?
    Post your attempt and any errors or issues that you might be experiencing. Writing the whole procedure for you (without the table structure even) is going to be difficult.

  • Looking for some help with using Oracle stored procedures in vb2010

    First off thank you to whoever lends me a hand with my problem. A little background first I am in a software development class and we are currently building our program using VB (I have no experience in this), and Oracle(currently in a Oracle class so I know how to use Oracle itself just not with VB).
    I am using vb2010 express edition if that helps. Currently I have a stored procedure that takes a 4char "ID" that returns a position (ie, salesperson,manager ect). I want to use the position returned to determine what vb form is displayed (this is acting as a login as you dont want a salesperson accessing the accountants page for payroll ect).
    Here is the code I have currently on the login page of my VB form
    Imports Oracle.DataAccess.Client
    Imports Oracle.DataAccess.Types
    Public Class Login
    Dim conn As New OracleConnection
    Private Sub empID_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles empID.Click
    End Sub
    Private Sub LoginBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginBtn.Click
    conn.ConnectionString = "User ID = Auto" & _
    ";Password = ********" & _
    ";Data Source = XE"
    conn.Open()
    Dim sq1 As String = "Return_Position" 'name of procedure
    Dim cmd As New OracleCommand(sq1, conn)
    cmd.CommandType = CommandType.StoredProcedure
    cmd.Parameters.Add(New OracleParameter("I_EmpID", OracleDbType.Char, 4)).Value = Emp_ID.Text
    Dim dataReader As OracleDataReader = cmd.ExecuteReader
    dataReader.Read()
    Dim position As New ListBox
    position.Items.Add(dataReader.GetString(0)) 'were I am getting an error, I also tried using the dataReader.getstring(0) to store its value in a string but its a no go
    If position.FindStringExact("MANAGER") = "MANAGER" Then
    Me.Hide()
    Dim CallMenu As New Menu()
    CallMenu.ShowDialog()
    End If
    LoginBtn.Enabled = False
    End Sub
    I have read the oracle.net developer guide for using oracle in vb2010 and have successfully gotten through the document however they never use a stored procedure, since the teacher wants this program to user a layered architecture I cannot directly store sql queries like the document does, thus the reason I want to use stored procedures.
    This is getting frustrating getting stuck with this having no background in VB, I could easily do this in c++ using file i/o even through it would be a pain in the rear....

    Hello,
    I am calling Oracle 11g stored procedures from VB.Net 2010. Here is a code sample (based on your code) you should be able to successfully implement in your application.
    Please note that you may have to modify your stored procedure to include an OUT parameter (the employee position) if it doesn't have it yet.
    Private Sub LoginBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginBtn.Click
    Dim sProcedureName As String = "Return_Position" 'name of stored procedure
    Dim ORConn as OracleConnection, sConn as String
    Dim sPosition as String, sDataSource as String, sSchema as String, sPWD as String
    Dim cmd As OracleCommand
    'please provide below sDataSource, sSchema and sPWD in order to connect to your Oracle DB
    sConn = "Data Source=" & sDataSource & ";User Id=" & sSchema & ";Password=" & sPWD & ";"
    ORConn = New OracleConnection(sConn)
    ORConn.Open()
    cmd = New OracleCommand(sProcedureName, ORConn)
    With cmd
    .CommandType = Data.CommandType.StoredProcedure
    'input parameter in your stored procedure is EmpId
    .Parameters.Add("EmpID", OracleDbType.Varchar2).Value = Emp_ID.Text
    .Parameters.Item("EmpID").Direction = ParameterDirection.Input
    'output parameter in your stored procedure is Emp_Position
    .Parameters.Add("Emp_Position", OracleDbType.Varchar2).Direction = ParameterDirection.Output
    .Parameters.Item("Emp_Position").Size = 50 'max number of characters for employee position
    Try
    .ExecuteNonQuery()
    Catch ex As Exception
    MsgBox(ex.Message)
    Exit sub
    End Try
    End With
    sPosition = cmd.Parameters.Item("Emp_Position").Value.ToString
    'close Oracle command
    If Not Cmd Is Nothing Then Cmd.Dispose()
    Cmd = Nothing
    'close Oracle connection
    If Not ORConn Is Nothing Then
    If not ORConn.State = 0 Then
    ORConn.Close()
    End If
    ORConn.Dispose()
    End If
    ORConn = Nothing
    If UCase(sPosition) = "MANAGER" Then
    Me.Hide()
    Dim CallMenu As New Menu()
    CallMenu.ShowDialog()
    End If
    LoginBtn.Enabled = False
    End Sub
    If you need further assistance with the code, please let me know.
    Regards,
    M. R.

  • Reg: Need help to call a Stored Procedure - Out Parameter using DBAdapter

    HI
    I have created a procedure with Out Parameter, using DBAdapater i have invoked it. I have assigned the out parameter also. But while running i am getting this error.
    My Procedure is shown below. It executes successfully when its run in database.
    create or replace
    PROCEDURE SP_QUERY(s_string in varchar2, retCodeString out varchar2)
    AS
    l_sql_stmt varchar2(1000);
    BEGIN
    l_sql_stmt := s_string;
    EXECute immediate l_sql_stmt;
    commit;
    if SQLCODE = 0 then
    retCodeString := 'OK';
    end if;
    END;
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException:
    Client received SOAP Fault from server : Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'ExecuteScript' failed due to:
    Stored procedure invocation error. Error while trying to prepare and execute the SOADEMO.SP_QUERY API.
    An error occurred while preparing and executing the SOADEMO.SP_QUERY API.
    Cause: java.sql.SQLException: ORA-06550: line 1, column 15:
    PLS-00904: insufficient privilege to access object SOADEMO.SP_QUERY ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored Check to ensure that the API is defined in the database and that the parameters match the signature of the API.
    This exception is considered not retriable, likely due to a modelling mistake.
    To classify it as retriable instead add property nonRetriableErrorCodes with value "-6550" to your deployment descriptor (i.e. weblogic-ra.xml).
    To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.
    All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:808) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:384)
    Please help me in this issue.

    Hi
    Right now i geeting the below error
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricException:
    oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist :
    java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
    at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:808) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:384)
    at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:301) 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:597) at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source) at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.
    invoke(MethodExpressionMethodBinding.java:53) at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.
    run(ContextSwitchingComponent.java:92) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.
    UIXInclude.broadcast(UIXInclude.java:102) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361) at oracle.adf.view.rich.component.
    fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.UIXInclude.
    broadcast(UIXInclude.java:96) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475) at javax.faces.component.UIViewRoot.
    processApplication(UIViewRoot.java:756) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889) at
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.
    execute(LifecycleImpl.java:194) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at weblogic.servlet.internal.
    StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.
    invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.sysman.emSDK.license.LicenseFilter.doFilter(LicenseFilter.java:101) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter(MASConnectionFilter.java:41) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.AuditServletFilter.doFilter(AuditServletFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:203) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.model.targetauth.EMLangPrefFilter.doFilter(EMLangPrefFilter.java:158) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.app.perf.PerfFilter.doFilter(PerfFilter.java:141) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:542) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442) at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) Caused by: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricException: oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist : java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:362) at oracle.sysman.emSDK.webservices.wsdlparser.OperationInfoImpl.invokeWithDispatch(OperationInfoImpl.java:1004) at oracle.sysman.emas.model.wsmgt.PortName.invokeOperation(PortName.java:750) at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:802) ... 79 more Caused by: oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : oracle.fabric.common.FabricException: oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist : java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist at oracle.j2ee.ws.client.jaxws.DispatchImpl.throwJAXWSSoapFaultException(DispatchImpl.java:1040) at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:826) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:235) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:106) at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:358) ... 82 more

  • Need Help in with Querying Stored Procedures from UCCX Database

    Hi All
    We are trying to build a custom reporting solution using a BI tool and for which we have provided the ODBC connectivity to the UCCX database to our SQL server.
    We have installed the ODBC drivers on our SQL server and made a connection to UCCX version 10.0 successfully. we are using the username 'uccxhruser' to connect to the DSN.
    We want to query the stored procedure sp_csq_activity from the Microsoft SQL Server Management Studio. When we add the Linked Server in the SQL Server, we are able to see the Data Tables and also query them using the select statement. However, we are not able to see any of the Stored procedures within the Linked Server Tab.
    Can someone guide us in the right direction as to how to go about the process. Is calling the stored proedure the right way or we need to query the individual tables as mentioned in the Database Schema Guide and then once the historical tables our there in our server , then build the report.
    Any help will be much appreciated.
    Regards
    Abhinav

    Hi,
    what happens if you try to execute the above SP? They should be accessible AFAIK.
    G.

  • Plz help me in this stored procedure

    Create a stored procedure called usp_OrderInsert. This stored procedure should accept all field values of the Orders table, including OrderID, as parameters. It should insert an order record into the Orders table.

    It would be helpful if you post the table structure and other details.Anyways please see the below
    create or replace procedure usp_OrderInsert(
    p_OrderID orders.OrderID%TYPE,
    IS
    declaration-
    begin
    Insert into orders (order_id,....)
    values(p_order_id,....);
    commit;
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end;

  • Please help - Can not use stored procedure with CTE and temp table in OLEDB source

    Hi,
       I am going to create a simple package. It has OLEDB source , a Derived transformation and a OLEDB Target database.
    Now, for the OLEDB Source, I have a stored procedure with CTE and there are many temp tables inside it. When I give like EXEC <Procedure name> then I am getting the error like ''The metadata  could not be determined because statement with CTE.......uses
    temp table. 
    Please help me how to resolve this ?

    you write to the temp tables that get created at the time the procedure runs I guess
    Instead do it a staged approach, run Execute SQL to populate them, then pull the data using the source.
    You must set retainsameconnection to TRUE to be able to use the temp tables
    Arthur My Blog

  • Help with running a stored procedure

    Hi, could anybody help me with debugging this stored procedure:
    extraction_date in varchar2
    as
    begin
    execute immediate '
         declare
         /* Output file handler */
         fileHandler UTL_FILE.FILE_TYPE;
         asset_id VARCHAR2(60) := '''';
    cursor c_table is
         SELECT "ASSET ID"
         FROM REUT_MAIN_BOND
         WHERE MATURITY > TO_DATE(' || extraction_date || ', "MM-DD-YYYY");
         row c_table%ROWTYPE;
    begin
    fileHandler := UTL_FILE.FOPEN(''TEMP'', ''northfielddescupdate.in'', ''w'',32000);
         for row in c_table
         loop
         asset_id := row.ASSET;
         UTL_FILE.PUTF(fileHandler, ''asset_id'', ''\n'');
    end loop;
         UTL_FILE.FCLOSE(fileHandler);
    end;';
    commit;     
    end;
    when I run it - SQL> exec create_in_file('08102004')
    it gives me the following errors:
    ERROR at line 1:
    ORA-06550: line 8, column 11:
    PL/SQL: ORA-06553: PLS-103: Encountered the symbol "CALL" when expecting one of
    the following:
    <an identifier> <a double-quoted delimited-identifier>
    ORA-06553: PLS-112: end-of-line in quoted identifier
    ORA-06550: line 7, column 2:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 6, column 8:
    PLS-00341: declaration of cursor 'C_TABLE' is incomplete or malformed
    ORA-06550: line 10, column 5:
    PL/SQL: Item ignored
    ORA-06550: line 15, column 14:
    PLS-00364: loop index variable 'ROW' use is invalid
    ORA-06550: line 15, column 2:
    PL/SQL: Statement ignored
    ORA-06512: at "PETAR_NORTHFIELD.CREATE_IN_FILE", line 6
    ORA-06512: at line 1
    Thank you for your help

    Q #1 (and possibly the only question) - why are you using NDS for this?

  • Help me in this stored procedure

    Create a stored procedure called usp_OrderInsert. This stored procedure should accept all field values of the Orders table, including OrderID, as parameters. It should insert an order record into the Orders table.

    You have the requirements to build the stored procedure, what have you got so far?
    Post your attempt and any errors or issues that you might be experiencing. Writing the whole procedure for you (without the table structure even) is going to be difficult.

  • Help Needed in Xml Stored Procedure

    Hi , i am trying to write one sp which takes xml document as a parameter. I want to update/Insert the data in the xml based on some conditions. So i put the data from xml to a global TEMPORARY table. The i process this data and will update /Insert the data based on the output.
    Right now i am unable to create global TEMPORARY table my stored procedure .When i compile the stored procedure , its showing the following error
    Compilation errors for PROCEDURE SYSTEM.TESTXML
    Error: PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    Line: 8
    Text: CREATE GLOBAL TEMPORARY TABLE temp
    I am attaching my sp below
    create or replace procedure testxml
    ( xmlDoc IN clob )
    is
    updCtx DBMS_XMLStore.ctxType;
    rows NUMBER;
    begin
    CREATE GLOBAL TEMPORARY TABLE temp
    ( cdcalendar NUMBER,
    cdperiod NUMBER,
    cdsubperiod NUMBER,
    cdglperiod NUMBER,
    dtstartsubperiod date,
    dtendsubperiod date
    ) ON COMMIT PRESERVE ROWS;
    updCtx := DBMS_XMLStore.newContext(temp)
    rows := DBMS_XMLStore.insertXML(updCtx,xmlDoc);
    DBMS_XMLStore.closeContext(updCtx);
    if Not exists
    (Select Distinct cd_calendar from Calendar_Period
    Where cd_calendar = select Distinct cdcalendar from temp )
    Then
    Insert into calendar_period
    cd_calendar,
    cd_period,
    cd_subperiod,
    cd_gl_period,
    dt_start_subperiod,
    dt_end_subperiod
    select cdcalendar,
    cdperiod,
    cdsubperiod,
    cdglperiod,
    dtstartsubperiod,
    dtendsubperiod
    from temp ;
    Else
    Update calendar_period
    Set cdp.cd_calendar = temp.cdcalendar ,
    cdp.cd_period = temp.cdperiod,
    cdp.cd_subperiod = temp.cdsubperiod ,
    cdp.cd_gl_period = temp.cdglperiod,
    cdp.dt_start_subperiod = temp.dtstartsubperiod ,
    cdp.dt_end_subperiod = temp.dtendsubperiod
    From
    calendar_period cdp Inner Join temp
    On
    cdp.cd_calendar = temp.cdcalendar
    cdp.cd_subperiod = temp.cdsubperiod
    cdp.cd_period = temp.cdperiod ;
    End if
    end testxml;
    Kindly guide me !!!!

    Hi,
    "CREATE GLOBAL TEMPORARY TABLE" is not a PL/SQL sommand; it is a SQL command. That explain the error message you're getting.
    Normally, tables (including Global Temporary Tables) are created once for all, without using PL/SQL. After they are created, you can write PL/SQL code to populate and use them. This job doies not seem to be an exception.
    In the rare event that you do need to create a table in PL/SQL, use EXECUTE IMMEDIATE, which can do any SQL command from withiin PL/SQL.
    EXECUTE IMMEDIATE is documented in the PL/SQL manual:
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm#sthref857

  • Help: FORMS based on stored procedures

    I am working on a FORM based on stored procedures. This particular FORM performs a query and generates say,
    customer_name, item1_sale, item2_sale and sum of the item1_sale and item2_sale.
    I'd like to know if there are ways that the query procedure returns to reference cursors that one with multiple records and one with the sums? The FORM will then be able to show rows of sales and the bottom row with show the sale totals.
    Thank you in advance.
    Jimmy

    Francois,
    I just tried another way of getting the totals. I manually created a data block and add two items tot_1 and tot_2. I the item properties: I set calculation:
    calculation Mode: Summary
    Summary Function: Sum
    Sumary Block: BLOCK_A
    Summary Item: item1_sale etc.,
    I got a compile error:
    FRM-30377: Summary item must reside in single-record block or in same block as summarized item.
    Where do I catch this error?
    Thanks.
    Jimmy

  • Help writing a simple stored procedure

    Hello, all:
    I have normally done fine writing functional anonymous procedures, but I want to tighten up my trade a little. I have been looking through my PL/SQL book and the examples are too simple for the creation of a stored procedure along these lines:
    create or replace procedure convertPIDM( iv_PIDM number)
    is
    v_PIDM number;
    v_Banner_ID varchar2;
    v_first_name varchar2;
    v_first_name varchar2;
    begin
    /* select spriden_id, spriden_first_name, spriden_last_name from spriden */
    select spriden_id into v_Banner_ID from spriden
    where spriden_pidm = iv_PIDM
    and spriden_change_ind is null;
    DBMS_OUTPUT.put_line('Banner ID: ' || v_Banner_ID );
    end;
    I am getting a "Warning: compiled but with compilation errors." I don't understand why. Could someone point the issue out to me, please.
    Thank you.

    Okay, the answer almost bit me. I forget to add the size (ranges) to the varchar2.
    create or replace procedure convertPIDM( iv_PIDM number)
    is
    v_PIDM number;
    v_Banner_ID varchar2(8);
    v_first_name varchar2(30);
    v_first_name varchar2(30);
    begin
    --select spriden_id, spriden_first_name, spriden_last_name from spriden
    select spriden_id into v_Banner_ID from spriden
    where spriden_pidm = iv_PIDM
    and spriden_change_ind is null;
    DBMS_OUTPUT.put_line('Banner ID: ' || v_Banner_ID );
    end;
    show errors

  • Help - loadjava command for Stored Procedures

    Hello,
    I'm trying to load a java class onto Oracle 8i. When I use the
    loadjava command I get an error as follows:
    C:\project>loadjava -user student/learn -resolve -force
    StoredProcedures.class
    The system cannot find the path specified.
    I assume my environment variables are off. Does anyone know how
    to correct this? Thanks for your help!!

    Here is the command we use:
    loadjava -u userid/password@HOST:PORT:SID -t -v -r
    javaclasses.zip
    Linda

  • Help required in Stored Pocedure

    I have a table as follows:
    -- INSERTING into TABLE1
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',16890657,'Deposit',to_timestamp('29-DEC-07 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),33000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',14500579,'Deposit',to_timestamp('31-DEC-07 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),49000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',14500577,'Deposit',to_timestamp('31-DEC-07 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),25000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',14500578,'Deposit',to_timestamp('31-DEC-07 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),48500);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923202,'Deposit',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),2500);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923203,'Deposit',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),2500);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923204,'Deposit',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),3000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923205,'Deposit',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),3000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923206,'Deposit',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),5000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923207,'Deposit',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),15500);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923208,'Deposit',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),18734);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923209,'Withdrawal',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),80646.75);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',6923210,'Withdrawal',to_timestamp('01-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),87314);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7163769,'Withdrawal',to_timestamp('02-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),31875);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7163770,'Withdrawal',to_timestamp('02-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),33878);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7532700,'Deposit',to_timestamp('04-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),20000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7532701,'Withdrawal',to_timestamp('04-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),9140);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7845450,'Deposit',to_timestamp('05-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),2550);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7845451,'Deposit',to_timestamp('05-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),15000);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7845452,'Withdrawal',to_timestamp('05-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),11966);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',7845453,'Withdrawal',to_timestamp('05-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),20564);
    Insert into TABLE1 (ACCOUNT_ID,TRANSACTION_REFERENCE_NUMBER,TRANSACTION_TYPE,TRANSACTION_DATE_TIME,TRANSACTION_AMOUNT) values ('112011012045',8308095,'Deposit',to_timestamp('07-JAN-08 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),9000);I want a stored procedure which will give me the values for the past 7 days transactions, for each transaction.. as comma seperated values... I want this for each transaction in the table.
    i.e., if i take the reference number, 6923202 ,
    Deposit txns for past 7 days including the current txn will be - 26Dec, 27Dec, 28Dec, 29Dec, 30Dec, 31Dec, 1Jan
    So the values will be                -0,0,0,1,0,3,1
    Similarly Amounts will be            -0,0,0,33000,0,122500,2500
    Now if i take the next reference number, 6923203
    Deposit txns for past 7 days including the current txn will be - 26Dec, 27Dec, 28Dec, 29Dec, 30Dec, 31Dec, 1Jan
    So the values will be                -0,0,0,1,0,3,2
    Similarly Amounts will be            -0,0,0,33000,0,122500,5000
    Now if i take the next reference number, 7532700
    Deposit txns for past 7 days including the current txn will be - 29Dec, 30Dec, 31Dec, 1Jan, 2Jan, 3Jan, 4Jan
    So the values will be                -1,0,3,7,0,0,1
    Similarly Amounts will be            -33000,0,122500,50234,0,0,20000
    Note that i am considering only Deposit txns..I want similar to be done for withdrawal txns also..I want to insert into Table2 values like this:
    Insert into Table2 (Account_id, Transaction_reference_number, Deposit_Count, Deposit_Amount) values ('112011012045',6923202,'0,0,0,1,0,3,1','0,0,0,33000,0,122500,2500');
    Insert into Table2 (Account_id, Transaction_reference_number, Deposit_Count, Deposit_Amount) values ('112011012045',6923203,'0,0,0,1,0,3,2','0,0,0,33000,0,122500,5000');
    Insert into Table2 (Account_id, Transaction_reference_number, Deposit_Count, Deposit_Amount) values ('112011012045',7532700,'1,0,3,7,0,0,1','33000,0,122500,50234,0,0,20000');
    At that point of transaction, what are the last 7 days transactions need to be inserted..I want this to be calculated for each Account_id in Table1..right now, this sample data is having only one Account_id..If it has many account_ids, then for each transaction of each account_id, i want data to be inserted into Table2 as the way shown in example..
    Can anybody help me in writing stored procedure for this..Please...

    Well here's a query that will do the necessary hard work, you just need to incorporate that for yourself in a procedure or whatever you want to do with it...
    SQL> select * from table1;
    ACCOUNT_ID           TRANSACTION_REFERENCE_NUMBER TRANSACTION_TYPE
    TRANSACTION_DATE_TIME                                                       TRANSACTION_AMOUNT
    112011012045                             16890657 Deposit
    29-DEC-07 00.00.00.000000                                                                33000
    112011012045                             14500579 Deposit
    31-DEC-07 00.00.00.000000                                                                49000
    112011012045                             14500577 Deposit
    31-DEC-07 00.00.00.000000                                                                25000
    112011012045                             14500578 Deposit
    31-DEC-07 00.00.00.000000                                                                48500
    112011012045                              6923202 Deposit
    01-JAN-08 00.00.00.000000                                                                 2500
    112011012045                              6923203 Deposit
    01-JAN-08 00.00.00.000000                                                                 2500
    112011012045                              6923204 Deposit
    01-JAN-08 00.00.00.000000                                                                 3000
    112011012045                              6923205 Deposit
    01-JAN-08 00.00.00.000000                                                                 3000
    112011012045                              6923206 Deposit
    01-JAN-08 00.00.00.000000                                                                 5000
    112011012045                              6923207 Deposit
    01-JAN-08 00.00.00.000000                                                                15500
    112011012045                              6923208 Deposit
    01-JAN-08 00.00.00.000000                                                                18734
    112011012045                              6923209 Withdrawal
    01-JAN-08 00.00.00.000000                                                             80646.75
    112011012045                              6923210 Withdrawal
    01-JAN-08 00.00.00.000000                                                                87314
    112011012045                              7163769 Withdrawal
    02-JAN-08 00.00.00.000000                                                                31875
    112011012045                              7163770 Withdrawal
    02-JAN-08 00.00.00.000000                                                                33878
    112011012045                              7532700 Deposit
    04-JAN-08 00.00.00.000000                                                                20000
    112011012045                              7532701 Withdrawal
    04-JAN-08 00.00.00.000000                                                                 9140
    112011012045                              7845450 Deposit
    05-JAN-08 00.00.00.000000                                                                 2550
    112011012045                              7845451 Deposit
    05-JAN-08 00.00.00.000000                                                                15000
    112011012045                              7845452 Withdrawal
    05-JAN-08 00.00.00.000000                                                                11966
    112011012045                              7845453 Withdrawal
    05-JAN-08 00.00.00.000000                                                                20564
    112011012045                              8308095 Deposit
    07-JAN-08 00.00.00.000000                                                                 9000
    22 rows selected.
    SQL> with rn as (select 6923202 as rn from dual)
      2      ,p7 as (select cast(transaction_date_time as DATE) - (rownum-1) dt
      3              from (select * from table1, rn where transaction_reference_number = rn.rn)
      4                   ,rn
      5              connect by rownum <= 7)
      6  --
      7  select dt
      8        ,ltrim(sys_connect_by_path(cnt,','),',') as cnt
      9        ,ltrim(sys_connect_by_path(nvl(sm,0),','),',') as sm
    10  from (
    11    select p7.dt, sum(decode(transaction_amount,null,0,1)) cnt, sum(transaction_amount) sm
    12    from p7 left outer join table1 on (trunc(cast(table1.transaction_date_time as date)) = p7.dt AND table1.transaction_type = 'Deposit')
    13    group by p7.dt
    14    )
    15  where connect_by_isleaf = 1
    16  connect by dt = prior dt + 1
    17  start with dt = (select min(dt) from p7)
    18  order by dt
    19  /
    DT        CNT                            SM
    01-JAN-08 0,0,0,1,0,3,7                  0,0,0,33000,0,122500,50234
    SQL>

Maybe you are looking for

  • Sharepoint Foundation 2010 / IE11 Error when loading aspx page

    Sharepoint 2010 throws an error anytime a user tries to access a specific page (instead of the main URL share.domain.com) through IE11. Chrome appears to be uneffected. It's driving me crazy trying to figure it out. It's also effecting One Note as we

  • Extended Withholding tax in VIM

    Hi , We are EHP 6 and we are implementing Open Tax for our new company code Philippines .  We have activated EXTENDED WITHHOLDING TAX " functionality in SAP and want to use same in Open text . We are using VIM 6 . Can you please help us on this? how

  • Frequently changing label printing requirements

    hello there, business scenario  ; labels required for shipments, keep changing frequently and going forward  this needs to be done in SAP. does anyone know how to address this issue ???

  • ITunes 11.1.4.62 will not install correctly after deleting the previous version

    After being insessantly nagged to install the latest version of iTunes (11.1.4.62) I atempted to do so.  I refuses to install correctly citing a problem with the remote device installer (?).  Can I install the previous version?  How do I get it?

  • PEAP EAP-MSCHAP and Novell(NDS)

    We have several 350/1220/1131 ap's and would like to implement a 802.1x solution. We have a ACS 4.0 and are running Novell(NDS) as userdatabase. As far as I have understood, PEAP MSCHAP only support Microsoft databases, and only EAP-GTC can be used w