How to write a stored procedure call to write to a db

Hi All,
          Could you pls tell me how to create a stored procedure call to write to a DB?
XIer

Xler,
If you want to learn...more details..
http://en.wikipedia.org/wiki/Stored_procedure
You can ask SQL Developer to write SP for you....
Nilesh

Similar Messages

  • How do write a stored Procedure in PL/SQL

    Hi,
    I am new to this forum. I am creating a webpage using Gridview in Visual Studio 2005.
    How to write a Stored procedure in Oracle using PL/SQL?
    I want to write a SP for the following query :
    "Select S_No, Task_ID,Last_Act_Dt,Last_Act_Tm,Status from E002 Order by S_No"
    Please help.

    In Oracle, you normally wouldn't create a stored procedure that just does a query. Depending on what you're attempting to do on the client side, and the client libraries involved, you may be able to write a stored procedure that returns a REF CURSOR and call that. This will put some limitations on what the client can do with the results, for example. The data would be read-only and scrolling back and forth in the result set would potentially rather slow and rather expensive in terms of client memory. That makes this generally a somewhat unattractive option.
    You could create a view in Oracle and just query the view in your application code. If you needed to change the query, you could then just change the view.
    Justin

  • How to use Stored Procedure Call in Sender JDBC adapter

    Hi All,
             Could someone send me a blog on how to use Stored Procedure call in Sender JDBC adapter?
    Xier

    Hi Xler
    refer these links
    /people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Also, you can check Sriram's blog for executing Stored Procedures,
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    /people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
    This blog might be helpfull on stored procedures for JDBC
    JDBC Stored Procedures
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Please go through these threads and see if it helps...
    Re: How to execute Stored Procedure?
    Re: Problem with JDBC stored procedure
    Thnaks !!

  • How to use a stored procedure in oracle reports

    How to use a stored procedure in oracle reports

    Dear,
    In report triggers you can write your procedure/functions or call it like
    function AfterPForm return boolean is
    begin
    myprocedure(:mydate);
    return (TRUE);
    end;
    Thanks
    Jamil

  • How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?

    Hi 
    I have a stored procedure. It can be executed like this
    exec test @p = 1;
    exec test @p = 2
    exec test @p = n;
    n can be hundred.
    I want the sp being executed in parallel, not sequence. It means the 3 examples above can be run at the same time.
    If I know the number in advance, say 3, I can create 3 different Execution SQL Tasks. They can be run in parallel.
    However, the n is not static. It is coming from a table. 
    How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?
    I think about using script task. In the script, I get the value of n, and the list of p, from the table, then running a loop with. In the loop, I create a threat and in the threat, I execute the sp like : exec test @p = p. So the exec test may
    be run parallel. But I am not sure if it works.
    Any idea is really appreciated.

    Hi nam_man,
    According to your description, you want to call stored procedures in parallel, right?
    In SSIS, we can create separate jobs with different stored procedures, then set the same schedule to kick the jobs off at the same time. In this way, we should be careful to monitor blocking and deadlocking depending on what the jobs are doing.
    We can also put all stored procedures in SSIS Sequence container, then they will be run in parallel.
    For more information about SSIS job and Sequence container, please refer to the following documents:
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    https://msdn.microsoft.com/en-us/library/ms139855(v=sql.110).aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Remote Stored Procedure Call Dispatcher WEB WERVICE

    Hello all,
    Environment: Windows OS, Oracle 10g, mod_plsql
    I am looking for solutions to the following problem:
    A way to dispatch calls to stored procedures from client to server with a minimal impact on performance.
    We are looking at two possible solutions:
    1) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through mod_plsql.
    2) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through a web service.
    Solution 1) is not the preferred one as you may already know that mod_plsql will not be supported starting 12g.
    Solution 2) is the one we prefer as we believe that web services will be ever more supported in the future. When we move to 11g we may turn this web service into a native one (avoiding overhead in the OC4J for hosting the web service etc.).
    We are looking for code examples and information pointers of how we could implement this dispatcher as a stored procedure in a DB package. We know that the implementation should be similar to the one done for mod_plsql in the OWA schema but the code there is obfuscated, so we could not borrow ideas from there.
    We are not sure how to deal with the generalization of the above stated problem. We need to be able to pass to this dispatcher the stored procedure package and name we are invoking, ordered list of parameters (or parameters map), and the transport strategy (XML, JSON, etc.).
    Basically, we are notsure how to deal with the USING clause of the EXECUTE IMMEDIATE statement. We can dynamically generate the SQL statement corresponding to the stored procedure we want to call, but we are not sure how to bind the parameters we are passing?
    Also, we know that EXECUTE IMMEDIATE may be slow sometimes. So if could avoid it, this could further improve performance.
    Perhaps the run-time generalized stored procedure execution may not be what we are looking for?! Perhaps we should include several design-time steps?! What about a script that given a package name (or just a single stored procedure) would generate a wrapper package which stored procudures' names would correspond to their respective counterparts in the given package which would take two parameters - the list of parameters in some sort of format, and the transport (content delivery strategy) and would return the result in the given content delivery strategy?! This script may also define the XSD of the XML message a stored procedure is called with (the parameter map) as well as the XSD of the XML result the stored procedure returns. Also the script could generate client code with the given language strategy (Java, .NET, etc.) for calling the RSPCDispatcher web service.
    We request the following from the Oracle community folks:
    a) Please, give us any relevant information that could be helpful to resolve this problem.
    b) Any resource of how to inspect stored procedures in a package, its parameters, parameter types and direction (IN, OUT, or INOUT), etc.
    Thank you very much in advance.
    Regards,
    Georgi

    Hello all,
    Environment: Windows OS, Oracle 10g, mod_plsql
    I am looking for solutions to the following problem:
    A way to dispatch calls to stored procedures from client to server with a minimal impact on performance.
    We are looking at two possible solutions:
    1) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through mod_plsql.
    2) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through a web service.
    Solution 1) is not the preferred one as you may already know that mod_plsql will not be supported starting 12g.
    Solution 2) is the one we prefer as we believe that web services will be ever more supported in the future. When we move to 11g we may turn this web service into a native one (avoiding overhead in the OC4J for hosting the web service etc.).
    We are looking for code examples and information pointers of how we could implement this dispatcher as a stored procedure in a DB package. We know that the implementation should be similar to the one done for mod_plsql in the OWA schema but the code there is obfuscated, so we could not borrow ideas from there.
    We are not sure how to deal with the generalization of the above stated problem. We need to be able to pass to this dispatcher the stored procedure package and name we are invoking, ordered list of parameters (or parameters map), and the transport strategy (XML, JSON, etc.).
    Basically, we are notsure how to deal with the USING clause of the EXECUTE IMMEDIATE statement. We can dynamically generate the SQL statement corresponding to the stored procedure we want to call, but we are not sure how to bind the parameters we are passing?
    Also, we know that EXECUTE IMMEDIATE may be slow sometimes. So if could avoid it, this could further improve performance.
    Perhaps the run-time generalized stored procedure execution may not be what we are looking for?! Perhaps we should include several design-time steps?! What about a script that given a package name (or just a single stored procedure) would generate a wrapper package which stored procudures' names would correspond to their respective counterparts in the given package which would take two parameters - the list of parameters in some sort of format, and the transport (content delivery strategy) and would return the result in the given content delivery strategy?! This script may also define the XSD of the XML message a stored procedure is called with (the parameter map) as well as the XSD of the XML result the stored procedure returns. Also the script could generate client code with the given language strategy (Java, .NET, etc.) for calling the RSPCDispatcher web service.
    We request the following from the Oracle community folks:
    a) Please, give us any relevant information that could be helpful to resolve this problem.
    b) Any resource of how to inspect stored procedures in a package, its parameters, parameter types and direction (IN, OUT, or INOUT), etc.
    Thank you very much in advance.
    Regards,
    Georgi

  • How to introspect a Stored Procedure in BPm 10g

    Could some give points on how to introspect the Stored procedure from BPM

    Hi,
    I hope you must have created DB connection in External Resources (Workspace).
    So Now create one module in catalog component called DBTables, right click on the module -> New -> Catalog Component -> SQL Query -> Select the DB connection that you created earlier -> select the schema, now you can see all the procedure, tables, function that are defined in your schema.Click on the procedure that you want to import to your workspace and click on finish. The procedure will be imported to your workspace.
    Hope the above will help you.
    Bibhu
    Edited by: Bibhuti Bhusan on Jul 14, 2011 10:44 PM

  • Stored Procedure Call with only Input Parameter

    Hi, The Example at Oracle Toplink Developer's Guide, Volume 5 uses an output param named IS_VALID. How Can I Call a Stored Procedure that has only Input Param ? If I don't use an Ouput Param Toplink throw the following Exception:
    *Excepción [TOPLINK-4002]* (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.DatabaseException Excepción Interna: java.sql.SQLException: ORA-00900: invalid SQL statement
    Here's the Sample Code Depicted at the Guide:*
    Example 98–48 Stored Procedure Call with an Output Parameter
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("CHECK_VALID_POSTAL_CODE");
    call.addNamedArgument("POSTAL_CODE");
    call.addNamedOutputArgument(
    "IS_VALID", // procedure parameter name
    "IS_VALID", // out argument field name
    Integer.class // Java type corresponding to type returned by procedure
    ValueReadQuery query = new ValueReadQuery();
    query.setCall(call);
    query.addArgument("POSTAL_CODE");
    Vector parameters = new Vector();
    parameters.addElement("L5J1H5");
    Number isValid = (Number) session.executeQuery(query,parameters);
    Here's my code
    StoredProcedureCall call = new StoredProcedureCall();
         call.setProcedureName("MYSTOREDPROCEDURE");
         call.addNamedArgument("INPUTPARAM1");
         call.addNamedArgument("INPUTPARAM2");
         call.addNamedArgument("INPUTPARAM3");
         call.addNamedArgument("INPUTPARAM4");
         call.addNamedArgument("INPUTPARAM5");
         call.addNamedArgument("INPUTPARAM6");
         ValueReadQuery query = new ValueReadQuery();
         query.setCall(call);
         query.addArgument("INPUTPARAM1");
         query.addArgument("INPUTPARAM2");
         query.addArgument("INPUTPARAM3");
         query.addArgument("INPUTPARAM4");
         query.addArgument("INPUTPARAM5");
         query.addArgument("INPUTPARAM6");
    Vector parameters = new Vector();
         parameters.addElement("INPUTVALUE1");
         parameters.addElement("INPUTVALUE2");
         parameters.addElement("INPUTVALUE3");
         parameters.addElement("INPUTVALUE4");
         parameters.addElement("INPUTVALUE5");
         parameters.addElement("INPUTVALUE6");
         uow.executeQuery(query,parameters);
    Regards,
    Manuel

    You need to use a DataModifyQuery as your query does not return anything.
    James : http://www.eclipselink.org

  • Too many arguments for stored procedure call

    I have a stored procedure with 34 arguments, including the return value. I am trying to call it from java using JDBC thin drivers (jdk11, oracle815), but I get the "wrong number or types of arguments" error message. JDBC-OCI fails also. I saw a reference in this discussion group to there being a limit of 32 arguments for stored procedure calls from jdbc (posted 6/29/99). Is there such a limit? If so, is there a fix or workaround? If there is not a limit, how can I determine which argument is causing the problem?
    Many thanks.
    Mike
    java.sql.SQLException: ORA-06550: line 1, column 13:
    PLS-00306: wrong number or types of arguments in call to 'PUT_CHECK'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
    a)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement
    .java)
    at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
    nt.java)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
    edStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
    ement.java)
    at metris.quickcheck.database.DS1.main(DS1.java:79)
    null

    I must confess I still don't understand your problem. By rows ...
    I have an sql that recodes a column and has 1450 rows. This doesn't work
    although when I use the same with less rows 40-60 it works.... do you mean rows in the table or elements in the CASE() statement ?
    From the 9i SQL Reference:
    " The maximum number of arguments in a CASE expression is 255, and each WHEN ... THEN pair counts as two arguments. To avoid exceeding the limit of 128 choices, you can nest CASE expressions. That is return_expr can itself be a CASE expression."
    According to the 10g docs the limit is the same there.
    Cheers, APC

  • Pass a null value to a JDBC stored procedure call?

    pass a null value to a JDBC stored procedure call? Is this even possible? My DBA gave me a procedure to call that sometimes requires a null value. I don't think this is even possible.

    do you mind tell me how to resolve your problem?i using the setnull method,but it doesn't work.

  • How to incorporate  a Stored procedure with ARD file (ADD ON)

    hi experts
    i created a SP  which is called by the following code.
    Dim GD As SAPbouiCOM.Grid
            Dim Query As String = "exec sp_Attendance_Report'" & vmonth & "','" & vyear & "'"
            GD = objForm.Items.Item("10").Specific
            GD.DataTable.ExecuteQuery(Query)
    while creating add on (ard file )how to incorporate   this stored procedure?
    thanks in advance

    Hello
    When the addon first time connect, you must check that the SP is exists or not exists in target database. If not exist, you may create it.
    sql to check the sp exists
    select 1 from sysobjects where name like 'sp_Attendance_Report'
    if this query returns 1 the sp is exists in the database, skip installation, if returns no records, you must install the sp via recordset by create procedure command.
    Regards
    János

  • How to Rap a Stored Procedure in Calculation View

    Please suggest/guide with step by step how to rap a stored procedure in calculation view, which latter I can use to call from odata service.
    I have one input parameter PRDID
    Table: Product
    PRDID
    PRDTYPE
    PRDCAT
    QTY
    PRICE
    MMT1
    OP
    BOOKS
    1
    12
    MMT2
    OP
    BAG
    2
    32
    MMT3
    OP
    PEN
    3
    12
    MMT4
    OP
    NOTEPAD
    6
    12
    MMT5
    OP
    MOUSE
    6
    36
    MMT6
    OP
    HANDBAG
    1
    22
    CREATE PROCEDURE <yourschema>."Product" (INOUT prd VARCHAR(10)) LANGUAGE SQLSCRIPT AS
    BEGIN
    select "PRDID", "PRDTYPE","PRDCAT","PRICE"
       from <yourschema>."Product"
       where "PRDID" = :prd;
    END;
    Thanks

    Hi Deere,
    Check this post, we already discussed the same.
    http://scn.sap.com/thread/3528968
    Step 1 : Create a calculation view in script mode.
    Step 2 : Create your output structure(as same as the procedure output structure)
    Step 3 : Call the procedure inside the script .
    Step 4: Map the fields to the output variable.
    Step 5: Map the input variables to the procedure input(if needed)
    Exposing :
    Step 5 :  In the xsodata file, you can consume as usual .
    Sreehari

  • How to Kill a Stored Procedure?

    Sombody knows how to kill a stored procedure from another stored peocedure?
    I wanna know if exists a way to use therads in sored procedures.
    Best Regards

    1) You can't. Unless you code a mechanism yourself, but then since
    you can't thread Procedure calls that wouldn't help much.
    2) You can try using DBMS_JOB, if your not in a hurry to have your procedure finish.
    This is PL/SQL, not Java. You have to imagine all you get is a single thread running
    static methods. You can get away from everything being static by using the CREATE TYPE
    OBJECT stuff. but that doesn't help you thread your processes.
    I hope someone else can give you a different answer,
    Eric Kamradt

  • How to execute oracle stored procedure through php as externally?

    hi...
    i am searching for the way that how to execute oracle stored procedure through web service, i am using php and mysql, i have some stored procedures in oracale database, i want to execute them, from php, means the database will be remain mysql, and the stored procedures of oracle will be executed externally...
    Kind regards,
    Wilayat.

    Ok, so first of all this is a kind of strange question. Since Oracle and MYSQL can happily live side by side.
    Make sure you have the oracle client (instant or regular ) installed and OCI_8 is set up and working correctly in PHP. If it is, when you run the phpinfo() routine you will see oci_8 on there. IF PHP connects just fine from the command line yet apache wont connect check permissions and things like the LD_Library Path.
    Then in php, right along with your MySQL statements run Oracle Statements eg:
    <?php
    $OraDB = oci_connect(name,pass,tnsname);
    $MySQLdb = mysql_connect([parms]);
    $oraQueryText = "begin sp_some_proc([some parms]); end;" ;
    $mysqlQuery = " Some mysql Query";
    $oraQuery = oci_parse($OraDB,$oraQueryText );
    oci_execute($oraQuery);
    mysql_execute([parms]);
    ?>
    Use the standard fetch code to get data from either of them.
    If you cannot and I mean absolutely cannot get an admin to link in OCI_8 then you still have recourse although it will be tedious as hell. PHP allows you to exec calls to the OS. You still MUST make sure the Oracle Client is installed and that sqlplus runs from the command line. You will more then likely have to have a shell script written to do this as well, but maybe not as I have never tried it with the exception of capturing the return value of sqlplus and you will have to dig into sqlplus to get it to send its results to a file you can then parse with php.
    Good Luck!

  • How to convert MSSQL stored procedure to PostgreSQL

    Hi,
    Anyone can help me...?
    How to convert MSSQL stored procedure to PostgreSQL function?
    Is there any tool available to convert T-SQL from MSSQL to PostgreSQL?
    Thanks in advance

    Hello
    Here, I write one sample stored procedure of SQL Server which I need to convert into PostgreSQL. Please help me in this with PostgreSQL.
    Thanks in advance.
    Below is sample SQL Server stored procedure: require to convert into PostgreSQL stored procedure
    CREATE PROCEDURE [dbo].[usp_GetData_ByTableName]
    @TableName NVARCHAR(MAX)
    ,@IncludeKeepAlive BIT
    ,@RowsAffected BIGINT=0 OUTPUT
    ) AS
    BEGIN
    SET NOCOUNT ON
    DECLARE @SQL VARCHAR(MAX)
    Select data base on parameter.
    SET @SQL =
    SELECT *FROM '+@TableName+'
    WHERE 1=1
    +
    CASE WHEN (@IncludeKeepAlive = 0)
    THEN
    AND [MessageTransactionID] <> 152
    ELSE
    END
    EXECUTE SP_EXECUTESQL @SQL
    RETURN 0

Maybe you are looking for

  • How to edit this to say (no live stream at this time instead of loading)

    <div id="content2_vid">     <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="377" id="videoPlayer" name="videoPlayer" type="application/x-shockwave-flash" width="640"><param name="movie" value="http://video.domain.com/swfs/videoPl

  • Migration from Brio8 version to Hyperion Interactive reporting version11

    Hi, We are migrating from Brio8 environment to Hyperion Interactive Reporting version 11 environment. I am referring hs_migration.pdf version 11. I am using migration utility tool to do migration. my question is if I am migrating artifacts from Brio

  • Time Calculation Shell dimension is slow compared to hardcoded measure?

    Hi, I have a measuregroup with 200m+ rows with about 20 measures (sums). I've created a shell dimension to hold my time calculation members such as mtd, qtd, ytd, etc. My problem is that it performs REALLY poorly when using the time calculation dimen

  • Integaration b/n EAI and portals

    Just want to know, how the integration has been takes place between EAI hub and portals or otherwise How the EAI hub interacts portals, is there any specific protocols (TC3, HTTP). Thanks in advance. Thanks in advance.

  • Receiving Xrated emails in my bulk mail.

    Even though these xrated emails are going to my bulk mail in my Iphone 3gs, I still have to delete them (one at a time) and some of the messages can be seen.   These are for males only and I find them very obscene and I am receiving them as many as 1