Explanation of all the Stored Procedure in SBO

Dear Experts,
Their are numerous stored procedures of SAP B1 I once got a SAP documentation explaining "SBO_SP_TransactionNotification stored procedure". Now can I get the source where to get SAP documentation for all the stored procedures. I will be grateful.
Faisal Baloch

Dear  Faisal Baloch
The editable stored procedure is SBO_SP_TransactionNotification, or SBO_SP_PostTransactionNotice (only until 2007) version.
other stored procedures related to SAP B1 system and most of them are encrypted. You can see details in the adminsitrators guide of SAP b1.
Regards
János

Similar Messages

  • How to list all tables/stored procedures used by the report

    All the reports i create are getting data from stored procedure(s). Is there a way to obtaining a listing of all the stored procedures without having to open report by report and check under Database > Set Datasource Location > Properties > Table Name?
    Finding this info it would be extremely valuable, as it would help me to judge the impact of any changes that i might be considering to one or more of the stored proc.
    So far i maintained a manual listing but it is not up-to-date and reliable. I would rather prefer to get an updated listing every time i want to change/drop a stored procedure.
    Thanks so much for your help.
    Rick

    Dell can you be a little bit more specific about the SDK solution. I could ask one of the developers to help me but i need to gather more details.
    I took a look .rpt inspector Pro but it does not do what i need. All i need is the the listing of all the database tables (in my case stored procs) used in my reports. No need to replace or change anything. I need to scan the directory where i have all the reports for the different applications and get report names and table/stored procs used. i can export the txt file to excel and that's all.

  • Error while running a stored procedure in SBO

    Hi all,
    i have a stored procedure that i run in my sbo.  When i run the stored procedure i get the following error :
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Warning: Null value is eliminated by an aggregate or other SET operation.
    'Servicecontracten' (OCTR)    05/10/2011  18:03:36  -1
    i launch my sp like this :
    exec [spu_DS_HistProjektUserVeldenViewBetalingen]  (i pass no parameters while testing.  i put them fix in my sp)
    my stored procedure looks like this :
    USE [def1]
    GO
    /****** Object:  StoredProcedure [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]    Script Date: 10/05/2011 18:03:05 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- Batch submitted through debugger: SQLQuery2.sql|8|0|C:\Users\kvanhauwaert\AppData\Local\Temp\~vs2A98.sql
    ALTER PROCEDURE [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]
              /* @project_number varchar(20),
              @billperiod_type varchar(10) */
    AS
    BEGIN
         SELECT isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase, isnull(factuurbedrag,0) as factuurbedrag,
         isnull(billperiod_type,'') as billperiod_type
         INTO #tempDS_HistProjektUserVeldenViewBetalingen
         FROM DS_HistProjektUserVeldenViewBetalingen t1
         WHERE project_number = '08053A'
         SELECT  isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase , isnull(factuurbedrag,0) as factuurbedrag,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where lijnnr <= t1.lijnnr) as lijntotaal,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where lijnnr <= t1.lijnNr and billperiod_type = '110-01' ) as lijntotaalKetting
         FROM #tempDS_HistProjektUserVeldenViewBetalingen t1
         WHERE fase,'') is not null
         ORDER BY t1.fase
         DROP TABLE #tempDS_HistProjektUserVeldenViewBetalingen
    END
    GO
    Somebody has a clue what i'm doing wrong ?
    thnx

    Thanks Gordon for your reply.
    i've changed my sp to :
    USE [def1]
    GO
    /****** Object:  StoredProcedure [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]    Script Date: 10/05/2011 18:56:34 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- Batch submitted through debugger: SQLQuery2.sql|8|0|C:\Users\kvanhauwaert\AppData\Local\Temp\~vs2A98.sql
    CREATE PROCEDURE [dbo].[spu_DS_HistProjektUserVeldenViewBetalingen]
              /* @project_number varchar(20),
              @billperiod_type varchar(10) */
    AS
    BEGIN
         SELECT isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase, isnull(factuurbedrag,0) as factuurbedrag,
         isnull(billperiod_type,'') as billperiod_type
         INTO #tempDS_HistProjektUserVeldenViewBetalingen
         FROM DS_HistProjektUserVeldenViewBetalingen t1
         WHERE isnull(project_number,'') = '08053A'
         SELECT  isnull(lijnnr,0) as lijnnr, isnull(fase,'') as fase , isnull(factuurbedrag,0) as factuurbedrag,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where isnull(lijnnr,0) <= isnull(t1.lijnnr,0)) as lijntotaal,
              (select sum(isnull(factuurbedrag,0)) from #tempDS_HistProjektUserVeldenViewBetalingen where isnull(lijnnr,0) <= isnull(t1.lijnNr,0) and isnull(billperiod_type,'') = '110-01' ) as lijntotaalKetting
         FROM #tempDS_HistProjektUserVeldenViewBetalingen t1
         WHERE isnull(fase,'') <> ''
         ORDER BY t1.fase
         DROP TABLE #tempDS_HistProjektUserVeldenViewBetalingen
    END
    GO
    but that didn't solved my problem.  Any other idea's ?
    kind regards.
    Kurt

  • Error while executing the stored procedure through sender JDBC adapter

    Hi All,
    I am getting below error while executing the stored procedure through sender JDBC adapter.
    Database-level error reported by JDBC driver while executing statement 'exec SapgetNextEntity 'SalesOrder''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    what is the problem? any idea to anyone...
    regards
    Ramesh

    hi Dharamveer,
    I am not getting below statement for your reply
    Try to use Refrence Cursor it will return u reference of resultset.
    I mention SP like this
    exec SapgetNextEntity 'SalesOrder'
    SapgetNextEntity -
    > SP Name
    SalesOrder----
    > Parameter I am passing...
    regards
    Ramesh

  • Sender JDBC support the stored procedure in SQL Server 2005

    Dear All,
    My question here is , Sender is JDBC adpter support to call the Stored procedure in Microsoft SQL Server 2005?
    I followed the below thread before posting this question
    Sender JDBC Adapter Supports Stored Procedures????
    In the thread Suraj response has mentioned SAP note: 941317, I checked the note, Note says it supported only ORACLE DBMS versions.
    Could you please clarify about this to possibility to call the stored procedure in Microsoft SQL server 2005?
    Thank you in Advance
    Sateesh

    Hi Sateesh,
    To answer your query, Yes it does. SP call works with SQL Server 2005 as well, the SP call should be "execute SPNAME <paramas>". In the place of update statement put any junk value as mentioned in the earlier comment.
    But just one thing to be noted, the select or any other query returning the desired resultset must be the first statement in youre SP returning value to the calling app. Means if there are any update, deletion or intermediate select queries to be used with in your SP, those all should be placed after the Main Select query that returns the desired resultset. Variable declarions and assignments are allowed.
    But if the seq of statements in your SP are like:
    @var1 Varchar
    Update <tablename>....
    Select * from <tablename>
    Then the output of the SP is :
    1 row updated
    <the resultset from select>
    In such cases, PI can recognise the first value returned only, that is "1 row updated" and hence the returned resultset wouldn't be seen by PI or not be passed to integration engine. Hence the update should come after the main Select.
    One more interesting piece of information, even if you copy and paste the entire SP code in place of the query string of Sender JDBC adapter, that too will work with all your variable declarations, multiple queries and updates and everything. Just have to follow the above rule.
    Let us know what you find.
    Regards,
    Suddhasatta

  • Customize the stored procedure migrating of MWB

    Hi, All,
    Is there anybody know how much customize we can have for using
    the MWB when migrate stored procedure? For sample I have a SQL
    Server 6.5 strored procedure like following:
    /******************* SQL Server 6.5 sp *************/
    CREATE PROCEDURE sp_SelectUsers
    AS
    select
    tbl_Sp_users.ID, UserName, Password, ExpiresOn,
    PwdChangedDate, tbl_Sp_UserGrps.name
    from
    tbl_Sp_users, tbl_Sp_UserGrps
    where
    GroupID = tbl_Sp_UserGrps.id
    order by username
    /******************* end ***************************/
    After I migrate it to Oracle 8 with MWB, I got following object,
    one Pkg and one Procedure in Oracle db, like following:
    /****************** Oracle Pkg **********************/
    CREATE OR REPLACE PROCEDURE sp_SelectUsers(
    RC1 IN OUT sp_SelectUsersPkg.RCT1)
    AS
    StoO_selcnt INTEGER;
    StoO_error INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2(255);
    StoO_sqlstatus INTEGER;
    BEGIN
    OPEN RC1 FOR
    SELECT tbl_Sp_users.ID, UserName, Password,
    ExpiresOn, PwdChangedDate, tbl_Sp_UserGrps.name FROM
    tbl_Sp_users, tbl_Sp_UserGrps
    WHERE GroupID = tbl_Sp_UserGrps.id
    ORDER BY username ;
    END sp_SelectUsers;
    /******************* Oracle Procedure ****************/
    PROCEDURE sp_SelectUsers(
    RC1 IN OUT sp_SelectUsersPkg.RCT1)
    AS
    StoO_selcnt INTEGER;
    StoO_error INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2(255);
    StoO_sqlstatus INTEGER;
    BEGIN
    OPEN RC1 FOR
    SELECT tbl_Sp_users.ID, UserName, Password,
    ExpiresOn, PwdChangedDate, tbl_Sp_UserGrps.name FROM
    tbl_Sp_users, tbl_Sp_UserGrps
    WHERE GroupID = tbl_Sp_UserGrps.id
    ORDER BY username ;
    END sp_SelectUsers;
    /******************* end *****************************/
    As our client use RDO as access method, there is no way we can
    use this migrated SP in RDO and return resultset. We need
    convert this SP to following to be able to use RDO to get
    resultset back in client:
    /******************* need convert to *********************/
    create or replace package sp_selectUsersPkg
    as
    cursor c1
    is select tbl_Sp_users.ID, UserName, Password,ExpiresOn,
    PwdChangedDate, tbl_Sp_UserGrps.name
    from tbl_Sp_users, tbl_Sp_UserGrps
    where GroupID = tbl_Sp_UserGrps.id
    order by username;
    type UsersCur
    is ref cursor return c1%ROWTYPE;
    procedure sp_selectUsers(UserCursor in out UsersCur );
    END;
    create or replace package body sp_selectUsersPkg
    as
    procedure sp_selectUsers(UserCursor in out UsersCur )
    is
    begin
    open UserCursor for
    select tbl_Sp_users.ID, UserName,
    password, ExpiresOn,
    PwdChangedDate, tbl_Sp_UserGrps.name
    from tbl_Sp_users, tbl_Sp_UserGrps
    where GroupID = tbl_Sp_UserGrps.id
    order by username;
    end;
    end;
    /******************* end *********************************/
    Is there any idea how we can do this? I hope we don't need do
    this manually.
    Thank you very much for any help!
    Jing
    null

    I have done a rough example of using VB6, RDO and ODBC
    drivers, which may be of help to some workbench users:
    Calling Oracle 8.1.5 stored procedures with ref cursors using RDO
    and Visual
    Basic.
    Ver 0.1 [email protected]
    Summary
    Versions Used
    Table
    Code
    With Explicit Ref Cursor Argument
    Without Explicit Ref Cursor Argument
    Actions
    Summary
    This gives a comparison of the connectivity between Visual Basic
    and Oracle,
    with both the intersolve and oracle drivers. The Oracle odbc
    still has
    significant
    shortcomings in comparison to the intersolve/Merant driver.
    Versions Used
    Visiual Basic 6.0, Oracle odbc driver 8.1.5.3.0, Oracle Database
    8.1.5.0.0 on
    NT, intersolve/Merant 3.5 32 bit Oracle driver.
    Table
    html table replaced by rough results in ascii form
    test case with named result set cursor variable:
    sSQL = "{CALL reftest.GetEmpData(?)}"
    oracle 8.1.5.3
    could not find item indicated by text, known vb6.0 bug?, thinks
    reftest is user
    intersolve
    could not find item indicated by text, known vb6.0 bug?, thinks
    reftest is user
    sSQL = "begin reftest.GetEmpData(?); end;"
    oracle 8.1.5.3
    run time error 40002 driver not capable
    intersolve
    ok
    sSQL = "{CALL GetEmpData(?)}"
    oracle 8.1.5.3
    run time error 40002 driver not capable
    intersolve
    could not find item indicated by text,?(similar to bug above?)
    at qd.rdoParameters(0).Type = rdTypeVARCHAR
    sSQL = "begin GetEmpData(?); end;"
    oracle 8.1.5.3
    run time error 40002 driver not capable
    intersolve
    ok
    procedure with result set last argument wanting to be simulated
    as not
    argument result set
    strsql = "{CALL BYROYALTYPkg.byroyalty()}"
    oracle 8.1.5.3
    ok
    intersolve
    ok
    strsql = "begin BYROYALTYPkg.byroyalty(); end;"
    oracle 8.1.5.3
    wrong number of arguments in byroyalty
    intersolve
    ok
    strsql = "{CALL byroyalty() }"
    oracle 8.1.5.3
    wrong number of arguments
    intersolve
    ok
    strsql = "begin byroyalty(); end;"
    oracle 8.1.5.3
    wrong number of arguments
    intersolve
    ok
    Code
    With Explicit Ref Cursor Argument
    Oracle Stored Procedures and Packages
    (on scott/tiger account)
    create or replace package reftest as
    cursor c1 is select ename from emp;
    type empCur is ref cursor return c1%ROWTYPE;
    procedure GetEmpData(EmpCursor in out empCur );
    END;
    create or replace package body reftest as
    procedure GetEmpData(EmpCursor in out empCur) is
    begin
    open EmpCursor for select ename from emp;
    end;
    end;
    create or replace procedure GetEmpData(EmpCursor in out
    reftest.empCur)
    is
    begin
    open EmpCursor for select ename from emp;
    end;
    VB code
    Private Sub Command1_Click()
    Dim cn As New rdoConnection
    Dim qd As rdoQuery
    Dim rs As rdoResultset
    Dim cl As rdoColumn
    Static Number As Integer
    Number = 0
    cn.Connect = "uid=scott; pwd=tiger; DSN=Oracle;"
    'enable the MS Cursor library
    cn.CursorDriver = rdUseOdbc
    'Make the connection
    cn.EstablishConnection rdDriverPrompt
    sSQL = "BEGIN GetEmpData(?); END;"
    Set qd = cn.CreateQuery("", sSQL)
    qd.rdoParameters(0).Type = rdTypeVARCHAR
    'Dynamic or Keyset is meaningless here
    Set rs = qd.OpenResultset(rdOpenStatic)
    'all the output is routed to the debug window
    Debug.Print ".....Starting Result Sets....."
    Do
    Debug.Print
    Debug.Print
    Do Until rs.EOF
    For Each cl In rs.rdoColumns
    If IsNull(cl.Value) Then
    Debug.Print " "; cl.Name; "NULL"; 'Error
    trap for
    null fields
    Else
    Debug.Print " "; cl.Name; " ";
    cl.Value;
    End If
    Next
    Debug.Print
    rs.MoveNext
    Loop
    Loop While rs.MoreResults
    cn.Close
    End Sub
    Without Explicit Ref Cursor Argument
    Oracle Stored Procedures and Packages
    (requires table:
    SQL> desc MTG_VERSION
    Name
    Null?
    Type
    VERSION
    NUMBER
    create or replace PACKAGE BYROYALTYPkg AS
    TYPE RT1 IS RECORD (
    val MTG_VERSION.VERSION%TYPE
    TYPE RCT1 IS REF CURSOR RETURN RT1;
    PROCEDURE byroyalty(
    RC1 IN OUT BYROYALTYPkg.RCT1);
    END;
    create or replace PACKAGE BODY BYROYALTYPkg AS
    PROCEDURE byroyalty(
    RC1 IN OUT BYROYALTYPkg.RCT1)
    AS
    StoO_selcnt INTEGER;
    StoO_error INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2(255);
    StoO_sqlstatus INTEGER;
    BEGIN
    OPEN RC1 FOR
    SELECT VERSION FROM MTG_VERSION;
    END byroyalty;
    END;
    create or replace PROCEDURE byroyalty(
    RC1 IN OUT BYROYALTYPkg.RCT1)
    AS
    StoO_selcnt INTEGER;
    StoO_error INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2(255);
    StoO_sqlstatus INTEGER;
    BEGIN
    OPEN RC1 FOR
    SELECT VERSION FROM MTG_VERSION;
    END byroyalty;
    VB code
    Dim env1 As rdoEnvironment
    Dim conn1 As rdoConnection
    Dim strsql As String
    Dim ps As rdoPreparedStatement
    Dim rs As rdoResultset
    Private Sub Command1_Click()
    strsql = "begin byroyalty(); end;"
    'in oracle odbc driver uses refcusor argument to
    get result set
    Set ps = conn1.CreatePreparedStatement("PsTest",
    strsql)
    Set rs = ps.OpenResultset(rdOpenStatic)
    Text1 = rs!Version
    rs.Close
    End Sub
    Private Sub Form_Load()
    rdoEngine.rdoDefaultCursorDriver = rdUseOdbc
    Set env1 = rdoEngine.rdoCreateEnvironment(" ", " ", " ")
    strsql = "ODBC;DSN=tot4;UID=test;PWD=test;"
    Set conn1 = env1.OpenConnection(" ", rdDriverPrompt, False,
    strsql)
    conn1.QueryTimeout = 3600
    End Sub
    Actions
    Encourage odbc to allow result sets , via the odbc processed
    extra
    argument, outside of packages.
    Document the current situation, and keep users informed of
    developments.
    Turloch
    Oracle Migration Workbench Team
    Turloch O'Tierney (guest) wrote:
    : Jing,
    : Note that there is an example in the FAQ where the intersolve
    : driver was used so no change was required in the client code.
    The
    : intersolve driver optionally converts the extra argument into a
    : result set. With the Oracle ODBC driver the argument needs to
    be
    : explicitly handled.
    : Is there a problem with RDO and the 8.0.5 ODBC driver handling
    : package references?
    : Turloch
    : Turloch O'Tierney
    : Oracle,
    : Migration and Technology Group.
    : FAQ entry reproduced:
    : How are result sets/dynasets returned to the calling program?
    : The Oracle Migration Workbench parser adds an extra
    argument
    : of type REF CURSOR for result
    : sets/dynasets. This type is understood and can be
    : manipulated by both PL/SQL and Oracle JDBC. Oracle8
    : release 8.0.5 ODBC drivers support REF CURSORs which means
    : that the additional argument must be
    : explicitly handled by the application, and the client
    : application code must be changed. However, some
    : third-party vendors such as Intersolv supply ODBC drivers
    : for Oracle that support REF CURSORs and can, in
    : addition, implicitly make use of REF CURSORs for using
    : result sets/dynasets. Therefore, no change is
    : required in the client application code. This is
    illustrated
    : in the following examples of an MS SQL Server
    : stored procedure and its equivalent Oracle package and
    : stored procedure as generated by the Oracle
    : Migration Workbench parser.
    : MS SQL Server Stored Procedure
    : CREATE PROCEDURE byroyalty
    : AS
    : select au_id from titleauthor
    : GO
    : Oracle8i Package and Stored Procedure
    : PACKAGE BYROYALTYPkg AS
    : TYPE RT1 IS RECORD (
    : au_id titleauthor.au_id%TYPE
    : TYPE RCT1 IS REF CURSOR RETURN RT1;
    : END;
    : PROCEDURE byroyalty(
    : RC1 IN OUT byroyaltyPkg.RCT1)
    : AS
    : StoO_selcnt INTEGER;
    : StoO_error INTEGER;
    : StoO_rowcnt INTEGER;
    : StoO_errmsg VARCHAR2(255);
    : StoO_sqlstatus INTEGER;
    : BEGIN
    : OPEN RC1 FOR
    : SELECT au_id FROM titleauthor;
    : END byroyalty;
    : The following example illustrates the typical ODBC code
    used
    : by Intersolv to call the above MS SQL Server
    : stored procedure. This code also works for the above
    : Oracle8i package and stored procedure. Note that error
    : handling must be added in a real application:
    : SQLPrepare(...,'{call byroyalty()}',...)
    : SQLExecute()
    : SQLBindCol()
    : SQLFetch()
    : Comments:
    : SQLPrepare(...,'{call byroyalty()}',...) is the ODBC SQL
    : syntax used to execute stored procedures.
    : SQLExecute()executes the stored procedure.
    : SQLBindCol()assigns storage for result column 1 in the
    : result set (au_id).
    : SQLFetch() fetches the first record from the result set
    : generated by the stored procedure.
    : The following examples illustrate how to call the above MS
    : SQL Server stored procedure with result
    : sets/dynasets in Visual Basic using DAO and RDO on top of
    : ODBC. This code works for Oracle8i packages
    : and stored procedures if you use an Intersolv ODBC driver
    to
    : understand Oracle REF CURSORs.
    : DAO
    : Private Sub Command2_Click()
    : Dim sSql As String
    : sSql = "{call byroyalty()}"
    : 'In Oracle ODBC driver use refcusor argument to get
    : result set
    : Set rCustomers = dbsServer.OpenRecordset(sSql,
    : dbOpenDynamic)
    : Text4 = rCustomers.Fields(0)
    : theend:
    : End Sub
    : Please note, this example assumes that a DAO connection
    has
    : been set up already.
    : RDO
    : Private Sub Command1_Click()
    : StrSql = "{call byroyalty}"
    : 'in oracle odbc driver uses refcusor argument to get
    : result set
    : Set Ps = connx1.CreatePreparedStatement("PsTest",
    : StrSql)
    : Set Rs = Ps.OpenResultSet(rdOpenStatic)
    : Text3 = Rs!au_id
    : Rs.Close
    : End Sub
    : Please note, this example assumes that an RDO connection
    has
    : been set up already.
    : Jing Zhang (guest) wrote:
    : : Hi, All,
    : : Is there anybody know how much customize we can have for
    using
    : : the MWB when migrate stored procedure? For sample I have a
    SQL
    : : Server 6.5 strored procedure like following:
    : : /******************* SQL Server 6.5 sp *************/
    : : CREATE PROCEDURE sp_SelectUsers
    : : AS
    : : select
    : : tbl_Sp_users.ID, UserName, Password, ExpiresOn,
    : : PwdChangedDate, tbl_Sp_UserGrps.name
    : : from
    : : tbl_Sp_users, tbl_Sp_UserGrps
    : : where
    : : GroupID = tbl_Sp_UserGrps.id
    : : order by username
    : : /******************* end ***************************/
    : : After I migrate it to Oracle 8 with MWB, I got following
    : object,
    : : one Pkg and one Procedure in Oracle db, like following:
    : : /****************** Oracle Pkg **********************/
    : : CREATE OR REPLACE PROCEDURE sp_SelectUsers(
    : : RC1 IN OUT sp_SelectUsersPkg.RCT1)
    : : AS
    : : StoO_selcnt INTEGER;
    : : StoO_error INTEGER;
    : : StoO_rowcnt INTEGER;
    : : StoO_errmsg VARCHAR2(255);
    : : StoO_sqlstatus INTEGER;
    : : BEGIN
    : : OPEN RC1 FOR
    : : SELECT tbl_Sp_users.ID, UserName, Password,
    : : ExpiresOn, PwdChangedDate, tbl_Sp_UserGrps.name FROM
    : : tbl_Sp_users, tbl_Sp_UserGrps
    : : WHERE GroupID = tbl_Sp_UserGrps.id
    : : ORDER BY username ;
    : : END sp_SelectUsers;
    : : /******************* Oracle Procedure ****************/
    : : PROCEDURE sp_SelectUsers(
    : : RC1 IN OUT sp_SelectUsersPkg.RCT1)
    : : AS
    : : StoO_selcnt INTEGER;
    : : StoO_error INTEGER;
    : : StoO_rowcnt INTEGER;
    : : StoO_errmsg VARCHAR2(255);
    : : StoO_sqlstatus INTEGER;
    : : BEGIN
    : : OPEN RC1 FOR
    : : SELECT tbl_Sp_users.ID, UserName, Password,
    : : ExpiresOn, PwdChangedDate, tbl_Sp_UserGrps.name FROM
    : : tbl_Sp_users, tbl_Sp_UserGrps
    : : WHERE GroupID = tbl_Sp_UserGrps.id
    : : ORDER BY username ;
    : : END sp_SelectUsers;
    : : /******************* end *****************************/
    : : As our client use RDO as access method, there is no way we
    can
    : : use this migrated SP in RDO and return resultset. We need
    : : convert this SP to following to be able to use RDO to get
    : : resultset back in client:
    : : /******************* need convert to *********************/
    : : create or replace package sp_selectUsersPkg
    : : as
    : : cursor c1
    : : is select tbl_Sp_users.ID, UserName, Password,ExpiresOn,
    : : PwdChangedDate, tbl_Sp_UserGrps.name
    : : from tbl_Sp_users, tbl_Sp_UserGrps
    : : where GroupID = tbl_Sp_UserGrps.id
    : : order by username;
    : : type UsersCur
    : : is ref cursor return c1%ROWTYPE;
    : : procedure sp_selectUsers(UserCursor in out UsersCur );
    : : END;
    : : create or replace package body sp_selectUsersPkg
    : : as
    : : procedure sp_selectUsers(UserCursor in out UsersCur )
    : : is
    : : begin
    : : open UserCursor for
    : : select tbl_Sp_users.ID, UserName,
    : : password, ExpiresOn,
    : : PwdChangedDate, tbl_Sp_UserGrps.name
    : : from tbl_Sp_users, tbl_Sp_UserGrps
    : : where GroupID = tbl_Sp_UserGrps.id
    : : order by username;
    : : end;
    : : end;
    : : /******************* end *********************************/
    : : Is there any idea how we can do this? I hope we don't need do
    : : this manually.
    : : Thank you very much for any help!
    : : Jing
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Import/export only the stored procedure from DMP

    Hi all,
    pls tell how to import/export only the stored procedure from a DMP file.
    Best Regards,
    Subir

    pls tell how to import/export only the stored
    procedure from a DMP file.If you on 10g or above use expdp / impdp for import/export only the SP.
    Overview of Oracle Data Pump
    - Virag Sharma
    http://virag.sharma.googlepages.com
    http://viragsharma.blogspot.com/

  • Connection object is getting closed before the stored procedure is complete

    Hi Everyone,
    I am facing an issue where by the java connection object is closed before the stored procedure it is connected to is complete.
    I am not sure if the fault is in SP or Connection pool.
    After spending some time, i could able to figure out that the procedure is taking a tad more time for processing as there are over 1000 records in the database tables it is dealing with.
    Would that be a potential cause ? or Am i required to handle it in Java only ?
    I want to know what could be possible causes for this issue ?
    Please Help.
    FYI,
    The following are the logs which says,
    XYZ (Stored Procedure) : Start Time is 1349217771302 Procedure started here
    INFO >2012-10-02 18:43:09,935 [ConnectionPool]: Closing connection: DataSource [ABC](684)
    INFO >2012-10-02 18:46:03,512 DAO[main]: XYZ : End Time is 1349217963512 Procedure ended here
    Thanks in Advance.

    Hi ,
    Thank you all for your quick response.
    Well it's my bad i dint provide you any code to look into thinking that i am dealt with a gen issue and also i am too paranoid to post any code i am dealing with in the forum (i am sorry).
    But here is some information for you,
    Database : Oracle 10g
    Java: 1.5 version
    We are using only One connection object for the entire java backend process .
    The SP is of over 1000 lines of code which for obvious reasons i can't past it here but this morning i figured out an issue in SP where by a query taking way more than usual time to execute which led to SP's poor performance and also the reason for why it is taking very long time than usual.
    This query is a simple SELECT query where it is trying fetch over 2000 records from a table of over 3 million records. The execution time is over 30-40 seconds which is the root cause of SP's poor performance.
    When i eliminated this from the logic and ran the query it could able process (inserting huge volume around 5000 records of data) in 1 second instead of 3-4 minutes earlier.
    I tried to replicate this issue (which occurred in our production server) in my local system but no luck as there was no connection issue here but only the substantial time difference.
    We are using a customized connection pool which is as follows,
    I am not sure what's going on here because it seems to be greek and latin to me.
    What we are doing in our DAO is we are using method of the below ConnectionPool.getInstance(SCHEMA) to get the connection object.
    Looking forward to seeking advice from you on how connection pool in general works.
    public class ConnectionPool extends Thread
         private static final ConnectionPool me = new ConnectionPool();
         private Hashtable dataSources = new Hashtable();
         private static final int MIN_TIMEOUT = 0;
         private long timeOut;
         private Hashtable cons = new Hashtable();
         private Hashtable active = new Hashtable();
        private boolean trace = false;
         private ConnectionPool()
              registerDataSources();
              this.timeOut = PropertyManager.getIntProperty("connectionPool.timeOut", MIN_TIMEOUT);
              setName("ConnectionPool");
              setPriority(MIN_PRIORITY);
              if (timeOut > 0)
                   start();
         private void registerDataSources()
            dataSources.clear();
              Properties props = System.getProperties();
              String app = props.getProperty("X", "Y");
              for(Enumeration e = props.keys(); e.hasMoreElements();)
                   String key = (String) e.nextElement();
                   if (key.startsWith(app + ".connectionPool.dataSources.") && key.endsWith(".selector"))
                        String ds = key.substring((app + ".connectionPool.dataSources.").length(), key.length() - ".selector".length());
                        LogManager.logStatus("Registering [" + ds + "] (selector) " +
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".selector"));
                        dataSources.put(ds,
                             new GenDataSource(
                                  ds,
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".selector")));
                        continue;                    
                   if (!key.startsWith(app + ".connectionPool.dataSources.") || !key.endsWith(".server"))
                        continue;
                   String ds = key.substring((app + ".connectionPool.dataSources.").length(), key.length() - ".server".length());
                   try
                        LogManager.logStatus("Registering [" + ds + "] " +
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".url"));
                        loadDriver(props.getProperty(app + ".connectionPool.dataSources." + ds + ".driver"));
                   catch (Exception se)
                        LogManager.logException(se);
                   GenDataSource genDataSource = new GenDataSource(
                             ds,
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".useMatrix", "false").equals("true"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".server"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".url"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".user"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".password"));
                   // Set the schema if schema is defined in settings.xml file
                   if (genDataSource != null && props.getProperty(app + ".connectionPool.dataSources." + ds + ".schema") != null ) {
                        genDataSource.setSchema(props.getProperty(app + ".connectionPool.dataSources." + ds + ".schema"));
                   dataSources.put(ds, genDataSource);
         public static Connection getConnection(String dataSource) throws SQLException
              GenDataSource ds = (GenDataSource) me.dataSources.get(dataSource);
              if (me.timeOut <= 0)
                   if (ds.getSchema() != null )
                        return updateSchema ( ds);
                   else
                        return DriverManager.getConnection(ds.url(), ds.user(), ds.password());
              String key = dataSource;
              Stack free;
              GenPooledConnection pc = null;
              synchronized (me)
                   if ((free = (Stack) me.cons.get(key)) == null)
                        free = new Stack();
                        me.cons.put(key, free);
                   if (!free.empty())
                        pc = (GenPooledConnection) free.pop();
                   if (pc == null)
                        if (ds.getSchema() != null )
                             pc = new GenPooledConnection("DataSource [" + key + "]",
                                                 updateSchema ( ds), free, me.active, me.timeOut, me.trace);
                        else
                             pc = new GenPooledConnection("DataSource [" + key + "]",
                                       DriverManager.getConnection(ds.url(), ds.user(), ds.password()), free, me.active, me.timeOut, me.trace);
                   else
                        pc.touch();
              LogManager.logStatus("Using " + pc);
              me.active.put(pc.id(), pc);
              return pc;
         public void run()
              for(;;)
                   try
                        sleep(60 * 1000);
                        synchronized (me) {
                             for(Enumeration e = cons.elements(); e.hasMoreElements();)
                                  Stack stack = (Stack) e.nextElement();
                                  for (int i = stack.size()-1; i >= 0; i--)
                                       GenPooledConnection pc = (GenPooledConnection) stack.elementAt(i);
                                       if (pc.isExpired())
                                            stack.removeElementAt(i);
                   catch (Exception e)
                        GenUtil.reportException(e);
         private static Connection updateSchema ( GenDataSource ds) throws SQLException {
              Connection con = DriverManager.getConnection(ds.url(), ds.user(), ds.password());
              if (ds.getSchema() != null ) {
                   String sql = "SET SCHEMA  " + ds.getSchema()+ ";";
                   LogManager.logDebugMessage("updating the Schema with sql statement " + sql);
                   PreparedStatement ps = con.prepareStatement(sql);
                   ps.execute();
                   ps.close();
              return con;
    }Thanks.
    Edited by: EJP on 5/10/2012 14:09: added {noformat}{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Drop the stored procedure having null schema

    Hello All,
    I have 2 SPs with same name but different schema id , one 1(default) and other is 20 but when i check in sys.schemas it give no record for schema_id 20.
    i would like to drop the SP which has schema_id 20, i dont know the schema name for id 20 so not able to drop it.
    Please help me out to remove\drop the SP which has null schema.

    What version of SQL Server and service pack are your running? I've never seen this but you might try first try restarting SQL to rule cache corruption.  If the problem persists, below are some steps you can try.
    Run the query below to get the schema name from the stored procedure CREATE statement:
    SELECT m.definition
    FROM sys.procedures AS p
    JOIN sys.sql_modules AS m ON
    m.object_id = p.object_id
    WHERE OBJECT_SCHEMA_NAME(object_id) IS NULL;
    Query sys.schemas to identify gaps in schema_id values less than 20.  Create schemas with dummy names until schema_id 19 is assigned.  Then create a schema with the name retrieved from the proc schema and verify it has been assigned schema_id
    20.  Finally, try to drop the proc using the schema-qualified name.
    Is there anything unusual that might help explain what led to this problem.  Maybe a transfer of objects from one schema to another that went awry?
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • HIDE THE STORED PROCEDURE

    how i can HIDE THE STORED PROCEDURE for other user oracle version 9i
    Edited by: razagold on Jun 5, 2010 6:29 AM
    Edited by: razagold on Jun 5, 2010 6:30 AM

    Hardly anyone uses C or C++ with Oracle any more. If you are in an environment where this is done it is a very rare environment these days.
    Try to find an Oracle conference, or job description at dice.com, that asks for Oracle and C any more. Rarer than requests for Korn shell scripting.
    Your argument with respect to keeping the customer in the dark has nothing to do with Open Source. Perhaps you have not worked in the business of selling Oracle-based applications but you need to consider what reality looks like. The customer opens a support ticket. Do you ask to see the source code the minute they open the ticket? They have a problem that your support engineers can not solve in one day. Do you review all of your source code after 24 hours? When do you reach the threshold that doing so makes sense? Remember you application has many tens or hundeds of thousands of lines of code. By the time you do you have spent a small fortune in support costs. Your customer is angry with you. And the moron that made the change doesn't even work there any more so what are you going to do? Cut off their support and lose them to a competitor? No. Very simply you wrap your code and make alterations impossible.
    With respect to lawsuits. Not to pick on any country but just as an example. Lets assume you are in North America and sell an application. And lets further assume your code ends up in a commercial application sold by a company in China. You're going to sue them? Let's assume you don't have a team of lawyers on your payroll like Bill and Larry. You're going to sue them? Not realistic by any measure. Wrapping is simple and wrapping is free.

  • Documentation about Stored Procedure in SBO

    Hi experts,
    I need some documentation about the how to use of Stored Procedured in SBO, what is valid and what is not valid for SAP. I want to know If only Execute SP from SBO, but no INSERT, DELETE or UPDATE in any SBO database table is valid for Support SAP??
    Thanks.

    Hi,
    You can refer to Note No. [ 896891|https://websmp130.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=896891] regarding the Support Scope.
    You can check the link mentioned in the following thread
    Re: Tracking Opportunity
    Regards,
    Jitin
    SAP Business One Forum Team

  • Killing the Stored Procedure

    Hi All,
    I'm having a serious and urgent problem.
    Please help me in resolving this.
    I'm trying to excute a Oracle Stored Procedure from the JSP Screen.
    I.e When i click a Button in the Screen it will run the Stored Procedure (Update a table) at Background.
    Where i require help is...
    I'm clicking the Button to execute my Stored procedure. It has started the processes and running the Stored Procedure at backgroud.
    Due to connection failure or by mistake i have clicked the button again to run the Stored Procedure before the first process gets completed.
    What will be the behaviour of the System??
    Will the data be updated twice in the Table??
    Will it so table mutating error??
    If any of these situations occurs how to overcome it??
    Can i kill the first process before starting the second process, so that i will not get duplicate records in the table??
    Please give me some guideline.
    Regards,
    Gita

    Oh..my god this much complications.
    In my Stored Procedure i have not done anything other than fetching a number of rows through a cursor for certain condition and inserting that into a output table and commiting the changes.
    But the JSP is allowing to open multiple browers at the same time and process the stored procedure for the same parameters. This shows that the Stored Procedure is allowed to run for multiple seesions as it is nto showing any error message like dead lock or something.
    How to overcome this??
    Can i lock my Stored Procedure if it is clicked to run for the same parameters??
    If the Stored Procedure is triggered for the different parameters then do not lock it.
    I think diabling the button in JSP is of no use as it will be applicable only to that session. If my User opens a new session and process for the same parameter then it is of no use.
    Many Thanks for explaining the things..
    Regards,
    Gita

  • Grant execute to all custom stored procedures, not quite working

    I would like to grant execute permissions on all custom stored procedures to a group and have tried using this:
    USE myDB
    select 'GRANT EXECUTE ON ['+name+'] TO [mydomain\mydb] '  from sys.objects  where type ='P' and is_ms_shipped = 0
    It seems to execute without error, I see the full list of stored procedures I've created listed like this:
    GRANT EXECUTE ON [procUserInsert] TO [mydomain\mydb]
    However the stored procedure I added earlier, which didn't have any explicit rights set for it, does not show that the execute permission has been granted. Other stored procedures, where I had already granted execute to the group, remain as they were (which
    is expected). I'm viewing permissions via ssms, selecting the new stored procedure, then properties, permissions. If the grant failed there ought to be an error message...I don't get it. This is sql server 2005.

    It seems like you were only printing the statement (SELECT), but it is unclear if you executed them.
    You could try granting EXECUTE permission at either the DB scope or SCHEMA scope. That would grant EXECUTE on all modules (i.e. SPs, UDFs, etc.) at the chosen scope, including modules created in the future. For example:
    -- Grant EXECUTE permission on all DB
    GRANT EXECUTE TO [myDomain\mydbGroup1]
    go
    -- Grant EXECUTE permission on schema mySchema
    GRANT EXECUTE ON SCHEMA::[mySchema] TO [myDomain\mydbGroup2]
    go
    I hope this helps.
    BTW. The way you were creating the dynamic SQL for granting permissions to SPs individually is subject to 2<sup>nd</sup> order injection attacks. You should use quotename(name) in order to escape object names.
    -Raul Garcia
     SQL Server Security
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Trace the stored procedure

    Hi all..
    Can someone guide me how to trace stored procedure that we already created.
    How simple is it.
    thanks in advance.

    Hi Zakariya,
    We can trace the Stored procedures which you have created in USER_OBJECTS and USER_SOURCE data dictionary views.
    for example:
    sql > select object_name,object_type from user_objects
    where object_name= 'PROCEDURE';
    SQL > SELECT TEXT FROM USER_SOURCE
    WHERE NAME = 'P';
    WHERE 'P' IS NAME OF THE PROCEDURE.
    HOPE THIS WILL SOLVE UR PROBLEM
    RGS
    PRASANT K V N

  • How to pass the parameter values to the stored procedure from java code?

    I have a stored procedure written in sqlplus as below:
    create procedure spInsertCategory (propertyid number, category varchar2, create_user varchar2, create_date date) AS BEGIN Insert into property (propertyid, category,create_user,create_date) values (propertyid , category, create_user, create_date); END spInsertCategory;
    I am trying to insert a new row into the database using the stored procedure.
    I have called the above procedure in my java code as below:
    CallableStatement sp = null;
    sp = conn.prepareCall("{call spInsertCategory(?, ?, ?, ?)}");
    How should I pass the values [propertyid, category, create_user, create_date) from java to the stored procedure?[i.e., parameters]
    Kindly guide me as I am new to java..

    Java-Queries wrote:
    I have a stored procedure written in sqlplus as below:FYI. sqlplus is a tool from Oracle that provides a user interface to the database. Although it has its own syntax what you posted is actually PL/SQL.

Maybe you are looking for

  • Connecting to my server

    HI, I have a dual g4 that I was running as a print server and it died. So I have a power PC dual G5 that I am going to replace it with running Tiger because of the software I need to run on it.   I am on my newtork because I can browse the web and in

  • Presets in CS6

    How do I ensure custom presets will be available when I install CS6 upgrade? (Photoshop)

  • SMTP Error on Mac - Invalid EHLO

    For the past 3-days my mac has been unable to send e-mail on any mail client (including mac mail, thunderbird and postbox) - the error I receive is: Syntactically invalid EHLO. It is not the SMTP settings, I am able to send off my iPhone using the ex

  • Inverted Comma database Problem

    Hi! I am using making n article management system using which i am storing articles in the form of HTML in the database. & it is working cool i am storing the data in database but when article have any inverted comma like this "here's the "preloaded

  • Oracle Recovery

    I have the backup of my Tablespaces, Control File and Archive Logs. I am planning to restore the database to a different server. I am doing the following: 1. Creating a new sid using ORADIM -NEW -SID <SIDNAME> 2. Connecting to SQLPlus. It says invali