How to write a procedure for update the table

Hi all
can any body please tell me how to write a procedure to update the table......
I have a table with about 10,000 records...........Now I have add a new column and I want to add values for that like
registration Code Creidits
13213 BBA
1232 MCS
I had add the creidit now i want to update the table.........the new value want to get by SQL like
Creidit = select creidit from othere_table...........
Hope u can understand my problem
Thanks in advance
Regards
Shayan
[email protected]

Please try the following --
update Program_reg a
set TotalCreidit = ( select tot_cr <Accroding to your logic>
                            from Program_reg b
                            where a.Registration = b.Registration
                            and    a.Enrollment = b.Enrollment
                            and    a.code = b.code
where a.Registration in ( select distinct Registration
                                    from Program_reg );
N.B.: Not Tested....
Regards.
Satyaki De.

Similar Messages

  • How to write a procedure to run the call the custom package from backend

    Hi All
    Oracle 10g
    Oracle Apps R12
    I am working with oracle order management here we have a customize Package called (Pick Release).Due to some problem we have running this concurrent program by manually giving Route_id as parameter. The route_id is taken from the route Table. By using this query
    select distinct route_id from route@DB_LINK_APPS_TO_ROADSHOW
    where trunc(route_date) = trunc (sysdate+2).
    so daily we have nearly 42 routes and we are running this concurrent program manually nearly times.
    so now how to write a procedure for this
    Step 1 Getting the route from route table.( By cursor we can get the route_id Accordingly)
    Step 2 How to trigger the custom package from back end and execute accordingly to that output of the cursor(route_id)
    If the cursor get 40 routes is it then the concurrent program runs 40 times according to that route_id.
    can some could provide the steps to do this
    Thanks & Regards
    Srikkanth.M

    This is about 4 or 5 lines of PL/SQL and the name of the custom package is not provided.
    If you request someone in this forum to do your work for free -because obviously you didn't even try to write it, which must be considered abusing this forum- you must at least provide sufficient info so someone can do it.
    And no, I won't do it for you.
    Sybrand Bakker
    Senior Oracle DBA

  • Procedure to update the table records

    I have to write a procedure to update the existing records.
    I have one staging table and one decode table.
    staging table is obtained from a interface with cross join of two tables X1 and X2 and
    lookup with DECODE table.
    DECODE
    ITEM_ID ITEM_CODE STORE_ID STORE_CODE
    101 C 7 77
    100 A
    100 B
    In this table there is relation between item_id and item_code AND
    store_id and store_code. Items and stores have no relationship here. Simply we insert values of both side by side.
    Initial STAGING table
    SNO RNO SCODE RCODE DECODE_STATUS
    101 8 C NP
    101 6 C NP
    101 7 C 77 P
    100 8 A NP
    100 6 A NP
    100 7 A 77 P
    100 8 B NP
    100 6 B NP
    100 7 B 77 P
    Joins:
    SNO=ITEM_ID
    RNO=STORE_ID
    Now I want to update this according to my new decode where NP record will be updated with their new RCODE values
    DECODE table now is
    ITEM_ID ITEM_CODE STORE_ID STORE_CODE
    101 C 8 88
    100 A 7 77
    100 B 6 66
    Now I need my staging table with RCODE values corresponing to DECODE table.
    My expected STAGING table.
    SNO RNO SCODE RCODE DECODE_STATUS
    101 8 C 88 NP
    101 6 C 66 NP
    101 7 C 77 P
    100 8 A 88 NP
    100 6 A 66 NP
    100 7 A 77 P
    100 8 B 88 NP
    100 6 B 66 NP
    100 7 B 77 P
    Please help me to do this ...I have tried with interface where I kept source and target table same staging table and used DECODE for lookup but I didnt get the expected result.

    Hi Chattar ,
    It clearly seems that issue is with Primary keys.
    As you have said about the decode table "In this table there is relation between item_id and item_code AND store_id and store_code. Items and stores have no relationship here. Simply we insert values of both side by side."
    It seems your final update query should be like this :
    update staging1 T
    set (T.rcode, T.scode)
    =
    Select
    (select store_code from decode where store_id = T.RNO ) ,
    (SELECT ITEM_CODe from decode where ITEM_id = T.SNO)
    from dual
    ) where T.decode_status = 'NP';
    If what i have said is right , then you can implement the same using an interface too But first you should decide the Key columns on the target table.
    Hope it solves the issue.
    Edited by: user8427112 on Sep 22, 2012 6:48 AM

  • How to write a procedure to load the data into a table using xml file as input to the procedure?

    Hi,
    Iam new to the xml,
    can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
    <?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>.
    Regards,
    vikram.

    here is the your XML parse in 11g :
    select *
      from xmltable('//Entity' passing xmltype
    '<?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>
    ') columns
      "dcode" varchar2(4000) path '/Entity/dcode',
      "ddesc" varchar2(4000) path '/Entity/ddesc',
      "reauthflag" varchar2(4000) path '/Entity/reauthflag'
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    Using this parser you can create procedure as
    SQL> create or replace procedure myXMLParse(x clob) as
      2  begin
      3    insert into MyXmlTable
      4      select *
      5        from xmltable('//Entity' passing xmltype(x) columns "dcode"
      6                      varchar2(4000) path '/Entity/dcode',
      7                      "ddesc" varchar2(4000) path '/Entity/ddesc',
      8                      "reauthflag" varchar2(4000) path '/Entity/reauthflag');
      9    commit;
    10  end;
    11 
    12  /
    Procedure created
    SQL>
    SQL>
    SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
    PL/SQL procedure successfully completed
    SQL> select * from MYXMLTABLE;
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    SQL>
    Ramin Hashimzade

  • How to write select query for all the user tables in database

    Can any one tell me how to select the columns from all the user tables in a database
    Here I had 3columns as input...
    1.phone no
    2.memberid
    3.sub no.
    I have to select call time,record,agn from all the tables in a database...all database tables have the same column names but some may have additional columns..
    Eg: select call time, record,agn from ah_t_table where phone no= 6186759765,memberid=j34563298
    Query has to execute not only for this table but for all user tables in the database..all tables will start with ah_t
    I am trying for this query since 30days...
    Help me please....any kind of help is appreciated.....

    Hi,
    user13113704 wrote:
    ... i need to include the symbol (') for the numbers(values) to get selected..
    eg: phone no= '6284056879'To include a single-quote in a string literal, use 2 or them in a row, as shown below.
    Starting in Oracle 10, you can also use Q-notation:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements003.htm#i42617
    ...and also can you tell me how to execute the output of this script. What front end are you using? If it's SQL*Plus, then you can SPOOL the query to a file, and then execute that file, like this:
    -- Suppress SQL*Plus features that interfere with raw output
    SET     FEEDBACK     OFF
    SET     PAGESIZE     0
    -- Run preliminary query to generate main query
    SPOOL     c:\my_sql_dir\all_ah_t.sql
    SELECT       'select call time, record, agn from '
    ||       owner
    ||       '.'
    ||       table_name
    ||       ' where phone_no = ''6186759765'' and memberid = j34563298'
    ||       CASE
               WHEN ROW_NUMBER () OVER ( ORDER BY  owner          DESC
                              ,        table_name      DESC
                              ) = 1
               THEN  ';'
               ELSE  ' UNION ALL'
           END     AS txt
    FROM       all_tables
    WHERE       SUBSTR (table_name, 1, 4)     = 'AH_T'
    ORDER BY  owner
    ,       table_name
    SPOOL     OFF
    -- Restore SQL*Plus features that interfere with raw output (if desired)
    SET     FEEDBACK     ON
    SET     PAGESIZE     50
    -- Run main query:
    @c:\my_sql_dir\all_ah_t.sql
    so that i form a temporary view for this script as a table(or store the result in a temp table) and my problem will be solved..Sorry, I don't understand. What is a "temporary view"?

  • How to generate test data for all the tables in oracle

    I am planning to use plsql to generate the test data in all the tables in schema, schema name is given as input parameters, min records in master table, min records in child table. data should be consistent in the columns which are used for constraints i.e. using same column value..
    planning to implement something like
    execute sp_schema_data_gen (schemaname, minrecinmstrtbl, minrecsforchildtable);
    schemaname = owner,
    minrecinmstrtbl= minimum records to insert into each parent table,
    minrecsforchildtable = minimum records to enter into each child table of a each master table;
    all_tables where owner= schemaname;
    all_tab_columns and all_constrains - where owner =schemaname;
    using dbms_random pkg.
    is anyone have better idea to do this.. is this functionality already there in oracle db?

    Ah, damorgan, data, test data, metadata and table-driven processes. Love the stuff!
    There are two approaches you can take with this. I'll mention both and then ask which
    one you think you would find most useful for your requirements.
    One approach I would call the generic bottom-up approach which is the one I think you
    are referring to.
    This system is a generic test data generator. It isn't designed to generate data for any
    particular existing table or application but is the general case solution.
    Building on damorgan's advice define the basic hierarchy: table collection, tables, data; so start at the data level.
    1. Identify/document the data types that you need to support. Start small (NUMBER, VARCHAR2, DATE) and add as you go along
    2. For each data type identify the functionality and attributes that you need. For instance for VARCHAR2
    a. min length - the minimum length to generate
    b. max length - the maximum length
    c. prefix - a prefix for the generated data; e.g. for an address field you might want a 'add1' prefix
    d. suffix - a suffix for the generated data; see prefix
    e. whether to generate NULLs
    3. For NUMBER you will probably want at least precision and scale but might want minimum and maximum values or even min/max precision,
    min/max scale.
    4. store the attribute combinations in Oracle tables
    5. build functionality for each data type that can create the range and type of data that you need. These functions should take parameters that can be used to control the attributes and the amount of data generated.
    6. At the table level you will need business rules that control how the different columns of the table relate to each other. For example, for ADDRESS information your business rule might be that ADDRESS1, CITY, STATE, ZIP are required and ADDRESS2 is optional.
    7. Add table-level processes, driven by the saved metadata, that can generate data at the record level by leveraging the data type functionality you have built previously.
    8. Then add the metadata, business rules and functionality to control the TABLE-TO-TABLE relationships; that is, the data model. You need the same DETPNO values in the SCOTT.EMP table that exist in the SCOTT.DEPT table.
    The second approach I have used more often. I would it call the top-down approach and I use
    it when test data is needed for an existing system. The main use case here is to avoid
    having to copy production data to QA, TEST or DEV environments.
    QA people want to test with data that they are familiar with: names, companies, code values.
    I've found they aren't often fond of random character strings for names of things.
    The second approach I use for mature systems where there is already plenty of data to choose from.
    It involves selecting subsets of data from each of the existing tables and saving that data in a
    set of test tables. This data can then be used for regression testing and for automated unit testing of
    existing functionality and functionality that is being developed.
    QA can use data they are already familiar with and can test the application (GUI?) interface on that
    data to see if they get the expected changes.
    For each table to be tested (e.g. DEPT) I create two test system tables. A BEFORE table and an EXPECTED table.
    1. DEPT_TEST_BEFORE
         This table has all EMP table columns and a TEST_CASE column.
         It holds EMP-image rows for each test case that show the row as it should look BEFORE the
         test for that test case is performed.
         CREATE TABLE DEPT_TEST_BEFORE
         TESTCASE NUMBER,
         DEPTNO NUMBER(2),
         DNAME VARCHAR2(14 BYTE),
         LOC VARCHAR2(13 BYTE)
    2. DEPT_TEST_EXPECTED
         This table also has all EMP table columns and a TEST_CASE column.
         It holds EMP-image rows for each test case that show the row as it should look AFTER the
         test for that test case is performed.
    Each of these tables are a mirror image of the actual application table with one new column
    added that contains a value representing the TESTCASE_NUMBER.
    To create test case #3 identify or create the DEPT records you want to use for test case #3.
    Insert these records into DEPT_TEST_BEFORE:
         INSERT INTO DEPT_TEST_BEFORE
         SELECT 3, D.* FROM DEPT D where DEPNO = 20
    Insert records for test case #3 into DEPT_TEST_EXPECTED that show the rows as they should
    look after test #3 is run. For example, if test #3 creates one new record add all the
    records fro the BEFORE data set and add a new one for the new record.
    When you want to run TESTCASE_ONE the process is basically (ignore for this illustration that
    there is a foreign key betwee DEPT and EMP):
    1. delete the records from SCOTT.DEPT that correspond to test case #3 DEPT records.
              DELETE FROM DEPT
              WHERE DEPTNO IN (SELECT DEPTNO FROM DEPT_TEST_BEFORE WHERE TESTCASE = 3);
    2. insert the test data set records for SCOTT.DEPT for test case #3.
              INSERT INTO DEPT
              SELECT DEPTNO, DNAME, LOC FROM DEPT_TEST_BEFORE WHERE TESTCASE = 3;
    3 perform the test.
    4. compare the actual results with the expected results.
         This is done by a function that compares the records in DEPT with the records
         in DEPT_TEST_EXPECTED for test #3.
         I usually store these results in yet another table or just report them out.
    5. Report out the differences.
    This second approach uses data the users (QA) are already familiar with, is scaleable and
    is easy to add new data that meets business requirements.
    It is also easy to automatically generate the necessary tables and test setup/breakdown
    using a table-driven metadata approach. Adding a new test table is as easy as calling
    a stored procedure; the procedure can generate the DDL or create the actual tables needed
    for the BEFORE and AFTER snapshots.
    The main disadvantage is that existing data will almost never cover the corner cases.
    But you can add data for these. By corner cases I mean data that defines the limits
    for a data type: a VARCHAR2(30) name field should have at least one test record that
    has a name that is 30 characters long.
    Which of these approaches makes the most sense for you?

  • How to write a formula for display the value by group

    Post Author: abadugu
    CA Forum: Formula
    Hi
    Could any one please help me on writing the formula for the below senario.
    I'm creating Crystal report Via using ClearQuest (IBM tool) since this tool is not supporting subreport function. I'm planning to write a formula.
    I have grouped report by request_type field (request_type field contains Validation Defect, Production Defect, Known Defect  etc..)
    right now my report output is grouped by request_type
    ex:
    Validation Defect
                         SUMMARY                                                          COMMENTS
    Production Defect
                       SUMMARY                                                          COMMENTS
    my question was
    If request_type = Production Defect  display  pm_number value field otherwise display null
    ex
    Production Defect
    PM#          SUMMARY                                                       COMMENTS
    Validation Defect
                     SUMMARY                                                       COMMENTS
    could you please help me writing a formula.
    Thanks
    Anand

    Post Author: abadugu
    CA Forum: Formula
    It worked Thank you and I appreciated your help
    Thanks

  • How to write Java script for refering the 1st page text field from 2nd page?

    Hello I am developing an VISITOR info interactive form with webdynpro ABAP, its with 2 pages. Their heirarchy is,
    VISITOR_form
        |
        |
        |------Page_1
        |            |
        |            |
        |            |------Text_Field_A_1
        |            |
        |            |------Text_Field_A_2
        |
        |------Page_2
                     |
                     |
                     |------Text_Field_B_1
                     |
                     |------Text_Field_B_2
    Now, i have selected the 'Text_Field_B_1' of page_2 and writing the Java script, my requirement is; If Page_1's 'Text_Field_A_2' has a value of "Value_ABCD", THEN the 'Text_Field_B_1' of page_2 should be 'readOnly'. Pls let me know Wht is the Java script for this requirement?

    if (xfa.event.newText=="ABCD")
    VISITOR_form.Page_2.Text_FieldB_1.access ="readOnly";
    place script on change event of Text_FieldA_2

  • How to write a procedure

    hii am new to oracle , can u help me how to write a procedure for the following query
    Transfer Funds between Accounts:
    Table: AccountMaster (AcctNo (primary key), AcctHolderName, currentBal
    Data: 1, 'A', 1000
    2, 'B', 3000
    3, 'C', 4000
    Function: getBalance (AcctNo)
    Stored Proc: tranferFunds (FromAcctNo IN, ToAcctNo IN, Amt IN, result OUT)
    The proc should use the function getBalance (AcctNo) to find out the current balance for account.
    The proc should return a value of 1 if the transfer was successful.
    It should return a value of -1 if the funds are not sufficient in the fromAccount to transfer.
    Thanx ,
    Raj0412

    I would start by asking your teacher to clarify the parts of the assignment that are not clear to you.
    You may also want to read some books.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm

  • Recordcount for all the tables in my user

    How I will get recordcount for all the tables in my user
    with a single query??
    Plz help.
    Thanx in advance.

    Not possible. As there can be any number of tables with any names, this requires dynamic SQL.
    SQL given to the Oracle SQL Engine cannot be dynamic ito scope and references - it must be static. For example, one cannot do this:
    SELECT count(*) FROM :table
    For the SQL Engine to parse the SQL, determine if it is valid, determine the scope and security, determine an execution plan, it needs to know the actual object names. Objects like tables and columns and functions cannot be variable.
    You will therefore need to write a user function (in PL/SQL) that dynamically creates a [SELECT COUNT] SQL for a table, execute that SQL and return the row count - and then use SQL to iterate through USER_TABLES for example and sum the results of this function.
    Note that object tables are not listed in USER_TABLES - thus a more comprehensive list of all table objects in your schema can be found in USER_OBJECTS.

  • Write a procedure to check the count is less than 1300 for every 3 hours

    Good Morning all,
    I want to write a procedure to check the count is less than 1300 for every 3 hours
    Query:*
    Select count(*) from sample where trx_date=sysdate;
    I want to run this query every 3 hours daily
    If the count is less than 1300 every 3 hours, we should sent a reminder mail like 'Data not copy'.
    Please help me how to write a procedure.

    hi there
    first
    --define the SMTP_OUT_SERVER parameter in your init.ora initialization file
    --ALTER SYSTEM SET smtp_out_server='my.domain.com' SCOPE=SPFILE;
    after that create a procedure
    CREATE OR REPLACE procedure SCOTT.hrsmail
    is
    v_count number;
    begin
    Select count(*)  into v_count from emp;
    if v_count < 1300
    then
      UTL_MAIL.send(sender    => '[email protected]',
                      recipients => '[email protected]',
                      cc         => '[email protected]',
                      bcc        => '[email protected]',
                      subject    => 'Testing the UTL_MAIL Package',
                      message    => 'If you get this, UTL_MAIL package
    else
    null;   --what you want to do here
    end if ;
    end;
    /we should create a job which run after every 3 hrs and send a reminder mail like 'Data not copy'.
    BEGIN
      SYS.DBMS_JOB.REMOVE(373);
    COMMIT;
    END;
    DECLARE
      X NUMBER;
    BEGIN
      SYS.DBMS_JOB.SUBMIT
      ( job       => X
       ,what      => 'begin hrsmail; end;'
       ,next_date => to_date('14/02/2011 18:39:29','dd/mm/yyyy hh24:mi:ss')
       ,interval  => 'SYSDATE+3/24 '
       ,no_parse  => FALSE
      SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    COMMIT;
    END;
    /hope this will help you
    Regards
    Hitesh
    Edited by: Hitesh Nirkhey on Feb 14, 2011 3:34 PM

  • Need Assistance to write a procedure for the below requirements!!!

    Hi Forum,
    Could some body give me a hand in writing an oracle procedure to pull the results as per the below requirement
    A JOBNUM is transfered from the first JSP page to second JSP page and based on that JOBNUM I have to write a procedure to populate the second page
    I need to pull these feilds from the respective tables
    QM_JOB_NUM, QM_JOB_STATUS from QMI which matches the value of the JOBNUM from the first JSPpage
    QN_JOB_GPH_FILE, QN_COMMENTS from QNI where QM_JOB_NUM = QN_JOB_NUM
    VM_NAME concertnate with VM_SURNAME from VMI where QM_PROFILE = VM_PROFILE
    QF_NARRATIVE_1,QF_NARRATIVE_2,QF_NARRATIVE_3( if these feilds has any values in DB then only pull them, if not dont pull them.so, we need to put a IF condition) where QF_JOB_NUM = QM_JOb_NUM
    JI_DESC from JII where QM_USER_STATUS = JII_STATUS _CODE
    RR_NAME from RRI where QM_REP = RR_REP
    and
    a case condition to match the QM_JOB_STATUS to the string value ( LIVE, PENDING , CLOSED ) as the QM_JOB_STATUS stores in the database as the numerical values 1,2,3 and while displaying on to the web page I need to match to the correspond string value and display it
    if ( QM_JOB_STATUS ) = 1 then print to the webform LIVE
    if ( QM_JOB_STATUS ) = 2 then print to the webform PENDING
    if ( QM_JOB_STATUS ) = 3 then print to the webform CLOSED
    Thanks for your assistance.
    Cheers,
    Krishna.

    First off, you need to turn the requirement into a sql statement. If I followed things correctly, that would be something like:
    SELECT qmi.qm_job_num,
           DECODE(qmi.qm_job_status, 1, 'LIVE',
                                     2, 'PENDING',
                                     3, 'CLOSED') qm_job_status,
           qni.qn_job_gph_file,
           qni.qn_comments, vmi.vm_name||' '||vmi.vm_surname name,
           qfi.qf_narrative_1, qfi.qf_narrative_2, qfi.qf_narrative_3,
           jii.ji_desc, rri.rr_name
    FROM qmi
       JOIN qni ON qmi.qm_job_num = qni.qn_job_num
       JOIN vmi ON qmi.qm_profile = vmi.vm_profile
       LEFT JOIN qfi ON qmi.qm_job_num = qfi.qf_job_num
       JOIN jii ON qmi.qm_user_status = jii.jii_status_code
       JOIN rri ON qmi.qm_rep = rri.rr_rep
    WHERE  qmi.qm_job_num = p_jobnumP_jobnum in the query is the parameter you will pass to your stored proc.
    Next, you need to decide how many rows will be returned for a particular job number. If there will be more than one row, then you will probably need to return a ref cursor. If there will be only one row, then you could return either a set of variables, one for each column in the resultset, or a record type with a field for each column.
    If you are returning a ref cursor or a record type, then you probably want to build the stored proc as a function, if you are returning multiple variables, then you will need to build it as a procedure.
    So, to return a ref cursor, the signature of the function would look something like:
    CREATE FUNCTION get_page2 (p_jobnum IN qmi.qm_job_num%TYPE)
       RETURN sys_refcursor ASReturning a record type would be similar except that you would RETURN the record type you defined in the database.
    To return several variables in a procedure, the signature would look something like:
    CREATE PROCEDURE get_page2 (p_jobnum     IN  qmi.qm_job_num%TYPE,
                                p_status     OUT VARCHAR2,
                                p_gph_file   OUT VARCHAR2,
                                p_comment    OUT VARCHAR2,
                                p_name       OUT VARCHAR2,
                                p_narrative1 OUT VARCHAR2,
                                p_narrative2 OUT VARCHAR2,
                                p_narrative3 OUT VARCHAR2,
                                p_desc       OUT VARCHAR2,
                                p_rrname     OUT VARCHAR2) ASHTH
    John

  • Wanted to update the software now available, but it is asking for a pass code. As far as I remember in didn't put in any pass code , how do I settle this issue . Earlier updates were asking Apple ID but pass code for updating the new soft ware not known.

    Wanted to update the software now available, but it is asking for a pass code. As far as I remember in didn't put in any pass code , how do I settle this issue . Earlier updates were asking Apple ID but pass code for updating the new soft ware not known.

    Hello Kewal,
    Thank you for the details of the issue you are experiencing when trying to perform an update.  I recommend trying to update using iTunes, and as always, it is a good idea to make a backup first. 
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    Update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/ht4623
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Update my app. What is the correct procedure for updating an app/folio?

    I designed a folio in Indesign CS6 and created an app of the folio in adobe dps and succesfully uploaded it to the app store. Now I want to update my app. What is the correct procedure for updating an app/folio?

    no, just update your content and recreate the Single Edition App. Your certificate should still be valid so there is not need to recreate these.
    ... your App ID absolutely need to be the exact same one you used for the first version if you want to make sure this is an update.

  • How to write a procedure with the table name as an argument

    I'm very new to Oracle, usually developing in SQL server.
    I would like to write a procedure that accepts a table name and then does a
    SELECT * FROM [table name] order by CollectionDate.
    In SQL I would build up a varchar variable and then execute it.
    Thanks

    I often wonder why so many people new to Oracle want to do this as a first step, when most people who know what they are doing try and avoid it.
    SQL> create or replace function f (p_tab varchar2)
      2  return sys_refcursor as
      3    c sys_refcursor;
      4  begin
      5    open c for
      6      'select * from ' || p_tab || ' order by hiredate';
      7    return c;
      8  end;
      9  /
    Function created.
    SQL> var c refcursor
    SQL> exec :c := f('emp')
    PL/SQL procedure successfully completed.
    SQL> print c
    EMPNO ENAME      JOB          MGR HIREDATE      SAL   COMM DEPTNO
      7369 SMITH      CLERK       7902 12/17/1980    800            20
      7499 ALLEN      SALESMAN    7698 02/20/1981   1600    300     30
      7521 WARD       SALESMAN    7698 02/22/1981   1250    500     30
      7566 JONES      MANAGER     7839 04/02/1981   2975            20
      7698 BLAKE      MANAGER     7839 05/01/1981   2850            30
      7782 CLARK      MANAGER     7839 06/09/1981   2450            10
      7844 TURNER     SALESMAN    7698 09/08/1981   1500      0     30
      7654 MARTIN     SALESMAN    7698 09/28/1981   1250   1400     30
      7839 KING       PRESIDENT        11/17/1981   5000            10
      7900 JAMES      CLERK       7698 12/03/1981    950            30
      7902 FORD       ANALYST     7566 12/03/1981   3000            20
      7934 MILLER     CLERK       7782 01/23/1982   1300            10
      7788 SCOTT      ANALYST     7566 12/09/1982   3000            20
      7876 ADAMS      CLERK       7788 01/12/1983   1100            20
    14 rows selected.
    SQL>Note if you pass in a value to be used in the where clause like deptno, you should not use this technique, but use bind variables intead like this -
    Wrote file afiedt.sql
      1  create or replace function f (p_tab varchar2, p_deptno number)
      2  return sys_refcursor as
      3    c sys_refcursor;
      4  begin
      5    open c for
      6      'select * from ' || p_tab
      7        || ' where deptno = :p_deptno order by hiredate'
      8        using p_deptno;
      9    return c;
    10* end;
    SQL> /
    Function created.
    SQL> exec :c := f('emp', 10)
    PL/SQL procedure successfully completed.
    SQL> print c
    EMPNO ENAME      JOB          MGR HIREDATE      SAL   COMM DEPTNO
      7782 CLARK      MANAGER     7839 06/09/1981   2450            10
      7839 KING       PRESIDENT        11/17/1981   5000            10
      7934 MILLER     CLERK       7782 01/23/1982   1300            10
    SQL>

Maybe you are looking for