Store Procedure execution using dataset

hi friends
can anybody tell me how to execute oracle stored procedure using dataset in C#
Thnx
Monika

Double post?
execute store Procedure in Oracle

Similar Messages

  • How to set store procedure parameters

    Hello,
    To summarize our problem, we are not able to set store procedure parameters using JRC and without using a Viewer.
    Inside an rpt document we use a call to a store procedure that requires some input parameters.
    We attempted to pass the required parameters to the report (please see below) but it seems that those parameters are somehow ignored.
    In fact null values are always received by the store procedure.
    For your information, if the document doesnu2019t contain a call to a store proc but SQL clause parameters instead, then that works.
    Does that mean that sp parameters have to be set in a specific way?
    Please can you advise?
    Tanks a lot,
    Joseph
    This is how we set parameter values:
    private void handleParameters(ReportClientDocument pm_document, List pm_parameters) throws Exception
         ParameterFieldController pfc = pm_document.getDataDefController().getParameterFieldController();
         pfc.setCurrentValue(reportName, parameterFieldName, parameterValue);
    Then we export in a pdf file:
    private InputStream createInputStream(ReportClientDocument pm_document, String pm_reportName) throws Exception
         return (ByteArrayInputStream)pm_document.getPrintOutputController().export(ReportExportFormat.PDF);

    First question:
    Do you set the parameters before the database logon?
    Sincerely,
    Ted Ueda

  • Sys.sql_Module does not give full defination of store procedure

    I want to get a defination of a store procedure by using sys.sql_Module
    Beflow is the query i use 
    SELECT  
    @spTxt =ISNULL(smsp.definition, ssmsp.definition)) 
    FROM sys.all_objects AS sp
    LEFT OUTER JOIN sys.sql_modules AS smsp ON smsp.object_id = sp.object_id
    LEFT OUTER JOIN sys.system_sql_modules AS ssmsp ON ssmsp.object_id = sp.object_id
    WHERE (sp.type = N'P' OR sp.type = N'RF' OR sp.type='PC')and(sp.name=@SpName 
    and SCHEMA_NAME(sp.schema_id)=@SchemaName)
    @SchemaName = SCHEMA 
    ANd @SpName = Store procedure Name.
    This query does not give me complete store procedure.
    Is there any other table i need to join and I can get full defination?
    Thank you.
    BM19.23

    You're confusing what's being stored vs what's being displayed. The full proc is being stored in the definition column. It's just that SSMS won't display the full content of the cell.
    The following is a proc that we use to overcome this situation... (I have no clue who the original author is)
    CREATE PROCEDURE [dbo].[LongPrint]
    @String NVARCHAR(MAX)
    AS
    Example:
    exec LongPrint @string =
    'This String
    Exists to test
    the system.'
    /* This procedure is designed to overcome the limitation
    in the SQL print command that causes it to truncate strings
    longer than 8000 characters (4000 for nvarchar).
    It will print the text passed to it in substrings smaller than 4000
    characters. If there are carriage returns (CRs) or new lines (NLs in the text),
    it will break up the substrings at the carriage returns and the
    printed version will exactly reflect the string passed.
    If there are insufficient line breaks in the text, it will
    print it out in blocks of 4000 characters with an extra carriage
    return at that point.
    If it is passed a null value, it will do virtually nothing.
    NOTE: This is substantially slower than a simple print, so should only be used
    when actually needed.
    DECLARE @CurrentEnd BIGINT, /* track the length of the next substring */
    @offset TINYINT /*tracks the amount of offset needed */
    SET @string = REPLACE( REPLACE(@string, CHAR(13) + CHAR(10), CHAR(10)) , CHAR(13), CHAR(10))
    WHILE LEN(@String) > 1
    BEGIN
    IF CHARINDEX(CHAR(10), @String) BETWEEN 1 AND 4000
    BEGIN
    SET @CurrentEnd = CHARINDEX(CHAR(10), @String) -1
    SET @offset = 2
    END
    ELSE
    BEGIN
    SET @CurrentEnd = 4000
    SET @offset = 1
    END
    PRINT SUBSTRING(@String, 1, @CurrentEnd)
    SET @string = SUBSTRING(@String, @CurrentEnd+@offset, 1073741822)
    END /*End While loop*/
    GO
    To use the proc, you'd do something like this...
    DECLARE @sql VARCHAR(MAX)
    SELECT @sql = sm.definition FROM sys.sql_modules sm WHERE sm.object_id = 892230629
    EXEC dbo.LongPrint @sql
    HTH,
    Jason
    Jason Long

  • I want to know the top 10-20 Store procedures used in the table.

    Hello All, 
    There are total 3500+ Store procedures created in the server. So,  I want to know the top 10-20 Store procedures used in the table. Like which store procedures are important and what are they, is there any code to find them? 
    I think the question might be very silly, but i don't know which store procedure to look at it. 
    Please help me on this issue.
    Thanks.
    Thanks, Shyam.

    By what? CPU? Memory? Execution count?
    Glenn Berry wrote this
    -- HIGH CPU ************
          -- Get Top 100 executed SP's ordered by execution count
          SELECT TOP 100 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count',  
          qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()) AS 'Calls/Second',
          qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
          qs.total_worker_time AS 'TotalWorkerTime',
          qs.total_elapsed_time/qs.execution_count AS 'AvgElapsedTime',
          qs.max_logical_reads, qs.max_logical_writes, qs.total_physical_reads, 
          DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
          FROM sys.dm_exec_query_stats AS qs
          CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
          WHERE qt.dbid = db_id() -- Filter by current database
          ORDER BY qs.execution_count DESC
          -- HIGH CPU *************
          -- Get Top 20 executed SP's ordered by total worker time (CPU pressure)
          SELECT TOP 20 qt.text AS 'SP Name', qs.total_worker_time AS 'TotalWorkerTime', 
          qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
          qs.execution_count AS 'Execution Count', 
          ISNULL(qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()), 0) AS 'Calls/Second',
          ISNULL(qs.total_elapsed_time/qs.execution_count, 0) AS 'AvgElapsedTime', 
          qs.max_logical_reads, qs.max_logical_writes, 
          DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
          FROM sys.dm_exec_query_stats AS qs
          CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
          WHERE qt.dbid = db_id() -- Filter by current database
          ORDER BY qs.total_worker_time DESC
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000

    Post Author: ltkin
    CA Forum: WebIntelligence Reporting
    Hi,
    How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
    Regards,

    Hi ltkin,
    Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
    Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
    Please let me know if the above information helps.
    Regards,
    Pavan

  • Which is better to use Store Procedure or Views in Crystal Reports ?

    Hi,
    which one is more better to use Store Procedure or Views in Crystal Reports ?
    Thanks.

    It depeneds on the requirement. Well, but from performance point of view as u know that stored procedures are already compiled on DB side, they would be more efficient. Views are handled differently. Here CR has nothing to do with it.
    But if the stored procedure u r using is having 2 Select statements, CR will only display the results from the first select statement. In that case you need to use Views as one can use more than one views in the report and join them.
    Using a Generic view which is created by the DBA for a larger audience will result in performance issues meaning if a View "V" has 25 fields and View is based on 5 tables  and ur report is using only 5 fields which are coming only from 2 tables inside the view,in this case u will end up in joining 3 more tables unnecessarily.
    Hope this helps!

  • How to load and define Java Store Procedures using Consolidator Manager??

    Hi,
    I am trying to create a store procedure with a very easy example and I can not succeed. i am a bit new with OLite and I will appreciate any help from your side. I am quite lost now regarding of using java with OLite and it is becoming quite urgent for me. Thanks a lot in advanced.
    Those are the steps that I follow:
    - Creating the java class
    I create the java file MYUPPER.java with next code :
    public class MYUPPER {
    public static String doUpper( String p_text )
    return p_text.toUpperCase();
    I compile it and I create the jar file:
    C:\>javac MYUPPER.java
    C:\>jar cf MYUPPER.jar MYUPPER.class
    - This is an abstract of my java code using the API:
    ( m_cm is ConsolidatorManager)
    // Create the java resource
    m_cm.createStoredProc( "MYUPPER.jar", "MYUPPER", "doUpper", "doUpper");
    // Add it to the publication
    m_cm.addJavaResource( "PMTS", "MYUPPER" );
    - After running that code I do not receive any exception and checking into the repository looks ok:
    a) From the Mobile Server I can see the Java Ressource MYUPPER for that publication
    b) I can see the entries in C$Resouces and in C$Pub_Objects as well
    *** ON THE CLIENT:
    Then I go to the client device a Windows XP labtop where I did install the jre 5.0 and I added the bin path to the system variable PATH.
    - I get a POL-8000 error when synchronizing (could not start the Java Visrtual Machine)
    - Anyway, I can see the MYUPPER.class file deployed in the same directory than the databases are.
    - I have also tried next from msql:
    c:\>msql system/manager@jdbc:polite:tomeu_conscli
    Oracle Lite MSQL Version 10.3.0.2.0
    Copyright (c) 1997, 2008, Oracle. All rights reserved.
    Connected to: Oracle Lite ORDBMS
    Database Name: CONSCLI (Read Write)
    Database Version: 10.3.0.2.0
    Auto Commit: off
    Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
    SQL> select * from c$resources;
    PUB_NAME | DB_NAME | RESOURCE_NAME | RESOURCE_TYPE | RESOURCE_DATA
    PMTS | pmts | MYUPPER | JAVA CLASS | -¦¦¥ 1
    1 row(s) returned
    SQL>
    SQL> exit
    Disconnected from CONSCLI
    c:\>msql system/*****@jdbc:polite:tomeu_pmts
    Oracle Lite MSQL Version 10.3.0.2.0
    Copyright (c) 1997, 2008, Oracle. All rights reserved.
    Connected to: Oracle Lite ORDBMS
    Database Name: PMTS (Read Write)
    Database Version: 10.3.0.2.0
    Auto Commit: off
    Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
    SQL> select doUpper('fhjdjf') from dual;
    [POL-8035] no such attribute or method
    SQL> create table sp (id number(1) primary key );
    Table created
    SQL> alter table sp attach java source "MYUPPER" in '.';
    [POL-8028] error in calling a Java method
    SQL> commit;
    Commit complete
    SQL> select sp.doUpper('fhjdjf') from dual;
    [POL-8035] no such attribute or method
    Lost... :(
    Tomeu

    sorry to bother, similar like above, i tried many times on my computer to load a simple image in java application.. here's my code:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    public class View extends JFrame {
         private URL imageURL;
         private File file;
         private Image sourceImage;
         private String name, title, message;
         private int width, height;
        public static void main(String[] args) {
            System.out.println( "Hello Eros!!!" );
            View img = new View();
        public View() {
             name = "D:/shared/inputpic.gif";
             file = new File( name );
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            try {
                imageURL = new URL("http://www.google.com.my/images/logo_sm.gif" );
            } catch (MalformedURLException e) {
            if ( file == null ) {
                sourceImage = Toolkit.getDefaultToolkit().getImage( name );
                System.out.println( file );
            } else {
                sourceImage = toolkit.getImage( imageURL );
                System.out.println( file );
            width = sourceImage.getWidth( this );
            height = sourceImage.getHeight( this );
            System.out.println( "Pixel = " + width + "x" + height );
            if ( width * height == 1 ) {
                title = "Greetings";  // Shown in title bar of dialog box.
                if ( file == null ) {
                    message = "Unable to load the file " + name;
                } else {
                    message = "Unable to load the link " + imageURL;
                JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE);
    }could anyone test this n give my the reason i couldnt even load the image

  • Insert and update same record of table using store procedure in oracle 10g

    Hi,
    I am using oracle sql developer for this.
    I have created Store procedure which run after every 30mins of interval.
    the problem is Ii need to insert data for first time of day then later that same record should update for particular field(here its plan code).
    if new field is coming (if new plan code is generated) then it should insert data and again update same for interval.
    means for each plan individual record(i.e. plan wise summary) should be there for only a day. next day new record for same plan.

    Hi,
    You should use Merge like shown below:-
    Merge into original_table a
    using second_table b
    on (a.primary_key=b.primary_key and a.primary_key........)
    when match then
    update set column_list=b.column_list
    when not match then
    isert into (column list)
    values(a.column_list)If you dont know much about merge then follow below link..
    http://www.oracle-developer.net/display.php?id=203
    http://www.oracle-base.com/articles/10g/merge-enhancements-10g.php

  • Problem of retrieve a set of data when calling store procedure using vb with ODBC

    when I use ODBC, it can return 1 record (1 field) using pass and retrieve the parameter. but it cannot success when return a set of data (using recordset to store it), when i do it, the error message (Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if availabl. No work was done.). Why ? and how can solve it ?\
    Thanks in advance.

    oh, really ? it is not use ODBC to connecto to oracle ?
    Here is my program code:
    STORE PROCEDURE:
    PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
    IS
    BEGIN
    OPEN BasicCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
    OPEN RiderCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
    END getInforcePolicy;
    PACKAGE oraoledb AS
    TYPE m_refcur IS REF CURSOR;
    END oraoledb;
    Program:
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    Dim cmd As New ADODB.Command
    Dim paramclient As New ADODB.Parameter
    Dim parampolicy As New ADODB.Parameter
    Dim I As Integer
    cn.Open "ridev", "abc","abc"
    cmd.ActiveConnection = cn
    Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
    Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
    paramclient.Value = "0000023011"
    parampolicy.Value = "HK0010021U"
    cmd.Parameters.Append paramclient
    cmd.Parameters.Append parampolicy
    cmd.CommandText = "{call getInforcePolicy}"
    Set rs = cmd.Execute
    Do While Not rs.EOF
    Loop
    Set rs2 = rs.NextRecordset
    Do While Not rs2.EOF
    loop
    Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE"

  • Deski report which is using a Store Procedure - Redirecting connection

    I have a DeskI report which is using a Store Procedure as its data provider.
    This is an Oracle based Store Procedure.
    Where can i see wich connection (connections listed in CMC) is used in DeskI report ?
    How can i redirect one connection to point to another on report?
    Thanks
    Georg

    Marina,
    The strategy for displaying LOV via Infoview needs to be different than what you've set up via DeskI.  The main difference is that when using a client/server program like DeskI, the LOV is cached to the client, thus producing a list more quickly, however, over the web, the web client does not cache LOV as readily.  To "solve" this "problem" you need to go back to your universe and trace what is happening.  If the LOV is getting generated through an essential "select distinct" on the fact/dimension table, and that table has over a million rows, then it will take some time to generate the list (and thus will timeout).  A different strategy to take is to maintain a "backend lookup" table that the LOV will point to instead.  The backend lookup table will contain the unique instances of the column getting scanned and thus when the LOV points to the new lookup table the response will be quicker versus the old method.  Care must be taken each time new data is loaded to WH to ensure that any new unique values from the "home" table/column are also placed in the backend lookup table.
    thanks,
    John

  • Need help on processing XML doc using Java store procedure

    I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
    --createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
    Thank you in advance if anyone can give some hints.

    I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
    --createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
    Thank you in advance if anyone can give some hints.

  • Issue with a stored procedure that uses a sys refcursor to output dataset..

    Hi All:
    I create a stored procedure that uses an in out sys ref cursor:
    create or replace procedure FIRE_SALES_100_CALLS_REPORT
    ( p_cursor in out sys_refcursor)
    IS
    BEGIN
    --Insert into the temp table the records for the rep sales
    EXECUTE IMMEDIATE '
    INSERT INTO TMP_SALES_CNT_BY_USER
    TOTALPRODUCTSSOLD,
    NUMBEROFCALLS,
    SALESPER100CALLS,
    SERVICEORDERNUM,
    PRODUCT,
    LOGIN,
    FST_NAME,
    LAST_NAME,
    NAME,
    POSITIONHELD,
    CURRENTPARPARTYID,
    QUERY_DATE,
    CREATED_BY
    SELECT e.TotalProductsSold,
    e.NumberOfCalls,
    ((e.TotalProductsSold/e.NumberOfCalls)*100) AS SalesPer100Calls,
    e.ServiceOrderNum,
    e.Product,
    e.login,
    e.fst_name,
    e.last_name,
    e.name,
    e.PositionHeld,
    e.CurrentParPartyID,
    e.query_date,
    e.created_by
    FROM (
    SELECT COUNT(o.order_num) over ( partition by u.login
    order by u.login) AS TotalProductsSold,
    SUM(NVL(x.n_inbound,1) + NVL(x.n_outbound,1)) over (partition by u.login
    order by u.login) AS NumberOfCalls,
    o.order_num AS ServiceOrderNum,
    pi.name as Product,
    u.login,
    c.fst_name,
    c.last_name,
    postn.name,
    c.pr_held_postn_id as PositionHeld,
    p.par_party_id as CurrentParPartyID,
    NVL(x.query_date,NVL(o.last_upd, null)) AS query_date,
    o.created_by
    FROM firestg.SEB_S_order o
    INNER join firestg.seb_s_order_item oi ON o.row_id = oi.order_id
    INNER join firestg.seb_s_prod_int pi ON oi.prod_id = pi.row_id
    INNER join firestg.SEB_s_contact c on c.Row_Id = o.created_by
    INNER join firestg.SEB_s_user u on u.row_id = o.created_By
    INNER join firestg.SEB_s_party p on p.row_id = c.pr_held_postn_id
    INNER join firestg.SEB_s_postn postn on postn.row_id = c.pr_held_postn_id
    LEFT OUTER JOIN (
    SELECT taw.QUERY_DATE,
    vaw.n_inbound,
    vaw.n_outbound,
    oaw.object_name, oaw.object_id
    FROM GEN_T_AGENT_WEEK taw
    INNER JOIN GEN_V_AGENT_WEEK vaw ON taw.time_key = vaw.time_key
    INNER JOIN GEN_O_AGENT_WEEK oaw ON oaw.object_id = vaw.object_id) x
    ON u.cti_acd_userid = x.object_name
    WHERE NVL(x.query_date,NVL(o.last_upd, null)) BETWEEN (TRUNC (next_day (sysdate, ''SUN''))-14)
    AND (TRUNC (next_day (sysdate, ''SUN''))-8)
    AND o.status_cd IN (''Complete''))e';
    --Lookup the first level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_1ST, LOGIN_1ST,FST_NAME_1ST,LST_NAME_1ST,TITLE_1ST) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.currentparpartyid)
    WHERE CurrentParPartyID IS NOT NULL';
    --Lookup the second level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_2ND, LOGIN_2ND,FST_NAME_2ND,LST_NAME_2ND,TITLE_2ND) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_1ST)
    WHERE a.ParPartyID_1ST IS NOT NULL';
    --Lookup the third level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_3RD, LOGIN_3RD,FST_NAME_3RD,LST_NAME_3RD,TITLE_3RD) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_2ND)
    WHERE a.ParPartyID_2ND IS NOT NULL';
    --Lookup the fourth level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_4TH, LOGIN_4TH,FST_NAME_4TH,LST_NAME_4TH,TITLE_4TH) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_3RD)
    WHERE a.ParPartyID_3RD IS NOT NULL';
    --Lookup the fifth level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_5TH, LOGIN_5TH,FST_NAME_5TH,LST_NAME_5TH,TITLE_5TH) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_4TH)
    WHERE a.ParPartyID_4TH IS NOT NULL';
    -- If there was no 1st place then the rep is a VP
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.last_name || '', '' || a.fst_name,
    a.vp_login = a.login
    WHERE a.login_1st IS NULL';
    --If there is no second place then the rep has a VP and is a Director
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.vp_login = a.login_1st,
    a.director = a.last_name || '', '' || a.fst_name,
    a.director_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NULL';
    --IF there is no third place then the rep has a VP, Director & is a Manager
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.vp_login = a.login_2ND,
    a.director = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.director_login = a.login_1st,
    a.manager = a.last_name || '', '' || a.fst_name,
    a.manager_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NULL';
    --If there is no fourth place then the rep has a VP, Dir, Manager, and is a Supervisor
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_3RD || '', '' || a.fst_name_3RD,
    a.vp_login = a.login_3RD,
    a.director = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.director_login = a.login_2ND,
    a.manager = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.manager_login = a.login_1st,
    a.supervisor = a.last_name || '', '' || a.fst_name,
    a.supervisor_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NOT NULL
    AND a.login_4th IS NULL';
    --If there is no fifth plance then the rep has a VP, Dir, Mgr, Supervisor, and is a Team Lead
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_4TH || '', '' || a.fst_name_4TH,
    a.vp_login = a.login_4TH,
    a.director = a.lst_name_3RD || '', '' || a.fst_name_3RD,
    a.director_login = a.login_3RD,
    a.manager = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.manager_login = a.login_2ND,
    a.supervisor = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.supervisor_login = a.login_1st,
    a.teamlead = a.last_name || '', '' || a.fst_name,
    a.teamlead_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NOT NULL
    AND a.login_4th IS NOT NULL
    AND a.login_5th IS NULL';
    --If there is a fifth place then the rep has a VP, Dir, Mgr, Supervisor, Team Lead and is a rep
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_5TH || '', '' || a.fst_name_5TH,
    a.vp_login = a.login_5TH,
    a.director = a.lst_name_4TH || '', '' || a.fst_name_4TH,
    a.director_login = a.login_4TH,
    a.manager = a.lst_name_3RD || '', '' || a.fst_name_3RD,
    a.manager_login = a.login_3RD,
    a.supervisor = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.supervisor_login = a.login_2ND,
    a.teamlead = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.teamlead_login = a.login_1st
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NOT NULL
    AND a.login_4th IS NOT NULL
    AND a.login_5th IS NOT NULL';
    open p_cursor for
    SELECT tsc.vp,
    tsc.director,
    tsc.manager,
    tsc.supervisor,
    tsc.teamlead,
    (tsc.last_name || ', ' || tsc.fst_name) AS Rep,
    tsc.product,
    tsc.totalproductssold,
    tsc.numberofcalls,
    tsc.salesper100calls
    FROM TMP_SALES_CNT_BY_USER tsc;
    END FIRE_SALES_100_CALLS_REPORT;
    The table I use is a Global temp table.
    This runs just fine in oracle but when I try to build a data foundation in Business Objects I get the error that says you cannot insert/update/delete in a READ ONLY Transaction.
    I really need some advice on what to do since I really dont have access to a scheduled script and table that would store my data ahead of time.

    Well, AFAIK, BO is a reporting tool, so it si read-only by nature. I do not know if it possible to "tell" BO table is GTT and it is OK to write to it. You need to post this in BO forum.
    SY.

  • How to pass xml data as objects into Database using store procedures

    Hi All,
         I don't have much knowledge on store procedure,can anybody help how to pass the xml as objects in Database using store procedure.
    My Requirement is I have a table with three fields EMPLOYEE is table name and the fields are EMP_ID,EMP_TYPE AND EMP_DET,I have to insert the employees xml data into corresponding fields in the table.
    Input Data
    <ROWSET>
       <ROW>
         <EMP_ID>7000</EMP_ID>
          <EMP_TYPE>TYPE1</EMP_TYPE>
         <EMP_DET>DEP</EMP_DET>
      <ROW>
      <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE2</EMP_TYPE>
        <EMP_DET>DEP2</EMP_DET>
    <ROW>
    <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE3</EMP_TYPE>
        <EMP_DET>DEP3</EMP_DET>
    <ROW>
    <ROWSET>
    So each row values has to inserted into resp fields in the table.
    Regards
    Mani

    Do you have a similar structure in your stored procedure ?
    In that case you can simply call the procedure from soa using db adapter and do a mapping to assign the values.

  • ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?

    ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?
    I have a store procedure:
    CREATE OR REPLACE PACKAGE BODY PK_HR1
    IS
    FUNCTION FUNC04
    RETURN CUR_RESULT
    IS
    X_CUR CUR_RESULT;
    BEGIN
    OPEN X_CUR FOR
    select mako, tenko, diachiko from kho;
    RETURN X_CUR;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE;
    END FUNC04;
    END PK_HR1;
    In the entities class, I have a NamedStoredProcedureQuery:
    @Entity
    @NamedStoredProcedureQuery(name="Kho.FUNC04",
              resultClass=Kho.class,
              procedureName="PK_HR1.FUNC04" )
    public class Kho implements Serializable {
    In session bean, i have a method
    public class SessionEJBBean implements SessionEJB, SessionEJBLocal
    public void test() throws Exception{
    try {
    //code here ...
    List<Kho> listKho = em.createNamedQuery("Kho.FUNC04").getResultList();
    System.out.println("aaaa");
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    I try running, but always show errror
    this errors:
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00221: 'FUNC04' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call: BEGIN PK_HR1.FUNC04(); END;
    Query: ReadAllQuery(jp.co.mfr.sgs.bean.Kho)
    help help me?

    You need to use a CallableStatement for this.
    --olaf                                                                                                                                                                                                           

  • Using store procedures with SQLJ - please help!

    I have two questions:
    1.I wrote simple test appllication that uses SQLJ to run store
    procedures from SQL package. It compiles and work fine from
    JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
    It compiles OK in regular JDK1.2.2 but raise the following
    exception when running:
    profile
    com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0 not
    found: java.io.InvalidClassException: [Ljava.lang.Object;;
    Serializable is incompatible with Externalizable
    Does it mean that I have to use JDeveloper JDK?
    2.When I give other then default package for *.sqlj file the
    *.sqlj file is added to project but I cannot see it in specified
    package (the *.sqlj file is created in the its directory).
    After I compile the project the I can see *.java file in the
    specified package, but compiler gives errors about redefined
    symbols. If I remove *.sqlj file from the project it compiles OK.
    What I am doing wrong?
    Yakov Becker
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thank you for the response.
    I don't create jar file. I run it from JDeveloper environment.
    What do you mean by "I made sure to also copy over the
    : the .ser file"? What purpose of the *.ser file in this case?
    Yakov
    JDeveloper Team (guest) wrote:
    : I have come across this error before..
    : I'm assuming that your jar file is in the classpath as
    : specified in the Jserv configuration?
    : When I had the error, I made sure to also copy over the
    : the .ser file.
    : In my case, I happened to have both my class files and
    : the .ser file outside of a jar file and it worked..
    : Hope this helps!
    : Yakov Becker (guest) wrote:
    : : I have two questions:
    : : 1.I wrote simple test appllication that uses SQLJ to run
    store
    : : procedures from SQL package. It compiles and work fine from
    : : JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
    : : It compiles OK in regular JDK1.2.2 but raise the following
    : : exception when running:
    : : profile
    : : com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0
    : not
    : : found: java.io.InvalidClassException: [Ljava.lang.Object;;
    : : Serializable is incompatible with Externalizable
    : : Does it mean that I have to use JDeveloper JDK?
    : : 2.When I give other then default package for *.sqlj file the
    : : *.sqlj file is added to project but I cannot see it in
    : specified
    : : package (the *.sqlj file is created in the its directory).
    : : After I compile the project the I can see *.java file in the
    : : specified package, but compiler gives errors about redefined
    : : symbols. If I remove *.sqlj file from the project it
    compiles
    : OK.
    : : What I am doing wrong?
    : : Yakov Becker
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Set Oracle to force searching string by upper case

    Our application using Oracle 11.1 and Hibernate. Data store in our database in mix cases. many of our queries are like select first_name from persons where upper(first_name) like 'DAV%' It returns Dave, DAVE, dave, David, DAVIE etcAccording to our de

  • JNI_GetDefaultJavaVMInitArgs Changed in 1.4

    I can't seem to find any information on what has changed with the JNI_GetDefaultJavaVMInitArgs call to set up an environment for calling JNI_CreateJavaVM. I can't find out how to set the classpath so that it can find my Java objects to invoke. I keep

  • Show bold text in Table column's Caption in WebDynpro

    How to set style of table column's Caption in WebDynpro to bold?

  • Moving Average price report

    Hello friends, Vendor is giving discount on monthly purchase qnty at end of every month by credit note. But my client want Purchase average price -monthly with considering discount. Can anybody tell me how to get this report... Waiting for reply. KS

  • RMAN restore database validate

    All, I cannot seem to find anything in the Oracle documentation what the RMAN restore database validate checks for? Does it check for physical and logical corruption or do I need to validate the backup using logical statement to check for this? I wou