Stored procedures for User Tables

Can somebody please help me with this matter?. I need to add stored procedures for user tables. Is there any way  of doing so?.
Thanks in advance.
Ernesto.

Ernesto,
You have posted multiple threads for the same question.  Please check the other thread and close this one:
Stored procedures in User Tables
Thanks,
Gordon

Similar Messages

  • Stored procedure for creating tables

    Is it possible to create a stored procedure which only contains create tables? I prepare everything on an environment and want to transfer everything, except the data, on anothe environment. Therfore I thought of an stored procedure which does everything automatically. Additional I want to create a package which contains all necessary stored procedures (which are already finished). Is it better to insert the create-table-lines in the package?
    Thanks for your help!

    PL/SQL is not the appropriate tool for this.
    What does Oracle RDBMS products like Apex use to install? SQL*Plus scripts. A combination of SQL code and anonymous PL/SQL blocks.
    This is also what we use to install any one of a dozen Oracle systems we have developed.. it is as simple as running 'sqlplus "/ as sysdba" @installer <tablespace> <schema> <password>'.
    Trying to do this type of thing in PL/SQL... lots of disadvantages, lots of complexities, and very little (if any) benefit.

  • Stored Procedure for Accounts Receivable

    Hi. First off, apologies in advance if I have put this question into the wrong topic. Secondly, I first saw SAP 3 weeks ago when I stared my new job and have had no training so please bear with me if some of what I ask doesn't make much sense.
    OK, the issue is this.  In SAP B1, there is a built in Report called "Customer Receivables Aging" which allows you to see Customer Receivable Accounts by age (e.g 0-30, 31-60, 61-90, 90+) and so on.  The problem with the built in report is that it doesn't show all the fields I want - it only shows the Customer Name, balance, and then the aging balances.  I want to be able to see things like the customer's contact details, etc. I know this makes no sense because the whole point of the report is to be able to drill down into the different rows, but this report needs to be issued in printed form, hence the need for the extra fields.
    Since I can't seen any way from within SAP to change the fields returned by this report, I thought I'd have a stab at writing my own SQL to select out the same data along with the extra fields I wanted.  That's when the problems began...try as I might, I cannot get my figures to tally with the SAP Report.
    They are almost correct, but not quite. I am sure that I am missing a selection or some other element of the logic that B1 uses to create the built in report.
    If you want, I can post the SQL I'm using....I'm not an SQL guru by any means, but I do know my way around it; the biggest problem I have is that I cannot find any documentation as to the 4 letter tables that SAP uses and their relationships except on the most basic level (e.g ORIN is Open Return Invoice [maybe])
    Then I thought maybe it might be possible to edit that report section in B1 using the SDK.  That would be a better solution as I would not have to 'reinvent the wheel', I can just SELECT an extra field or three to include in the report.
    So my question is
    ->Does anyone have a stored procedure for SQL Server that can replicate correctly the SAP B1 "Customer Receivable Aging", even just the process SAP uses to gather this data would be good.
    OR
    is it possible to edit this report in SAP to put in the extra fields I want.
    Or, am I totally barking up the wrong tree? Thanks in advance, I know this is a long post.

    Hi Stephen,
    There should be a print layout attached to the on-screen report. This can be altered to show the additional fields you want without resorting to SDK or SQL development.
    When you have the Customer Receivables Ageing report open on screen, choose Tools-Print Layout Designer or click on the Print Layout Designer icon on the toolbar. When prompted, choose the layout you wish to edit and you'll be taken to the layout design. In the layout, you can add additional fields and should be able to add most business partner fields. As the report is set to portrait by default, I recommend changing it to landscape so you have lots more space to add the extra fields you want. This report writer is fairly intuitive, if a little basic.
    You will need to save this new report design, set it to be the default layout and then when you select to print the Customer Receivables Ageing report (ie Print Preview or Print) you will see the new report.
    Hope this helps,
    Owen

  • Stored Procedure for restrict to close documents

    Hi,
    I want to create a Stored Procedure for restrict to close sales orders for some users, because in Standard Authorizations you have one option to restrict to close, but I need that some users can close quotations and also this users can´t close sales orders. I have this query :
    F @object_type='17' AND (@transaction_type='a' or @transaction_type='U' )
    BEGIN
    IF EXISTS (
    SELECT T0.DOCENTRY FROM adoc T0 WHERE T0.[ObjType] = '17'
    AND T0.[UserSign] = '1' AND    T0.[DocStatus] = 'C'   AND
    T0.DOCENTRY= @list_of_cols_val_tab_del )
    BEGIN
    SELECT @Error = 1, @error_message = 'You are not permitted to close Sales Orders'
    END
    END
    But It doesn´t work. I need help!!!
    Thanks

    Hi Jose,
    You have to correct your transaction type parameters.  When you perform close or cancel operations on document; the trasnsaction notification receives parameters u201CCu201D for Cancel and u201CLu201D for Close. So instead of checking add u201CAu201D or update u201CUu201D;  you have to modify your transaction type filters for cancel u201CCu201D or close u201CLu201D.  It will go like belowu2026
    IF @object_type='17' AND (@transaction_type='C' or @transaction_type='L')
    Please try above and let me know the results.
    Thanks & Regards,
    Nitin
    Manager, SAP Business One
    Greytrix
    It's time to think outside the box.
    Email: sap at greytrix.com | Web: www.greytrix.com
    u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    Development Partners for SAP B1

  • Stored procedure for arhive

    I created a stored procedure for send data from a source bd to the bd destination with a link between BD
    But it will not work
    CREATE OR REPLACE PROCEDURE archivage ( source IN VARCHAR2, destination IN VARCHAR2)
    BEGIN
    / * - Prepare a cursor to select from the bd_source: * /
    source_cursor: = dbms_sql.open_cursor;
    DBMS_SQL.PARSE (source_cursor,
    'SELECT table_name FROM dba_tables' | | source,DBMS_SQL.NATIVE);
    LOOP i in source_cursor
    /* Or i use this !!!!
    SELECT object_name FROM dba_objects WHERE owner = 'SCOTT' AND object_type = 'TABLE'*/
    DBMS_SQL.DEFINE_COLUMN (source_cursor, i);
    end loop
    ignorer: DBMS_SQL.EXECUTE = (source_cursor);
    / * - Prepare a cursor to insert into the destination db: * /
    destination_cursor: = DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE (destination_cursor,
    'INSERT INTO' | | destination | | DBMS_SQL.NATIVE);
    / * - Fetch a row from the source table and insert it into the destination table: * /
    loop
    if DBMS_SQL.FETCH_ROWS (source_cursor)> 0 ALORS
    - Obtenir des valeurs de colonne de la ligne
    DBMS_SQL.COLUMN_VALUE (source_cursor,i);
    DBMS_SQL.BIND_VARIABLE (destination_cursor,i);
    ignorer: DBMS_SQL.EXECUTE = (destination_cursor);
    ELSE
    EXIT;
    End If;
    END LOOP;
    /*-Close cursor */
    COMMIT;
    DBMS_SQL.CLOSE_CURSOR (source_cursor);
    DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    EXCEPTION
    WHEN OTHERS, THEN
    if
    DBMS_SQL.IS_OPEN (source_cursor)then
    DBMS_SQL.CLOSE_CURSOR (source_cursor);
    End If;
    if DBMS_SQL.IS_OPEN (destination_cursor) then
    DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    End If;
    RAISE;
    END;

    find 10 differences ... :(
    CREATE OR REPLACE PROCEDURE archivage (source        IN VARCHAR2,
                                           destination   IN VARCHAR2)
    IS
       source_cursor        INTEGER;
       destination_cursor   INTEGER;
       ignorer              INTEGER;
    BEGIN
       /* - Prepare a cursor to select from the bd_source: */
       source_cursor := DBMS_SQL.open_cursor;
       DBMS_SQL.
        PARSE (source_cursor,
               'SELECT table_name FROM dba_tables' || source,
               DBMS_SQL.NATIVE);
       FOR i IN source_cursor
       LOOP
          /* Or i use this !!!!
          SELECT object_name FROM dba_objects WHERE owner = 'SCOTT' AND object_type = 'TABLE'*/
          DBMS_SQL.DEFINE_COLUMN (source_cursor, i);
       END LOOP;
       ignorer := DBMS_SQL.EXECUTE (source_cursor);
       /* - Prepare a cursor to insert into the destination db: */
       destination_cursor := DBMS_SQL.OPEN_CURSOR;
       DBMS_SQL.
        PARSE (destination_cursor,
               'INSERT INTO ' || destination,
               DBMS_SQL.NATIVE);
       /* - Fetch a row from the source table and insert it into the destination table: */
       LOOP
          IF DBMS_SQL.FETCH_ROWS (source_cursor) > 0
          THEN
             --ALORS
             -- Obtenir des valeurs de colonne de la ligne
             DBMS_SQL.COLUMN_VALUE (source_cursor, i);
             DBMS_SQL.BIND_VARIABLE (destination_cursor, i);
             ignorer := DBMS_SQL.EXECUTE (destination_cursor);
          ELSE
             EXIT;
          END IF;
       END LOOP;
       /*-Close cursor */
       COMMIT;
       DBMS_SQL.CLOSE_CURSOR (source_cursor);
       DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    EXCEPTION
       WHEN OTHERS
       THEN
          IF DBMS_SQL.IS_OPEN (source_cursor)
          THEN
             DBMS_SQL.CLOSE_CURSOR (source_cursor);
          END IF;
          IF DBMS_SQL.IS_OPEN (destination_cursor)
          THEN
             DBMS_SQL.CLOSE_CURSOR (destination_cursor);
          END IF;
          RAISE;
    END;
    /

  • Stored procedure for getting host name, host instance and status of that host is it running or stopped.

    Hello all,
    yesterday I got one task in that I have to stored procedure for getting host name, host instance and status of that host is it running or stopped.
    any body knows where exactly, In which table this details are there in BizTalk databases.
    thanks

    Status of the host instance is not stored in the SQL database for you to query the status using stored procedure. You have to either use Powershell or WMI to get the status.
    In SQL, following table contains the details about the host like Name, LoginName, IsDisables etc but status of the host instance is not stored in the database.
    SELECT * FROM BizTalkMgmtDb..adm_HostInstance
    Powershell to get the status:
    http://axonolympus.nl/?page_id=186&post_id=969&cat_id=6&lang=en
    WMI to get the status:
    https://msdn.microsoft.com/en-us/library/aa561820.aspx?f=255&MSPPError=-2147217396
    https://msdn.microsoft.com/en-us/library/aa578621.aspx
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Stored procedure for disabling all foreign key constraints ?

    hi all,
    I need a stored procedure for disabling / enable all constraints in that database schema.
    Create or replace procedure enable_disable_proc(status varchar2(3),schema_name varchar2(20))
    ---> where 'status' parameter condition should be ( YES for enable) (NO for disable)
    ---> 'schema_name' is a parameter where ,only this schema should be affected with this procedure..
    Thanks in Advance..

    Hi,
    Try this code
    /* Formatted on 2009/07/16 08:15 (Formatter Plus v4.8.8) */
    CREATE PROCEDURE enab_disab_proc (
       enforce          IN   VARCHAR2,
       current_schema   IN   VARCHAR2
    IS
       v_alter_table_sql   VARCHAR2 (2000);
    BEGIN
       FOR rec_con IN (SELECT table_name, constraint_name
                         FROM user_constraints
                        WHERE owner = current_schema)
       LOOP
          IF (enforce = 'NO')
          THEN
             v_alter_table_sql :=
                   ' alter table '
                || current_schema
                || '.'
                || rec_con.table_name
                || ' disable constraint '
                || rec_con.constraint_name;
          ELSE
             v_alter_table_sql :=
                   ' alter table '
                || current_schema
                || '.'
                || rec_con.table_name
                || ' enable constraint '
                || rec_con.constraint_name;
          END IF;
          EXECUTE IMMEDIATE v_alter_table_sql;
       END LOOP;
    END;Edited by: Salim Chelabi on 2009-07-16 05:15

  • Calling a stored procedure for each row returned

    I need to call a stored procedure for each row returned by a repeating frame. I called the stored procedure from the repeating frame format trigger, but that did not work( it did no populated the tables populated by the stored procedure)
    How can I call a stored procedure for each row returned by a repeating frame.
    Thank you

    Include it as a formula column in your data model.

  • Stored procedure accessing system table

    I am using a stored procedure to access tables in other schemas. I pass the schema and table name as parameters to the stored procedure. I use these two variables to create a cursor of column names from all_tab_columns table. When I access all_tab_columns from SQL Plus, the right result is returned. When the procedure executes the same select statement in the same schema and using the same search criteria, the table I am looking for can not be found.
    Example:
    select count(column_name) from all_tab_columns where owner = 'MYADM' and table_name = 'MYTABLE';
    This will return the correct number of columns when executed in SQL Plus.
    cursor mycursor is
    select count(column_name) from all_tab_columns where owner = p_owner and table_name = p_table;
    This cursor, when used in my stored procedure, finds nothing when p_owner is set to MYADM and p_table is set to MYTABLE.
    I've tried granting all permissions to the calling schema with no positive results. I am aware that the calling schema is not required to have the necessary privileges when a procedure accesses data in other schemas. So I don't understand what the problem is. I greatly appreciate anyone's help.
    Cyrus

    Hi,
    try this, probaly this'll give you the desired output :
    Procedure Column_cnt
    ( p_owner IN varchar2,
    p_table IN varchar2 ) IS
    cursor c1 is
    select count(column_name) col_cnt from all_tab_columns where owner = upper(p_owner)
    and table_name = upper(p_table);
    BEGIN
    for i in c1 loop
    dbms_output.put_line(i.col_cnt);
    end loop;
    END;
    Now from SQLPLUS type :
    exec column_cnt('OWNER','TABLE_NAME')
    Note: parameters are in Varchar2, so they should be within quotes.
    But do you really want a cursor to store a single row, single column value, cursors are for fetching multiple rows/columns that means for a result set.
    if you want to get only count(column_name) then you could re-write the procedure like this way :
    Procedure Column_cnt
    ( p_owner IN varchar2,
    p_table IN varchar2 ) IS
    col_cnt number;
    BEGIN
    select count(column_name) into col_cnt from all_tab_columns where owner = upper(p_owner)and table_name = upper(p_table);
    dbms_output.put_line(i.col_cnt);
    END;
    Thanks
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by cyrus eslami ([email protected]):
    I am compiling and invoking the procedure in a schema that has the correct privileges granted to it.
    -Cyrus<HR></BLOCKQUOTE>
    null

  • Using a stored procedure for a  sender jdbc adapter

    Hi all,
    The requirement is to use a stored procedure, for extracting data from a oracle database.
    Is it possible to do this.
    If yes, what should be the source structure in this case.
    Please help with the exact soln.
    Thanks!!
    Younus

    Hi,
    Did you check the blog pointed by Aamir?
    /people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
    You will need to use Oracle Functions instead of Oracle Stored Procedures. Read thru the blog and the note pointed in the blog . Think it is quite a good example.
    Regards
    Bhavesh

  • Stored Procedure uses Temp Tables

    C#, asp.net app.
    I have a stored procudure that outputs data to temp tables. The data in these tables is only there for the life of that connection. The stored procedure does NOT return data.
    Options I see so far:
    1) If I open a connection and execute the stored procudure, how can I get crystal to use the SAME connection object?
    2) Can I get crystal to call the stored procedure for me first (but remember, it doesn't use the sp as the actual data source). Would I still be able to supply parameters to the SP?
    3) I guess I could do everything myself, even load all the data out of the temp tables into local datasets. And then supply the datasets to the tables. I tried this and I called SetDataSource on all my tables but then it looks like it still tried to go to the server again as I got a login screen.

    Hello Happy,
    No, Crystal does not have any access to those temp tables. They are locked by the owner who made the call and we have no API available in .NET that you can ride on to get access. Unless you can figure out a way at runtime to give full permission to the temp table then CR can use it. You just need to set the datasource to the temp table name at runtime. You will need to create the table so a report can be designed off it first but once done as long as the structure doesn't change the report will continue to work.
    Other options are as you have tried using data sets. Another option is to export that data into a database so CR has access to it rather than using temp tables. Once the report is done you can use MS API's to delete all rows of data.
    Thank you
    Don

  • Stored Procedure For Web Service in Visual Composer 7.1

    Hello,
    I want to use stored procedure for Webservice in Visual Composer 7.1
    I can find this Web service but not supported. ( ex) prcreleased_test - Not supported )
    Log.
    Message: Error in connection - Can' t execute Web service.
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.processExecution: 
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb
    Log2
    Message: Stopped further execution since the interpreter is unusable
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.XGLInterpreter
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb '
    Help me^^ plz..

    Hi Tanna.
    Thanks for your reply^^
    I create webservice that access my stored procedure.
    But not supported.
    http://dmp.humaxdigital.com/HumaxCmdwService/Service1.asmx?wsdl
    There are two service. (Hello World - Test, prcrelease_test - Stored Procedure )
    'Hello World' is supported but prcrelease_test is not supported. I can't drag to storyboard.
    Our company's DB is MSSQL2005.
    please help me^^

  • Stored Procedure for Crystal Reports

    Hi All,
    I developed this test stored procedure to see wheather we could a stored procedure for crystal reports. It compiled without any problem, but when I run it, it gives me error message. Here is the stored Procedure..
    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(
    TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
    TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    AS
    BEGIN
    OPEN TEST_CURSOR FOR
    SELECT *
    FROM TEST_TABLE
    WHERE TEST_TABLE.ID = TEST_PARAMETER;
    END TEST_PROCEDURE;
    And
    This is the error message..
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'TEST_PROC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    I have created the package sucessfully.
    I was wondering If any one of you can advice me where I am making the mistake.
    Thank you

    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
                                                         TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    ...you have 2 parameters in your procedure WOLD1SIM.TEST_PROCEDURE(). you should also use two parameters when you execute the procedure.

  • Stored Procedure for Batch Number Format and Block Duplicate Batch Number

    Hi Experts !
    I am new one in forum asking question.. I want Stored procedure for Batch Number Format. I want fix one Batch number format in Stored Procedure.
    Example :
    My Batch number format Like  BATCH00001 - It should be first five digit is text format and next five is Numeric.
    IF create Goods receipt PO or Goods receipt stage I create batch number like BATCH 00001 or any other number means don't add that document and also duplicated batch number also does not allowed. please give me the solutions. I am sorry for my bad english .

    Dear Nagarajan K.
                         Thanks for your replay ..
    IF @transaction_type IN ('A','U') AND (@object_type = '106' )
    BEGIN
    set @item = LEFT( @list_of_cols_val_tab_del, CHARINDEX(CHAR(9),  @list_of_cols_val_tab_del,1) - 1)
    set @batch = substring(@list_of_cols_val_tab_del, len(@item)+1, (CHARINDEX(CHAR(9),  @list_of_cols_val_tab_del,len(@item)+2)) - (len(@item)+1))
    --set @base =( select basetype from ibt1 where batchnum = ltrim(rtrim(replace(@batch,char(9),''))))
    set @count = (select count(*) from oibt quantity > 0 and where  batchnum = ltrim(rtrim(replace(@batch,char(9),''))))
    if @count > 1
    begin
    set @error = 1
    set @error_message = 'Please enter different Batch Code for batch ''' + @batch + ''' for item ' + @item 
    select @error, @error_message
    END
    END
                  I used above Stored Procedure. here we can use one batch number for different item but  i want to block one batch we should use one item and one time only after than we never use that batch number for same item and another item.
             After that I want format for Batch, we should follow unique Batch number for all items.

  • Stored Procedure for lead code to be entered in sales order

    Hi All,
    I was trying to work on stored procedure for lead code not to be allowed to enter in sales order.
    It is system behaviour that it is allowing to take even lead code in sales order and add the transaction but my customer wants to block if any one of you could help me out to develop stored procedure.
    Thanks & regards-
    Monika

    Hi Monika,
    Try:
    If @object_type='17' and @transaction_type IN ('A','U')
    BEGIN
    If Exists (Select T0.DocEntry from ORDR
    Where T0.CardCode IN (SELECT CardCode FROM OCRD WHERE CardType = 'L')
    And T0.DocEntry = @list_of_cols_val_tab_del)
    Begin
    Select @error = 17, @error_message = 'Lead is not allowed for Sales Order'
    End
    END
    Thanks,
    Gordon

Maybe you are looking for

  • Sync problem:  Why doesn't my phone show up in itunes to sync music, calanders,photos

    I recently switched to icloud.  When I connected my phone to my computer and went to itunes, my phone no longer appeared in the list.  This is where I am used to manually adding photos nd mucic from my libraries and other manual functions I perform. 

  • Problem on 10gr2 for configure HS talk to mysql through ODBC

    Hello, all, did someone tried configure HS on 10gr2 talk to mysql 3.5 on xp? I tried it on my environment and got some issues here. any advice will be appreciated: 1) environment: OS=xp professional sp2. oracle database=10gr2. mysql database=mysql 3.

  • Pre-order is being axed...

    My friend just got a call from bestbuy that his pre-orders for white one is no longer guaranteed and they are not sure when he will get it. He is very upset because most of other places are now even taking pre-orders for black ones. Basically, he was

  • Session in javafx

    Hey all, I have a project with backend EJB+(RESTful) webservice that uses JAAS for the security. I'd like to know if there is any possibility to keep a session in JavaFx who checks the backend once, asks to login and then keep the credentials (name,

  • ARE-1 Docs.

    Hi Gurus, How we can see all  the ARE-1 Docs? Thanks and Regards