Creating procedure in oracle

I want to create a procedure in which i have to insert records into a table based on selecting certain columns from another table
is it possible

Hi,
Try this:
SQL>create or replace procedure p1
  2    is
  3    V_EMPNO                                    NUMBER(4);
  4    V_ENAME                                    VARCHAR2(10);
  5    V_JOB                                      VARCHAR2(9);
  6    V_MGR                                      NUMBER(4);
  7    V_HIREDATE                                 DATE;
  8    V_SAL                                      NUMBER(7,2);
  9    V_COMM                                     NUMBER(7,2);
10    V_DEPTNO                                   NUMBER(2);
11
11    cursor c1 is
12    select *
13      from emp;
14  begin
15    open c1;
16    loop
17      fetch c1
18       into V_EMPNO
19          , V_ENAME
20          , V_JOB
21          , V_MGR
22          , V_HIREDATE
23          , V_SAL
24          , V_COMM
25          , V_DEPTNO;
26      exit when c1%NOTFOUND;
27     insert into t1
28     values
29          ( V_EMPNO
30          , V_ENAME
31          , V_JOB
32          , V_MGR
33          , V_HIREDATE
34          , V_SAL
35          , V_COMM
36          , V_DEPTNO
37             );
38    end loop;
39    close c1;
40  end p1;
41  /
Procedure created.
SQL>select * from t1;
no rows selected
SQL>exec p1
PL/SQL procedure successfully completed.
SQL>select * from t1;
     EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM     DEPTNO
      7369 SMITH      CLERK           7902 17-12-1980        800                    20
      7499 ALLEN      SALESMAN        7698 20-02-1981       1600        300         30
      7521 WARD       SALESMAN        7698 22-02-1981       1250        500         30
      7566 JONES      MANAGER         7839 02-04-1981       2975                    20
      7654 MARTIN     SALESMAN        7698 28-09-1981       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-05-1981       2850                    30
      7782 CLARK      MANAGER         7839 09-06-1981       2450                    10
      7788 SCOTT      ANALYST         7566 09-12-1982       3000                    20
      7839 KING       PRESIDENT            17-11-1981       5000                    10
      7844 TURNER     SALESMAN        7698 08-09-1981       1500          0         30
      7876 ADAMS      CLERK           7788 12-01-1983       1100                    20
      7900 JAMES      CLERK           7698 03-12-1981        950                    30
      7902 FORD       ANALYST         7566 03-12-1981       3000                    20
      7934 MILLER     CLERK           7782 23-01-1982       1300                    10
14 rows selected.HTH
Ghulam

Similar Messages

  • Creating Procedure with oracle loader

    Hi,
    Is there anyone here can help me on how can I fixed the error of this procedure.
    The error i get is this: ORA-24344: success with compilation error
    This is the procedure:
    CREATE OR REPLACE PROCEDURE LOAD_DATA1
    IS
    BEGIN
    DROP TABLE revext ;
    CREATE TABLE revext (person VARCHAR2(40),
    rev_jan NUMBER(4,0),
    rev_feb NUMBER(4,0),
    rev_mar NUMBER(4,0),
    rev_apr NUMBER(4,0),
    rev_mai NUMBER(4,0),
    rev_jun NUMBER(4,0),
    rev_jul NUMBER(4,0),
    rev_aug NUMBER(4,0),
    rev_sep NUMBER(4,0),
    rev_oct NUMBER(4,0),
    rev_nov NUMBER(4,0),
    rev_dez VARCHAR2(20))
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY EXTERNAL_DATA
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
         NOBADFILE
         NOLOGFILE
    FIELDS TERMINATED BY ','
    ( person CHAR,
    rev_jan CHAR,
    rev_feb CHAR,
    rev_mar CHAR,
    rev_apr CHAR,
    rev_mai CHAR,
    rev_jun CHAR,
    rev_jul CHAR,
    rev_aug CHAR,
    rev_sep CHAR,
    rev_oct CHAR,
    rev_nov CHAR,
    rev_dez CHAR
    LOCATION ('revext.txt')
    PARALLEL
    REJECT LIMIT UNLIMITED;
    END ;
    Thanks...
    Edited by: user8840353 on Jan 15, 2010 11:52 PM

    Welcome to the forum!
    First of all: this is Oracle, write code the Oracle-way (not the SQL Server way... just guessing here)
    You can't create and drop tables from within PL/SQL... (I know you can, but you shouldn't have to in most cases)
    just do this
    CREATE TABLE revext (person VARCHAR2(40),
    rev_jan NUMBER(4,0),
    rev_feb NUMBER(4,0),
    rev_mar NUMBER(4,0),
    rev_apr NUMBER(4,0),
    rev_mai NUMBER(4,0),
    rev_jun NUMBER(4,0),
    rev_jul NUMBER(4,0),
    rev_aug NUMBER(4,0),
    rev_sep NUMBER(4,0),
    rev_oct NUMBER(4,0),
    rev_nov NUMBER(4,0),
    rev_dez VARCHAR2(20))
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY EXTERNAL_DATA
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    NOBADFILE
    NOLOGFILE
    FIELDS TERMINATED BY ','
    ( person CHAR,
    rev_jan CHAR,
    rev_feb CHAR,
    rev_mar CHAR,
    rev_apr CHAR,
    rev_mai CHAR,
    rev_jun CHAR,
    rev_jul CHAR,
    rev_aug CHAR,
    rev_sep CHAR,
    rev_oct CHAR,
    rev_nov CHAR,
    rev_dez CHAR
    LOCATION ('revext.txt')
    PARALLEL
    REJECT LIMIT UNLIMITED;... assuming your code is correct - haven't checked it.
    Than you will have your external table, which you can query and use anyway you want.. revext.txt is a comma-delimited file right?

  • How to Create a Stored Procedure in Oracle

    I try to create a very simple Stored Procedure from Oracle SQL Developer, got the following error. Can someone give me some help on this? I am new on this. Thanks.
    Error(4,1): PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: := ( ; not null range default character The symbol ";" was substituted for "BEGIN" to continue.
    create or replace PROCEDURE Test
    AS ACCESSTYP_ID ACCESSTYP.ACCESSTYPCD%TYPE
    BEGIN
         SELECT ACCESSTYPCD
         INTO ACCESSTYP_ID
         FROM ACCESSTYP
         WHERE ACCESSTYPCD = 'WWW';
    END;

    I found out I forgot to put ";" after the declare.
    How do I test it call this stored procedure from
    Oracle SQL Developer.
    create or replace PROCEDURE Test_VL
    AS ACCESSTYP_ID
    ACCESSTYP.ACCESSTYPCD%TYPE;
         SELECT ACCESSTYPCD
         INTO ACCESSTYP_ID
         FROM ACCESSTYP
         WHERE ACCESSTYPCD = 'WWW';
    END;in your SQL Developer window just enclosed your procedure with a Begin ... End.
      Begin
        Test_VL;
      End;

  • Wether "CREATE TABLE"  can be used in storage procedure of Oracle?

    I am migrating MS SQL 2000 Database to Oracle 8.1.7. But I encounter a trouble, the defind sentences of temporary table in storage procedure of MS SQL can't be migrate to oracle.
    I have try two kinds of syntax to defind temporary table, but both of them can't pass the compiler of pl/sql. Two syntax that I have try as follows:
    1.CREATE TEMP TABLE chanp1(chanpid varchar(50))
    2.CREATE GLOBAL TEMPORARY TABLE chanp1(chanpid varchar(50))
    Now, I want to know whether "CREATE TABLE" sentence can be used in storage procedure of Oracle.

    you could use EXECUTE IMMEDIATE (Oracle8i above) or DBMS_SQL pacakge to do dynamic SQL.
    since you are already on Oracle8i 8.1.7 using EXECUTE IMMEDIATE may be more easy.

  • How can i see created stored procedure from oracle?

    Hi All
    could any one help me?
    i have created procedure Insert_Profilebasicdetail and more in oracle 10g
    now i want 2 see the structure or code for the created procedure
    how can i see?
    Thanks
    Edited by: Ajay Patel on Sep 25, 2008 2:18 AM

    Hi,
    If you want to know the paramters of the procedure or decalaration jist use describe
    14:53:56 SQL>desc dba_verify_db_current_schema
    PROCEDURE dba_verify_db_current_schema
    Argument Name                  Type                    In/Out Default?
    IN_USER_NAME                   VARCHAR2                INIn Order to know the Source Code.. you might have got the reply.. from the Earlier Response... !!
    - Pavan Kumar N

  • How to create java stored procedure from oracle(Dastageer)

    how to create java stored procedure from oracle-please help me to create the procedure.

    Hi,
    This forum is exclusively for discussions related to Sun Java Studio Creator. Please post your question in the appropriate forum.
    Thanks,
    RK.

  • Need sample source code for calling stored procedure in Oracle

    Hi.
    I try to call stored procedure in oracle using JCA JDBC.
    Anybody have sample source code for that ?
    Regards, Arnold.

    Thank you very much for a very quick reply. It worked, but I have an extended problem for which I would like to have a solution. Thank you very much in advance for your help. The problem is described below.
    I have the Procedure defined as below in the SFCS1 package body
    Procedure Company_Selection(O_Cursor IN OUT T_Cursor)
    BEGIN
    Open O_Cursor FOR
    SELECT CompanyId, CompanyName
    FROM Company
    WHERE CompanyProvince IN ('AL','AK');
    END Company_Selection;
    In the Oracle Forms, I have a datablock based on the above stored procedure. When I execute the form and from the menu if I click on Execute Query the data block gets filled up with data (The datablock is configured to display 10 items as a tabular form).
    At this point in time, I want to automate the process of displaying the data, hence I created a button and from there I want to call this stored procedure. So, in the button trigger I have the following statements
    DECLARE
    A SFCS1.T_Cursor;
    BEGIN
    SFCS1.Company_Selection(A);
    go_Block ('Block36');
    The cursor goes to the corresponding block, but does not display any data. Can you tell me how to get the data displayed. In the future versions, I'm planning to put variables in the WHERE clause.

  • How to call statement's execute function to execute procedure in Oracle?

    I made a very simple procedure in oracle logged as internal user.
    the procedure as the following:
    create or replace procedure temptest
    as
    begin
    insert into indextab(idx) values(100);
    commit;
    end temptest;
    in Java program,I use Oracle's jdbc driver to connect database, still connect as internal user.
    I can call statement.executeUpdate("insert into indextab(idx) values(100)"). and 100 row was added in database.
    then,I delete this row, try to run procedure in java,
    but the call of statement.execute("temptest") throw a exception
    the error message is:"java.sql.SQLException: ORA-00900: invalid SQL statement"
    then, I write the same procedure in sql server.
    all things work right.( I use jdbc-odbc bridge connect to sql server database)
    who can tell me what's the reason?
    I'm so urgent, please help me as soon as fast, thank you very much

    Instead of a Statement object, use a CallableStatement. CallableStatement is the JDBC wrapper for a stored proc. JDBC requires that the vendor specific call be wrapped in a {CALL ....}.
    So, your code would look like the following:
    Connection con = some connection;
    CallableStatement cs = con.prepareCall("{CALL temptest}");
    cs.execute();
    Take a look at the Javadoc. You can set both IN and OUT parameters using a CallableStatement.

  • SQLException while calling a Stored Procedure in Oracle

    Hi all,
    I am getting this error while calling a Stored Procedure in Oracle...
    java.sql.SQLException: ORA-00600: internal error code, arguments: [12259], [], [
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:207)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:540)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1273)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:780)
    at oracle.jdbc.driver.OracleResultSet.next(OracleResultSet.java:135)
    at StoredProcedureDemo.main(StoredProcedureDemo.java:36)
    The Program is ...
    import java.sql.*;
    public class StoredProcedureDemo {
         public static void main(String[] args) throws Exception {
              Connection con = null;
              ResultSet rs = null;
              Statement st = null;
              CallableStatement cs = null;
              int i;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:SHYAM","scott","tiger");
                   System.out.println("Got Connection ");
                   st = con.createStatement();
                   String createProcedure = "create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS"
                             +" Emp_name VARCHAR2(10);"
                             +" CURSOR c1 (Depno NUMBER) IS"
                             +" SELECT Ename FROM emp WHERE deptno = Depno;"
                             +" BEGIN"
                             +" OPEN c1(Dept_num);"
                             +" LOOP"
                             +" FETCH c1 INTO Emp_name;"
                             +" EXIT WHEN C1%NOTFOUND;"
                             +" END LOOP;"
                             +" CLOSE c1;"
                             +" END;";
                   System.out.println("Stored Procedure is \n"+createProcedure);
                   i = st.executeUpdate(createProcedure);
                   System.out.println("After creating the Stored Procedure "+i);
                   cs = con.prepareCall("{call Get_emp_names(?)}");
                   System.out.println("After calling the Stored Procedure ");
                   cs.setInt(1,20);
                   System.out.println("Before executing the Stored Procedure ");
                   rs = cs.executeQuery();
                   System.out.println("The Enames of the given Dept are ....");
                   while(rs.next()) {
                        System.out.println("In The while loop ");
                        System.out.println(rs.getString(1));
              catch (Exception e) {
                   e.printStackTrace();
    Stored Procedure is ...
    create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS
    Emp_name VARCHAR2(10);
    CURSOR c1 (Depno NUMBER) IS
    SELECT Ename FROM emp WHERE deptno = Depno;
    BEGIN
    OPEN c1(Dept_num);
    LOOP
    FETCH c1 INTO Emp_name;
    EXIT WHEN C1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    END;
    Stored procedure is working properly on sql*plus(Oracle 8.1.5)) editor. But it is not working from a standalone java application. Can anyone please give me a solution.
    thanks and regards
    Shyam Krishna

    The first solution is to not do that in java in the first place.
    DDL should be in script files which are applied to oracle outside of java.
    Other than I believe there are some existing stored procedures in Oracle that take DDL strings and process them. Your user has to have permission of course. You can track them down via the documentation.

  • Calling a stored procedure of oracle 8 from java

    hello,
    i made a stored procedure as below in 1 program :
         String url = "jdbc:odbc:rjc1";
         Connection con = DriverManager.getConnection(url,"scott","tiger");
         Statement stmt = con.createStatement();
         String createProc =
              "Create procedure sp1 as select * from items order by iprice desc";
         stmt.executeUpdate(createProc);
    in other program i have a code as below to retrieve the result of stored procedure :
    CallableStatement cs = con.prepareCall("{call sp2}");
         ResultSet rs = cs.executeQuery();
    the error message that i get is SCOTT.SP1 is invalid.
    any help would be great.
    thanx in advance.

    hello :
    1. i created procedure sp2 and called sp2.
    2. sql statement that we created works fine on oracle - sql i have tested the same.
    3. i did not create a separte userid or password in oracle i was using test account scott which is already present in oracle.
    any thoughts please.

  • Create procedure is generating too many archive logs

    Hi
    The following procedure was run on one of our databases and it hung since there were too many archive logs being generated.
    What would be the answer? The db must remain in archivelog mode.
    I understand the nologging concept, but as I know this applies to creating tables, views, indexes and tablespaces. This script is creating procedure.
    CREATE OR REPLACE PROCEDURE APPS.Dfc_Payroll_Dw_Prc(Errbuf OUT VARCHAR2, Retcode OUT NUMBER
    ,P_GRE NUMBER
    ,P_SDATE VARCHAR2
    ,P_EDATE VARCHAR2
    ,P_ssn VARCHAR2
    ) IS
    CURSOR MainCsr IS
    SELECT DISTINCT
    PPF.NATIONAL_IDENTIFIER SSN
    ,ppf.full_name FULL_NAME
    ,ppa.effective_date Pay_date
    ,ppa.DATE_EARNED period_end
    ,pet.ELEMENT_NAME
    ,SUM(TO_NUMBER(prv.result_value)) VALOR
    ,PET.ELEMENT_INFORMATION_CATEGORY
    ,PET.CLASSIFICATION_ID
    ,PET.ELEMENT_INFORMATION1
    ,pet.ELEMENT_TYPE_ID
    ,paa.tax_unit_id
    ,PAf.ASSIGNMENT_ID ASSG_ID
    ,paf.ORGANIZATION_ID
    FROM
    pay_element_classifications pec
    , pay_element_types_f pet
    , pay_input_values_f piv
    , pay_run_result_values prv
    , pay_run_results prr
    , pay_assignment_actions paa
    , pay_payroll_actions ppa
    , APPS.pay_all_payrolls_f pap
    ,Per_Assignments_f paf
    ,per_people_f ppf
    WHERE
    ppa.effective_date BETWEEN TO_DATE(p_sdate) AND TO_DATE(p_edate)
    AND ppa.payroll_id = pap.payroll_id
    AND paa.tax_unit_id = NVL(p_GRE, paa.tax_unit_id)
    AND ppa.payroll_action_id = paa.payroll_action_id
    AND paa.action_status = 'C'
    AND ppa.action_type IN ('Q', 'R', 'V', 'B', 'I')
    AND ppa.action_status = 'C'
    --AND PEC.CLASSIFICATION_NAME IN ('Earnings','Alien/Expat Earnings','Supplemental Earnings','Imputed Earnings','Non-payroll Payments')
    AND paa.assignment_action_id = prr.assignment_action_id
    AND prr.run_result_id = prv.run_result_id
    AND prv.input_value_id = piv.input_value_id
    AND piv.name = 'Pay Value'
    AND piv.element_type_id = pet.element_type_id
    AND pet.element_type_id = prr.element_type_id
    AND pet.classification_id = pec.classification_id
    AND pec.non_payments_flag = 'N'
    AND prv.result_value <> '0'
    --AND( PET.ELEMENT_INFORMATION_CATEGORY LIKE '%EARNINGS'
    -- OR PET.element_type_id IN (1425, 1428, 1438, 1441, 1444, 1443) )
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN PET.EFFECTIVE_START_DATE AND PET.EFFECTIVE_END_DATE
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN PIV.EFFECTIVE_START_DATE AND PIV.EFFECTIVE_END_DATE --dcc
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN Pap.EFFECTIVE_START_DATE AND Pap.EFFECTIVE_END_DATE --dcc
    AND paf.ASSIGNMENT_ID = paa.ASSIGNMENT_ID
    AND ppf.NATIONAL_IDENTIFIER = NVL(p_ssn, ppf.NATIONAL_IDENTIFIER)
    ------------------------------------------------------------------TO get emp.
    AND ppf.person_id = paf.person_id
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN ppf.EFFECTIVE_START_DATE AND ppf.EFFECTIVE_END_DATE
    ------------------------------------------------------------------TO get emp. ASSIGNMENT
    --AND paf.assignment_status_type_id NOT IN (7,3)
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN paf.effective_start_date AND paf.effective_end_date
    GROUP BY PPF.NATIONAL_IDENTIFIER
    ,ppf.full_name
    ,ppa.effective_date
    ,ppa.DATE_EARNED
    ,pet.ELEMENT_NAME
    ,PET.ELEMENT_INFORMATION_CATEGORY
    ,PET.CLASSIFICATION_ID
    ,PET.ELEMENT_INFORMATION1
    ,pet.ELEMENT_TYPE_ID
    ,paa.tax_unit_id
    ,PAF.ASSIGNMENT_ID
    ,paf.ORGANIZATION_ID
    BEGIN
    DELETE cust.DFC_PAYROLL_DW
    WHERE PAY_DATE BETWEEN TO_DATE(p_sdate) AND TO_DATE(p_edate)
    AND tax_unit_id = NVL(p_GRE, tax_unit_id)
    AND ssn = NVL(p_ssn, ssn)
    COMMIT;
    FOR V_REC IN MainCsr LOOP
    INSERT INTO cust.DFC_PAYROLL_DW(SSN, FULL_NAME, PAY_DATE, PERIOD_END, ELEMENT_NAME, ELEMENT_INFORMATION_CATEGORY, CLASSIFICATION_ID, ELEMENT_INFORMATION1, VALOR, TAX_UNIT_ID, ASSG_ID,ELEMENT_TYPE_ID,ORGANIZATION_ID)
    VALUES(V_REC.SSN,V_REC.FULL_NAME,v_rec.PAY_DATE,V_REC.PERIOD_END,V_REC.ELEMENT_NAME,V_REC.ELEMENT_INFORMATION_CATEGORY, V_REC.CLASSIFICATION_ID, V_REC.ELEMENT_INFORMATION1, V_REC.VALOR,V_REC.TAX_UNIT_ID,V_REC.ASSG_ID, v_rec.ELEMENT_TYPE_ID, v_rec.ORGANIZATION_ID);
    COMMIT;
    END LOOP;
    END ;
    So, how could I assist our developer with this, so that she can run it again without it generating a ton of logs ? ?
    Thanks
    Oracle 9.2.0.5
    AIX 5.2

    The amount of redo generated is a direct function of how much data is changing. If you insert 'x' number of rows, you are going to generate 'y' mbytes of redo. If your procedure is destined to insert 1000 rows, then it is destined to create a certain amount of redo. Period.
    I would question the <i>performance</i> of the procedure shown ... using a cursor loop with a commit after every row is going to be a slug on performance but that doesn't change the fact 'x' inserts will always generate 'y' redo.

  • How to create table in Oracle 9i of name USER

    To whom so ever forum member,
    Please help me for creating table in Oracle 9i with the table name USER, though i know that it's reserve word for the Oracle DB
    Please give me the query if any for the same.
    Thanks in advance for timely help.
    Kiran.

    CREATE USER user-name IDENTIFY BY password
    user-name
    The name of the user to be created. The name is an identifier with a maximum of 30 characters. Note that if support for delimited identifiers is on and the user name begins with an underscore, you must place the user name in quotation marks.
    various identifiers possible
    simple-identifier ::= identifier-start { identifier-part }
    identifier-start ::= letter | % | _
    identifier-part ::= letter | number | _ | @ | # | $
    delimited-identifier ::= " delimited-identifier-part { delimited-identifier-part } "
    delimited-identifier-part ::= non-double-quote-character | double-quote-symbol
    double-quote-symbol ::= ""
    An identifier cannot be a SQL reserved word.
    An identifier may be either a simple identifier or a delimited identifier.
    password
    The password of the user to be created.
    the reserved words are:
    %AFTERHAVING | %ALPHAUP | %ALTER | %ALTER_USER | %BEGTRANS |
    %CHECKPRIV | %CREATE_ROLE | %CREATE_USER | %DBUGFULL |
    %DELDATA | %DESCRIPTION | %DROP_ANY_ROLE | %DROP_USER |
    %EXACT | %EXTERNAL | %FILE | %FOREACH | %FULL |
    %GRANT_ANY_PRIVILEGE | %GRANT_ANY_ROLE | %INORDER |
    %INTERNAL | %INTEXT | %INTRANS | %INTRANSACTION | %MCODE |
    %NOCHECK | %NODELDATA | %NOINDEX | %NOLOCK | %NOTRIGGER |
    %NUMROWS | %ODBCOUT | %ROUTINE | %ROWCOUNT | %STARTSWITH |
    %STRING | %THRESHOLD | %UPPER |
    ABSOLUTE | ACTION | ADD | ALL | ALLOCATE | ALTER | AND |
    ANY | ARE | AS | ASC | ASSERTION | AT | AUTHORIZATION | AVG |
    BEGIN | BETWEEN | BIT | BIT_LENGTH | BOTH | BY | CASCADE |
    CASE | CAST | CATALOG | CHAR | CHARACTER | CHARACTER_LENGTH |
    CHAR_LENGTH | CHECK | CLOSE | COALESCE | COBOL | COLLATE |
    COLLATION | COLUMN | COMMIT | CONNECT | CONNECTION |
    CONSTRAINT | CONSTRAINTS | CONTINUE | CONVERT |
    CORRESPONDING | COUNT | CREATE | CROSS | CURRENT |
    CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP |
    CURRENT_USER | CURSOR | DATE | DAY | DEALLOCATE | DEC |
    DECIMAL | DECLARE | DEFAULT | DEFERRABLE | DEFERRED |
    DELETE | DESC | DESCRIBE | DESCRIPTOR | DIAGNOSTICS |
    DISCONNECT | DISTINCT | DOMAIN | DOUBLE | DROP | ELSE |
    END | ENDEXEC | ESCAPE | EXCEPT | EXCEPTION | EXEC |
    EXECUTE | EXISTS | EXTERNAL | EXTRACT | FALSE | FETCH |
    FILE | FIRST | FLOAT | FOR | FOREIGN | FORTRAN | FOUND |
    FROM | FULL | GET | GLOBAL | GO | GOTO | GRANT | GROUP |
    HAVING | HOUR | IDENTITY | IMMEDIATE | IN | INDICATOR |
    INITIALLY | INNER | INPUT | INSENSITIVE | INSERT | INT |
    INTEGER | INTERSECT | INTERVAL | INTO | IS | ISOLATION |
    JOIN | KEY | LANGUAGE | LAST | LEADING | LEFT | LEVEL |
    LIKE | LOCAL | LOWER | MATCH | MAX | MIN | MINUTE |
    MODULE | MONTH | NAMES | NATIONAL | NATURAL | NCHAR |
    NEXT | NO | NOT | NULL | NULLIF | NUMERIC | OCTET_LENGTH |
    OF | ON | ONLY | OPEN | OPTION | OR | ORDER | OUTER |
    OUTPUT | OVERLAPS | PAD | PARTIAL | PASCAL | PLI |
    POSITION | PRECISION | PREPARE | PRESERVE | PRIMARY |
    PRIOR | PRIVILEGES | PROCEDURE | PUBLIC | READ | REAL |
    REFERENCES | RELATIVE | RESTRICT | REVOKE | RIGHT | ROLE |
    ROLLBACK | ROWS | SCHEMA | SCROLL | SECOND | SECTION |
    SELECT | SESSION_USER | SET | SIZE | SMALLINT | SOME |
    SPACE | SQL | SQLCODE | SQLERROR | SQLSTATE | SUBSTRING |
    SUM | SYSTEM_USER | TABLE | TEMPORARY | THEN | TIME |
    TIMESTAMP | TIMEZONE_HOUR | TIMEZONE_MINUTE | TO |
    TRAILING | TRANSACTION | TRANSLATE | TRANSLATION | TRIM |
    TRUE | UNION | UNIQUE | UNKNOWN | UPDATE | UPPER | USAGE |
    <br>
    USER |
    <br>
    USING | VALUE | VALUES | VARCHAR | VARYING | VIEW |
    WHEN | WHENEVER | WHERE | WITH | WORK | WRITE | YEAR |
    ZONE
    hope it helps ...
    roli

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • With create procedure, How to clear Shared pool

    Hi, I have a sql script file it contains
    more than 300,000 line code, I use this file
    to create procedure in the Oracle.
    When I execute this sql script file, I receive a error message " out of cursor". I know when I create procedure, the procedure's code is stores in the shared pool. So when the code is stores out of shared pool's size, I receive that error.
    But how can I clear shared pool? With commit statement, it won't be use.
    Thanks a lot.

    you may try:
    alter system flush shared_pool;
    null

  • Creating user in oracle 12i

    Hi everybody,
    Where can I find information about creating users in oracle e business suite 12(12i)? Though I know how to do such procedure but I am thinking of a thorough mannual to integrate what I know about this matter.
    All the best,

    Check the [User Guide|http://download.oracle.com/docs/cd/B34956_01/current/acrobat/120sasg.pdf].
    By
    Vamsi

Maybe you are looking for