Stored Procedures - How to store procedures?

Hi,
I would like to use this feature on the database, how do I achieve this?
What is a stored procedure? At the moment it is none. I will have to store this from somewhere. At the database design level?

Reynold Dreamweaver CS6 wrote:
Could you elaborate what do you mean by "...the php mysql 'standard' extension anyway, which is the one supported by DW'. Why do they not work?
Hi
The 'standard' php:mysql extension is the one used by php to communicate with the database server, (it translates the php you/Dw writes for the database). Each type of php database extension offers different functionality, and PDO, (this is my opinion) is the best one, as it not only supports SP's, Transactions/Views, but different databases, (with additional extensions required for each database type).
The 'standard' php:mysql extension does not support any of these 'newer' features, and never will. If you visit the php site it well tell you that the old 'standard' extension should no longer be used as it has been deprecated, which means that it no longer being developed.
Unless you are reliant on Dw extensions then I would recommend that you learn OOP, with one of the newer database models, as these are the future of php and databases.
FIO: Yes, I do use OOP, PDO and SP's, Transactions in all of my database work now, and once learned these skills are much easier, (and more secure) to use than the old ones that you are currently learning.
I also wrote a 'learners' extension for PDO and the MySQL database and one to display SP's in Dw, a few years ago, but I have for various reason stopped development. The extensions are available at - http://www.pziecina.com/design/dreamweaver/pdo_extension.php
PZ

Similar Messages

  • How to store procedure

    how to write function for following calculation
    "round((total(distinct if (PS = 'IAL' and Watsons(Pension)) or (PS ='NPL' and MNPL) or ( PS ='Original' and MS) or (PS ='SAPS' and MSAPS) or ( PS= 'Services' and MSer)) then (PERS (Unique for Employee)) Else(0) for Employee Number),2)"
    Note : PS is direct field and other is user define function

    hi ,
    i want to write the function for following claculation
    "round((total(distinct if (PS = 'IAL' and Watsons(id)) or (PS ='NPL' and MNPL) or ( PS ='Original' and MS) or (PS ='SAPS' and MSAPS) or ( PS= 'Services' and MSer)) then (PERS (Unique for Employee)) Else(0) for Employee Number),2)"
    in this claculation ps is a colum of table which hold value and Watsons(id) ,
    MNPL(id) ,MSAPS,... are function.
    can we write if part using decode function
    or any other way to manage above calculation
    Thanks

  • How to Exec a Store Procedure from A Servlet

    I have to obtain several data from Oracle, but I want to use a Store Procedure exec.This Store Procedure have many OUT parameters, one of then is a cursor.
    How can catch this Cursor in my Java Servlet
    Thank

    Have you looked at the Oracle JDBC documentation?

  • Calling a java object from a store procedure

    I have written a translation object in java that takes a $en_var in and returns its path.
    What I need to do is call that object from a PL/SQL store procedure. All the examples I have seen treat the store procedure as a wrapper around the java object.
    But in my store procedure calling the object is only one part of the procedures role:
    The store procedure code is :
    CREATE OR REPLACE PROCEDURE WRITE_TO_FILE(in_file_name IN VARCHAR, in_en_var IN VARCHAR)
    file_handle UTL_FILE.FILE_TYPE;
    file_location VARCHAR2(50)
    BEGIN
    I need to be able to call the javaobject translation here
    file_location = translation.translatePath(in_en_var)
    file_handle := UTL_FILE.FOPEN(file_location, in_file_name, 'w');
    dbms_output.put_line ('input file name opened file name' ||in_file_name ||'-->' ||in_file_location);
    UTL_FILE.put_line(file_handle,'Hello Tony);
    UTL_FILE.FCLOSE(file_handle);
    END WRITE_TO_FILE;
    I call the java class method translatePath with a string the en_var which returns the path as a string which is then passed as a parameter to UTL_FILE.FOPEN.
    Thanks for any help
    Tony

    No Longer the problem

  • HOW TO EXECUTE A STORE PROCEDURE THAT RETURN MULTIPLE ROWS FROM A QUERY

    I NEED TO CREATE AND USE A STORE PROCEDURE THAT IS GOING TO DO A SELECT STATEMENT AN THE RESULT OF THE SELECT STATEMENT IS RETURN IN SOME WAY TO THE REQUESTER.
    THIS CALL IS MADE BY AN EXTERNAL LANGUAGE, NOT PL/SQL OR FORMS APPLICATION. USING FOR EXAMPLE ODBC AND VISUAL BASIC. WHAT I NEED TO DO IS ADD A DATA ACCESS LAYER TO MY APPLICATION AND I ALREADY HAVE IT DONE FOR MS SQL SERVER, BUT I NEED THE SAME FUNCTIONALITY ACCESSING AN ORACLE DATABASE.
    FLOW:
    1. VB CREATE A ODBC CONNECTION TO A ORACLE DATABASE
    2. VB EXECUTE A STORE PROCEDURE
    3. THE STORE PROCEDURE RETURNS TO THE VB APPLICATION THE RESULT OF THE QUERY THAT IS INSIDE OF THE STORE PROCEDURE.(I.E. THE STORE PROCEDURE IS A BASIC SELECT, NOTHING COMPLEX)
    4. VB DISPLAY THE RESULT IN A GRID
    FOR SURE I CAN DO THE SELECT DIRECTLY TO ORACLE, BUT FOR PERFORMANCE REASONS AND SCALABILITY, I'LL LIKE IT TO DO IT USING A STORE PROCUDURES
    IS THIS POSIBLE?, HOW?
    THANKS

    Certainly, it's possible. First, define a stored procedure that includes an OUT parameter which is a REF CURSOR. Then, call the stored procedure via ODBC omitting the OUT parameter from the list of parameters. IT will automatically be returned as a result set. Syntax for both is below...
    CREATE PROCEDURE foo (inParam in varchar2, resultSet OUT REF CURSOR )
    In ODBC:
    {call foo( 'someData' )}
    Justin

  • 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

  • How to pass values to Oracle store procedure in Crystal Report

    Hi all,
    I am newbie on passing values to stored procedure parameters. I created a Crystal Report using the Crystal Report wiward with PULL method and data come from Oracle stored procedure. In an ASP.NET page, I have stored two values in Session and need to pass them as input parameters to Oracle stored procedure to print the report. In Crystal reports 2010 once you connect to a stored-procedure as data source, it automatically creates the parameter fields with Crytal Report Viewer. Please show me how I pass values to store procedure at runtime automatically.
            'Set the parametter value
            myReport.SetParameterValue("@P_COURSE", "CoursetNo")
            myReport.SetParameterValue("@P_CLASS", "ClassNo")
        End Sub
    I tried to apply above codes from Brian Bischof book but display the error from the following lines:
            myReport.SetParameterValue("@P_COURSE", "CoursetNo")
            myReport.SetParameterValue("@P_CLASS", "ClassNo")
    I also enclosed my code. Any experts, please let me know anything wrongs on my code . I tried several methods that searching via google, but did not solve my issues. Thanks.
    Edited by: avt2K7 on Mar 15, 2011 7:02 AM

    Hi,
    Thank you for your response. Here are the detailed code and error as following:
    Please show what I am missing in my below VB.NET codes:
    ===========================================================================================
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            LogonToTables("username", "password", "servername", "")
        End Sub
        Private Sub LogonToTables(ByVal myUserId As String, ByVal myPassword As String, ByVal myServerName As String, ByVal myDataBaseName As String)
            Dim Course, Class As String
            Course = Session.Item("CourseNumber"))
            Class = Session.Item("ClassNumber"))
            Dim myReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            myReport.Load(Server.MapPath("CrystalReport1.rpt"))
            Dim myTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
            'Set the database properties and security credentials
            Dim myConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
            myConnectionInfo.ServerName = "servername"
            myConnectionInfo.DatabaseName = ""
            myConnectionInfo.UserID = "username"
            myConnectionInfo.Password = "password"
            'Apply the ConnectionInfo to the report tables
            Dim myTables = myReport.Database.Tables
            For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
                myTableLogonInfo = myTable.LogOnInfo
                myTableLogonInfo.ConnectionInfo = myConnectionInfo
                myTable.ApplyLogOnInfo(myTableLogonInfo)
            Next
            'Set the parametter value to Crystal Report parameter named P_COURSE and P_CLASS
            myReport.SetParameterValue("@P_COURSE", "Course")
            myReport.SetParameterValue("@P_CLASS", "Class")
        End Sub
    =================================================================================
    I put a break point to debug but display the error at the following lines:
            myReport.SetParameterValue("@P_COURSE", "Course")
            myReport.SetParameterValue("@P_CLASS", "Class")
    Eventhough, if I set a specific value to Course=1000 and Class = math and still receive the error:
    Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
    I tried several sources from Google search but it is not working. I really appreciate any detailed code either in C# or VB.NET to solve my issues. Thanks in advance.

  • Multi-Mapping - JDBC receiver -  Multiple stored procedure - How to sequence?

    Hi Folks,
    We have 7.1 .Done multi-mapping , single source mapped to 5 different stored procedures.
    The challenge we are facing here is , these stored procedure is not working sequentially .
    i.,e  for e.g., 2nd Stored Procedure should start only when first Stores procedure completely finished its turn.
    But third procedure getting completed before1 st stored procedure completes .
    Highly appreciate if any views on this ? How to sequence and make sure second will start only when first SP complete  ?
    -- Shiva

    Hi ,
    Thanks for your reply. all stored procedures are asynchronous one.
    If we go for ccBPM , do we need to put wait step ?
    - Here we dont know how much time each procedure takes to complete. Requirement is another procedure has to start only when the previous one completes.
    --Shiva

  • How to write a store procedure under SQL Server 2008

    Hi Folks,
    Kindly help me step by step how to create a simple store procedure with help of sql server 2008 r2 for Crystal report.
    I know how to work by using Universe but not SQL Server. Kindly help me how to hard code by using sql.
    Thanks in adv.
    Reddy

    For the actual syntax for programming the stored proc, you'll need to work with someone (or a website) who knows T-SQL.
    The cursor that gets returned from the stored proc must be an "in out" parameter for the stored proc.  For SQL Server I usually define a record type that includes the fields that will be returned and then return a set of records of that type.  Again, check with someone who is familiar with T-SQL for more information about how to do this.
    -Dell

  • How to call store procedure in query generator

    Hi All,
    How to call store procedure in query generator.
    Regards
    Rajkumar Gupta
    Edited by: Rajkumar Gupta on Dec 7, 2010 2:11 AM

    Hi,
    Please check the following threads.
    How to use Stored Procedure in sap business one
    How to add parameters to a stored procedure in B1 Query generator
    How to execute the procedure in sap b1
    Hope it helps,
    Vasu Natari.

  • How I can call Store procedure by TABLENAME.FIELD_VALUE ?

    Hello,
    I have one table called store_proc_list.
    In the table there are two fields ie ID, SP_NAME.
    In SP_NAME I have set the store procedure name.
    Now,
    What I wanted to do is .
    I am writting one store procedure and in that
    and I want to execute the another store procedure (by name), which I will get from
    SELECT sp_name FROM store_proc_list WHERE id=1
    How I can do it ?
    I tried to do it but I could not get that how we can execute stored procedure by the name which I will get from the table.field_value for the specified condition.
    sample will more helpful.
    Thanks
    Kamlesh Gujarathi
    [email protected]

    I am curious to know how does Execute immediate help in executing the stored prod dynamically...
    SQL>CREATE OR REPLACE PROCEDURE test_proc1
    2 AS
    3 BEGIN
    4 DBMS_OUTPUT.PUT_LINE('This is test_proc1');
    5 END;
    6 /
    Procedure created.
    SQL>
    SQL>CREATE OR REPLACE PROCEDURE test_proc2
    2 AS
    3 lv_proc_name VARCHAR2(30) := 'TEST_PROC1';
    4 BEGIN
    5 EXECUTE IMMEDIATE lv_proc_name;
    6 END;
    7 /
    Procedure created.
    SQL>sho err;
    No errors.
    SQL>
    SQL>exec test_proc2;
    BEGIN test_proc2; END;
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "AIP.TEST_PROC2", line 5
    ORA-06512: at line 1
    Regards
    Arun

  • 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.

  • How can i pass NULL value in Store Procedure?

    Hi guys,
    I am calling one store procedure from MS SQL Server 200, i had create the follow layout:
    But i need pass to MSQL SEVER the CPF = NULL, when i execute the procedre the CPF send empty value (not null).
    I already changed Communication Channel parammeter "Interpretation of Empty String Values" to "Null Value" value.
    But the interface always send empty string instead of null.
    How can anybody help me, please?
    Edited by: João Noberto dos Santos Junior on Jun 24, 2009 5:00 PM

    Hi,
    To achieve this through "Interpretation of Empty String Value" in the cc, you will have to implement a patch which is sent to you by SAP when an OSS is raised. By default its not available, i mean you can configure it but it will actually not work.
    As a temporary solution you can map your element with a constant/mapwithdefault field with value mentioned as NULL.
    Regards,
    Anshul

  • How to Pass multiple parameter into single store procedure

    How to Pass multiple parameter into single store procedure
    like a one to many relationship.
    it is possible then reply me immediatly

    you mean like this .....
    CREATE OR REPLACE procedure display_me(in_param in varchar2,in_default in varchar2 := 'Default') is
    BEGIN
    DBMS_OUTPUT.put_line ('Values is .....'||in_param || '....'||in_default);
    END display_me;
    CREATE OR REPLACE procedure display_me_2 as
    cnt integer :=0;
    BEGIN
    For c1_rec In (SELECT empno,deptno FROM test_emp) Loop
         display_me(in_param => c1_rec.empno);
         cnt := cnt+1;
         end loop;
         DBMS_OUTPUT.put_line('Total record count is ....'||cnt);
    END display_me_2;
    SQL > exec display_me_2
    Values is .....9999....Default
    Values is .....4567....Default
    Values is .....2345....Default
    Values is .....7369....Default
    Values is .....7499....Default
    Values is .....7521....Default
    Values is .....7566....Default
    Values is .....7654....Default
    Values is .....7698....Default
    Values is .....7782....Default
    Values is .....7788....Default
    Values is .....7839....Default
    Values is .....7844....Default
    Values is .....7876....Default
    Values is .....7900....Default
    Values is .....7902....Default
    Values is .....7934....Default
    Values is .....1234....Default
    Total record count is ....18

  • How to call a Store Procedure with IN PARAMETER

    Hi, im new using Oracle 10G with Oracle SQL Developer, my cuestion is how to call a Store Procedure with IN PARAMETER, I tried the following without results
    SELECT * FROM procedure_name(parameter);
    PROCEDURE procedure_name(parameter);
    EXEC procedure_name(parameter);
    CALL procedure_name(parameter);
    Please help me....

    Hi,
    As Beijing said,
    EXEC procedure_name(parameter);
    CALL procedure_name(parameter);work for me.
    So does
    BEGIN
        procedure_name(parameter);
    END;Can you be more specific about what you're doing? That is, are you testing it in SQL Developer? Where are you entering the commands? Where are you looking for output? Do you get error messages? Does anything else (like "SELECT SYSDATE FROM dual;") work?

Maybe you are looking for

  • Error saving xml from model to file

    Hello. I am trying to create an xml file based on example GEO_DIM.dtd I have a dataserver jdbc:snps:xml?d=/oracle/product/odi_1/oracledi/demo/xml/GEO_DIM.dtd&s=MY_GEO_SCHEMA&lf=/logs/demo_geo_dim.log&ll=31 xml model works fine. I can do Insert into a

  • Watching adobe tv

    I can not see/play videos on adobe tv.  just shows a black screen in the tv area.  I can watch it on my wifes computer, so I figure the problem is in my computer settings. please help?

  • How to add customer specific text in MEDRUCK form?

    Hi ALL,         I am new to sap script area. I have done more analysis for my query. Question: How can we add some text for particular customer? I have tried on calling subroutines and tried for includes via S010 entries.. but i am failed to add the

  • Can't access anything on macbook pro

    I am having severe issues with my macbook pro not booting up passed the logo screen.  I can't open recovery as the hd wasn't partitioned, nor can I access AH to determine why. I've tried everything step by step to no avail.  It doesn't beep so I'm no

  • Why is there a green screen when trying to watch any videos on any website?

    I currently having trouble trying to watch any type of videos. On Youtube, Abc Player, any videos I try to watch all it gives me a green screen. Audio is playing fine. But the display is just a green sreen. I've tried about all I can do but it gives