Number of declaration in the oracle procedure

Hi guys,.

SELECT col1_name IN the host_name FROM tbl_name WHERE col2_name = 'XXX ';

DECLARE

l_url VARCHAR2 (256): = ' host_name? XXXX & xxxxx & xxxx';

l_http_request UTL_HTTP.req;

l_http_response UTL_HTTP.resp;

BEGIN

l_http_request: = UTL_HTTP.begin_request (l_url);

l_http_response: = UTL_HTTP.get_response (l_http_request);

Utl_http.end_response (l_http_response);

END;

Above is the my code. I am trying to set the value of col1_name in the host_name and call host_name in the query string. But iam unable to send the request such that it does not touch the host machine.

value of HOST_NAME is already added inside the table_name.

Help, please.

Correct code

DECLARE

l_url VARCHAR2 (256);

l_http_request UTL_HTTP.req;

l_http_response UTL_HTTP.resp;

BEGIN

SELECT col1_name INTO host_name

FROM col2_name WHERE table_name = 'XXX ';

l_url: = host_name |'? xxxx xxxxx & &xxxx';

l_http_request: = UTL_HTTP.begin_request (l_url);

l_http_response: = UTL_HTTP.get_response (l_http_request);

Utl_http.end_response (l_http_response);

END;

Obviously the SELECT statement must be IN a BEGIN END block, is not outside of the

and you need concatenate the variable with the string hard-coded.

-------------------

Sybrand Bakker

Senior Oracle DBA

Tags: Database

Similar Questions

  • Error creating a salary. ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package

    Hi all

    We try to add new proposal for a salary of some employees from form August 1, 2015 (the Date of the beginning of employee)

    There is no existing salary proposal doesn't exist for these employees.

    We get below error.


    ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package


    Help, please.

    Thank you

    Tarun

    Hi John,.

    If it helps, take a look at the following note:

    ORA-01422 exact Fetch returns more than number of lines requested in Hr_maintain_proposal_swi (Doc ID 1673527.1)

    Kind regards

    Rajen

  • Get the number of rows in the oracle table

    Hi all
    I want to get the total number of rows in the sql to the appmodule table.
    After you apply the criteria to view some on the view object. If he try with getallrowsinrange the number of rows found within the viewobject was but I want a total number of rows in the sql table.

    How can I get that

    I use jdev 11.1.1.5

    Thanks in advance

    I threw something together, quick and dirty, don't hesitate to optimize.

    Assuming you want the County table, I put the code in a subclass of EntityDefImpl since it is representing a table in the middle tier.

    public class EmpDefImpl
          extends EntityDefImpl {
      /**
       * This is the default constructor (do not remove).
       */
      public EmpDefImpl( ) {}
    
      //~ Methods ****************************************************************************
    
      public long getTableRowCount( DBTransaction transaction ) {
        String query = getQuery( );
        String countQuery = String.format( "SELECT COUNT(*) FROM (%s)", query );
        long count = 0;
    
        ViewObject vo = transaction.createViewObjectFromQueryStmt( countQuery );
    
        try {
          vo.executeQuery( );
    
          Row row = vo.first( );
          Number number = (Number)row.getAttribute( 0 );
          count = number.longValue( );
        } finally {
          vo.remove( );
        }
    
        return count;
      }
    }
    

    Depending on your card type, you may not get an oracle.jbo.domain.Number, but something else, so the cast may need correction.

    Usage example:

    public class EmpEditViewImpl extends ViewObjectImpl {
      public EmpEditViewImpl() {
      }
    
      protected void executeQueryForCollection( Object object, Object[] object2, int i ) {
        super.executeQueryForCollection( object, object2, i );
    
        EmpDefImpl def = ( EmpDefImpl )getEntityDef( 0 );
        long tableRowCount = def.getTableRowCount( getDBTransaction() ) );
    
        // Do something with it
      }
    }
    

    As you can see, the code is fairly generic. Also, you might be able to put this in a base extension ADF class.

    Sascha

    Published by: Sascha Herrmann on June 7, 2012 14:39

  • Access to the Oracle procedure table

    Hi all

    I can pass the array as a parameter of procedure Oracle object?
    Application procedure for the environment to run Java and we pass the java array object as a parameter


    Thanks in advance...

    Kind regards...

    http://lmgtfy.com/?q=Java+pass+array+to+Oracle+procedure

  • How to debug the Oracle procedure

    Hi friends,

    I've migrated oracle procedure from Oracle 8.0.4 DB of NT to DB Oracle 9.2.0 on IBM AIX.
    When I test/execute the procedure on the Db 9.2.0, she still runs and did not end.

    How to debug an Oracle procedure to check if it's a loop on the same block foever, what "current" values is owner and what tables he read to, or procedure does never loops as if it is not to satisfy one of the conditions?

    Thank you very much

    Is coding "infinite loop" a bad habit of programming?

    Yes, you can call it such.
    Personally, I prefer to use loops.
    See http://tahiti.oracle.com for the different types of loops that you can use.

    How can I change this infinite loop in a "finite" without changing the logic of the program?

    You can use EXIT WHEN "certain conditions."
    For example, you can add OUTPUT WHEN cursorname % notfound, or some counter to reach a specific value in your loop, to 'force' the loop to stop.
    See the docs or do a search on this forum for more examples.

  • The Oracle procedure update

    We have two tables.

    1 EMP_STAGE 2. FM3

    Finding the structure for the two tables above.

    EMP_STAGE                                                       EMP

    -----------------                                                       --------

    EMP_ID                                                                 ID

    PAN                                                                       EMP_PAN

    STATUS                                                                STATUS

    LAST_DAY                                                            EMP_FLAG

    END_DATE

    one of our table EMP_STAGE requests get data then the EMP_STAGE of the table data will be loaded into the EMP table.

    I need to write a procedure, based on the results of the table EMP_STAGE table EMPLOYEE should as update.

    1. If the employee is still with the organization that the STATE is 'Active' in the EMP_STAGE table if he resigns or terminated its status should be 'inactive' and LAST_DAY (date format) of data used has also updated in the EMP_STAG table.

    2. during the loading of data into the EMP table based on the data of EMP_STAGE, in the employee table employee STATUS = "ACTIVE/INACTIVE" and end_date = LAST_DAY (from table EMP_STAGE) based on both the EMP_FLAG column updates as EMP_FLAG = (If employee was then 'YES' else 'NO');

    Please give me your opinion on this.

    Thanks for posting the sample data, I'm unable to reproduce your problem. As Hoek said, it is because of duplicates in your data. You can check the link above to understand the issue.

    However, my illustration here is how to do it.

    Suppose that the emp table has only a single folder, if a new employee is in EMP_STAGE table, his information should be added in the transactional table EMP.

    Under scenario

    101 is the new employee, then inserted

    100 is used existing, as well as its details are updated.

    SQL >
    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    SQL >
    SQL > DROP SEQUENCE emp_id_seq;

    Sequence has fallen.

    SQL > DROP TABLE emp;

    Deleted table.

    SQL > DROP TABLE emp_stage;

    Deleted table.

    SQL >
    SQL > CREATE SEQUENCE emp_id_seq
    2. START WITH 1
    MAXVALUE 3 100
    MINVALUE 4 0;

    Order of creation.

    SQL >
    SQL > CREATE TABLE emp
    () 2
    3 IDENTIFICATION NUMBER,
    NUMBER OF EMP_PAN 4.
    5 SITUATION VARCHAR2 (10),
    6 EMP_FLAG VARCHAR2 (1).
    End_date DATE 7
    8  );

    Table created.

    SQL >
    SQL > CREATE TABLE emp_stage
    () 2
    NO. 3,
    4 STATUS VARCHAR2 (10),
    5 LAST_DAY DATE
    6  );

    Table created.

    SQL >
    SQL >
    SQL > INSERT INTO emp
    2. SELECT 1 id,
    3 100 emp_pan,
    4 'active ',.
    5            'Y',
    6 SYSDATE - 1
    7 FROM DUAL;

    1 line of creation.

    SQL >
    SQL > INSERT INTO emp_stage
    2. SELECT 100 pan, 'Active', SYSDATE FROM DUAL;

    1 line of creation.

    SQL >
    SQL > INSERT INTO emp_stage
    2. SELECT pan 101, 'Active', NULL FROM DUAL;

    1 line of creation.

    SQL >
    SQL > MERGE IN emp e
    2 use emp_stage
    3 on (es. PAN = e.emp_PAN)
    4 WHEN MATCHED
    5 THEN
    6 UPDATE SET e.end_date =. LAST_DAY, e.status = es.status
    7 WHEN NOT MATCHED
    8 THEN
    9. INSERT (e.id,
    emp_pan 10,
    11 end_date
    12 status)
    13 VALUES (emp_id_seq. NEXTVAL,
    ES.Pan 14,
    15                 es. LAST_DAY,
    16 es.status);

    2 lines merged.

    SQL > commit;

    validation complete.
    SQL > SELECT * FROM emp;

    ID EMP_PAN STATUS E END_DATE
    ---------- ---------- ---------- - ---------
    1 100 Y active 27 August 13
    2 101 active

    SQL >
    SQL > SELECT * from emp_stage;

    PAN STATUS LAST_DAY
    ---------- ---------- ---------
    100 active 27 August 13
    Active 101

    Thank you

    GPU

  • Increase the number of user in the Oracle database

    Hello
    I have a small base of 50 concerts Oracle 10g in the test environment and only two user who uses. In a few days about 100 users will start to use at the same time, and there will be a lot of Insert and Update transactions. Do I need to do anything on the database to handle the increase in traffic? Help, please.

    -Bigit

    Hello

    I think it need more process, maybe you need some settings in the database, for example, you can see follow these settings:

    1. Select name, value of the parameter $ v where name like '% session ';
    2. Select name, value of the parameter $ v whose name as "process % ';
    3. Select name, value of the parameter $ v where name like '% of transactions;

    Accordint to this...

    You can the chance these values...

    I hope that this information will be useful for you.

  • SSL mutual authentication using the Oracle stored procedure

    Hello

    DB version:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Is possible to perform mutual authentication SSL uses the Oracle stored procedure?
    I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs). But I would like to know if it's possible and how.

    In other is words there a way to incorporate the client certificate information into a procedure that calls a Web service.

    I read the articles to do it in JAVA or .net. But please advice how we can achieve using Oracle procedures.

    Thank you.

    934451 wrote:

    Is possible to perform mutual authentication SSL uses the Oracle stored procedure?

    To learn more. SSL what for?

    Oracle PL/SQL only supports client standard TCP sockets. However, interface for HTTP, Oracle PL/SQL also supports HTTPS - which requires the certificates of authentication of the server to be stored in a portfolio of Oracle web and used during the transmission via HTTPS. See the code example {message identifier: = 1925297} for more details.

    I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs).

    Forums and articles written by idiots. For idiots.

    And no, I'm not to embellish my response to this pitch that you met. It is false. It is written by ignorant people who don't know ANYTHING about the use of Oracle and PL/SQL. And feel free to forward my response to these idiots. They find me here if they want to argue...

    As an example of how to call a web service, see {message identifier: = 10158148} and {message: id = 10448611}.

  • Oracle procedure

    Friends and experts, DB: 11 GR 2

    Can someone guide me how can I write the Oracle procedure to query data in a loop?

    Sounds really complicated and do not know, even if it is possible.

    Table contains 500 lines of millet

    Basically, I try to find below in the output

    1. what host/pid continuously for 5 minutes with more than 75% of cpu

    2. get the average start and end with CPU time

    3. get top 5 folders for each type of host by avg_cpu

    Table: tab1

    Data in the table:

    Date server pid cpu_used

    01/01/2015-02:00 75 1234 s1

    01/01/2015-02:01 75 1234 s1

    01/01/2015 s1 02:02 80 1234

    01/01/2015 s1 02:03 75 1234

    01/01/2015 02:04 90 1234 s1

    01/01/2015 s1 02:05 1234 75

    01/01/2015 s1 02:06 70 1111

    01/01/2015 s2 02:04 85 5678

    01/01/2015 s2 02:05 90 5678

    01/01/2015 s2 02:06 75 5678

    01/01/2015 s2 02:07 80 5678

    01/01/2015 s2 02:08 90 5678

    01/01/2015 s2 02:09 90 5678

    01/01/2015 s1 02:09 60 1234

    Example of output

    Server pid start_date end_date avg_cpu

    S1 1234 01/01/2015 02:00 01/01/2015 02:05 85

    S2 01/01/2015 5678, 02; 04:00 01/01/2015 02:09 84

    with

    tab1 as

    (select to_date (1 January 2015 02:00 "," mm/dd/yyyy hh) date_, 's1' server, 1234 pid, 75 cpu_used Union double all the)

    Select to_date (1 January 2015 02:01 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all

    Select to_date (1 January 2015 02:02 "," mm/dd/yyyy hh), "s1", 1234, 80 of double union all

    Select to_date (1 January 2015 02:03 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all

    Select to_date (1 January 2015 02:04 ',' dd/mm/yyyy hh), "s1", 1234, 90 double Union all

    Select to_date (1 January 2015 02:05 ',' dd/mm/yyyy hh), "s1", 1234, 75 double Union all

    Select to_date (1 January 2015 02:06 "," mm/dd/yyyy hh), "s1", 1234, 78 double Union all

    Select to_date (1 January 2015 02:07 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all

    Select to_date (January 1, 2015 08:02 "," mm/dd/yyyy hh), "s1", 1234, 80 of double union all

    Select to_date (1 January 2015 02:09 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all

    Select to_date (1 January 2015 02:10 "," mm/dd/yyyy hh), "s1", 1234, 90 double Union all

    Select to_date (1 January 2015 02:11 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all

    Select to_date (1 January 2015 02:12 "," mm/dd/yyyy hh), "s1", 1111, 70 double Union all

    Select to_date (1 January 2015 02:04 ',' dd/mm/yyyy hh), 's2', 5678, 85 double Union all

    Select to_date (1 January 2015 02:05 ',' dd/mm/yyyy hh), 's2', 5678, 90 double Union all

    Select to_date (1 January 2015 02:06 "," mm/dd/yyyy hh), 's2', 5678, 75 double Union all

    Select to_date (1 January 2015 02:07 "," mm/dd/yyyy hh), 's2', 5678, 80 of double union all

    Select to_date (January 1, 2015 08:02 "," mm/dd/yyyy hh), 's2', 5678, 90 double Union all

    Select to_date (1 January 2015 02:09 "," mm/dd/yyyy hh), 's2', 5678, 90 double Union all

    Select to_date (1 January 2015 02:15 "," mm/dd/yyyy hh), "s1", 1234, 60 double

    )

    Select Server pid, start_date, end_date, avg_cpu

    (select Server,

    nest,

    start_date to_char (min (date_), ' mm/dd/yyyy HH'),

    End_date to_char (max (date_), ' mm/dd/yyyy HH'),

    Round (AVG (cpu_used), 2) avg_cpu.

    ROW_NUMBER() on rn (partition by order of servers by avg (cpu_used) desc)

    (select date_, pid, cpu_used,

    5 * ceil (row_number () over (partition by server, pid, case when cpu_used > = 75 then 1 by date_ end order) / 5) w,

    ROW_NUMBER() over (partition by order of servers by pid, date_).

    ROW_NUMBER() over (partition by server, pid, case when cpu_used > = 75 then 1 by date_ end order) g

    of tab1

    )

    Group server, pid, g, w

    having count (*) > = 5

    and avg (cpu_used) > = 75

    )

    SERVER PID START_DATE END_DATE AVG_CPU
    S1 1234 02:00 01/01/2015 02:04 01/01/2015 79
    S1 1234 02:05 01/01/2015 02:09 01/01/2015 76.6
    S2 5678 02:04 01/01/2015 02:08 01/01/2015 84

    Concerning

    Etbin

  • Need help to understand the oracle plsql design phase.

    I am new user oracle plsql for learning. I wanted to know the following points.

    (1) is there any process that we follow before developing procedures for oracle.
    (2) is there any algorithm, flowchart, diagrams that we use for the Oracle procedure development.
    (3) what I should learn in order to begin to develop procedures for the oracle.

    organization charts
    data flow diagrams

    There any standard used in industry? comments or pointers would be useful

    user507531 wrote:

    Meanwhile, I would also like to know if there are any designs / charts, high level design, low level of design, ER diagrams to create before you start any development of Oracle plsql.

    It depends on the environment, work in and value standards. Some expect a case of use (UML) before a single line of code is written. At the time of Cobol, an organizational chart was generally expected.

    With some new programming approaches, the test cases are often used to define the program (as in turn, which defines the objectives of the program).

    ERDs come with database design - with the design of the PL/SQL program. You can use an ERD for a PL/SQL program, but is not part of the design of a PL/SQL program. It describes the database instead.

  • Error (17.14): samhi.oracle.apps.po.sample.server.SampleEOImpl of the class should be declared abstract. It defines no method setLastUpdateLogin (oracle.jbo.domain.Number) of the oracle.apps.fnd.framework.server.OAEntityImpl class

    Error (17.14): samhi.oracle.apps.po.sample.server.SampleEOImpl of the class should be declared abstract. It defines no method setLastUpdateLogin (oracle.jbo.domain.Number) of the oracle.apps.fnd.framework.server.OAEntityImpl class can help on this please

    Check once WHO columns are present or not table

    Last updated

    Last updated by

    Last updated connection

    Date of creation

    Created by

    These fields are required for the creation of EO.

    SANGU-

  • Mutex in the oracle stored procedure... How to get there?

    Hello

    I have the series of insert/update statements in an oracle stored procedure. The stored procedure is called composite Oracle SOA.

    The procedure works like this:

    a. download a request and checks to see if the file is already in the database. If she's here, we update, elsewhere insert.

    b. that I check for 10 tables and make the necessary inserts/updations.

    But sometimes, when I get the huge volume of transactions in the stored procedure, I see this violation of unique constraint violated due to lack of appropriate controls to ensure that no other parallel forum is trying to update the same record.

    How to do this so that no two execution of stored procedure doesn't work on the same record in the same table?

    Thank you!!

    Hello

    you might consider something like this

    create table t1(
      id number primary key,
      action varchar2(10),
      who varchar2(10)
    )
    ;
    
    declare
      p_id number           := 1;
      p_action varchar2(10) := 'Insert';
      p_who varchar2(9)     := 'Session 1';
      --
      procedure update_t1(p_id number, p_action varchar2, p_who varchar2) is
      begin
        update t1 set action = p_action, who = p_who where id = p_id;
      end;
    begin
      -- try to insert or update row for PK p_id
      merge into t1 d using (
        select
          p_id     id,
          p_action action,
          p_who    who
        from dual
      ) s on (d.id = s.id)
      when matched then
        update set d.action = 'Update', d.who = s.who
      when not matched then
        insert values (s.id, s.action, s.who)
      ;
    exception when dup_val_on_index then
      -- insert is no option, update when lock is released
      update_t1(p_id, 'Update', p_who);
    end;
    /
    
    drop table t1 purge
    ;
    

    Scenario (two sessions trying to insert/updated updated for id 1):

    session 1 inserts ("1" "insert" "Session 1") and the data is not visible to the session 2

    session 2 inserts same id but crashes because of the locking session 1

    validation of the session 1

    session 2 insert fails but who manages updating instead

    session 2 commits, values for the id 1 is now ('1' 'Update' "Session 2")

  • Open and close the connection in oracle procedure

    Here is the procedure I'm in I insert data into the table temp_soap_monitoring using the select statement. I have soap_monitoring table FONIC_RETAIL database where I want to take the data and insert into the table temp_soap_monitoring. I play the position of planner of all 5 minutes for this procedure so that I get always the latest data in soap_monitoring@fonic_retail table. The problem of this procedure is that it takes too much cost and the query execution time to perform this procedure. Whenever he tries to extract the data from db link and save my local database. I remember in Java, php, and other programming languages, we have method in order to open the db connection when we tried to extract data from db link and then once integration is complete, we can close the db connection. So the performance improves and also has no load on db link. In this method, we have to assign link db to retrieve the data. So I think is it possible to apply this logic in my oracle procedure. The question arises because at this moment I am hard code the link db, but now I have 3 db more links and I will not reproduce the same procedure by assigning diffferent db links.

    PROCEDURE  "EXT_SOAP_MONITORING" AS

    LAST_SM_ID Number
    := 0;
    LAST_CAPT_DATE DATE
    ;

    BEGIN

    SELECT LAST_TASK_ID INTO LAST_SM_ID FROM CAPTURING where DB_TABLE='TEMP_SOAP_MONITORING';

    insert into TEMP_SOAP_MONITORING(ID,REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE)
    select ID,REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE from
    SOAP_MONITORING
    @FONIC_RETAIL WHERE WEB_SERVICE_NAME ='RatorWebShopService'  and WEB_METHOD_NAME = 'placeShopOrder' and ID > LAST_SM_ID order by ID desc;

    update
    CAPTURING
    set LAST_TASK_ID=
    CASE WHEN ((SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL) AND (LAST_TASK_ID  IS NULL)  THEN (SELECT MAX(ID) from SOAP_MONITORING@FONIC_RETAIL)
    WHEN (SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL THEN LAST_TASK_ID + 1
    ELSE (SELECT MAX(ID) from TEMP_SOAP_MONITORING) END,
    CAPTURING_DATE
    = CURRENT_TIMESTAMP, LAST_CAPTURED_DATE = LAST_CAPT_DATE where DB_TABLE='TEMP_SOAP_MONITORING';

    END EXT_SOAP_MONITORING;

    I have it here is the procedure which I insert data in

    temp_soap_monitoring table by using the select statement. I have

    soap_monitoring table of FONIC_RETAIL database where I want to take the data and insert into the table temp_soap_monitoring.

    WHY? Why you are moving the data? Why not just use it table, is it already?

    The problem of this procedure is that it takes too much cost and the query execution time to perform this procedure.

    The solution is to FIND THE PROBLEM. Troubleshoot the code and find out where is the problem, if any.

    Based SOLELY on what you have posted the solution might be to add just an appropriate index.

    Whenever he tries to extract the data from db link and save my local

    database. I remember in Java, php, and other programming languages, we

    method to open the db connection when we tried to extract data of

    DB link and then once integration is complete, we can close the db

    connection.  So the performance improves and also has no load on db link.

    What? The LAST thing you want to do is keep the closing and opening of the connections. I don't know how 'remember you' from Java or other languages. The main reasons pools of connections were invented to AVOID have to repeatedly open and close connections.

    A db link not a NOT a "charge" - the "charge" is the query is made. If you write a poor query or have a poor data without the necessary index model, or have missing statistics, then you will get poor results.

    In this method, we have to assign link db to retrieve the data. So I have
    is it possible to apply this logic in my oracle procedure to belive. The
    question arises because at the moment, I'm hardcode db link but now I
    have more ties db 3 and I will not reproduce the same procedure by
    assigning diffferent db links.

    You can certainly write Java code to connect to each database with a direct connection. But all write code PL/SQL must include the database link. And the only way to avoid hard-coding the link is to keep the names of link in a table and use dynamic sql statements to build and run the query. This isn't what you want to do if you're looking for performance.

    SELECT LAST_TASK_ID INTO LAST_SM_ID FROM CAPTURING where DB_TABLE='TEMP_SOAP_MONITORING';

    For all we know which could be the WHOLE CAUSE of your problem. If there is no index on the table, you could do a full table to a table with lines scan 800 billion;

    We have NO WAY of knowing since you haven't posted info. Please read the faq to find out how to post a request for tuning and the info you provide.

    1. the query

    2. the table and index DDL

    3. the execution plan

    4 RowCounts for tables and query predicates

    5. the info on the stats: how you collected them and if they are up to date

    update
    CAPTURING set LAST_TASK_ID=
    CASE WHEN ((SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL) AND (LAST_TASK_ID  IS NULL)  THEN (SELECT MAX(ID) from SOAP_MONITORING@FONIC_RETAIL)
    WHEN (SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL THEN LAST_TASK_ID + 1
    ELSE (SELECT MAX(ID) from TEMP_SOAP_MONITORING) END,
    CAPTURING_DATE = CURRENT_TIMESTAMP, LAST_CAPTURED_DATE = LAST_CAPT_DATE where DB_TABLE='TEMP_SOAP_MONITORING';

    My guess is that TERRIBLE method of trying to get a 'LAST ID' is what's causing ALL your problems of performance. This method will not scale, and it will NOT properly work in a multiuser environment.

    You need create a good BATCH_CONTROL table that all processes use during the creation and execution of lots.

    The MASTER of the process batch:

    1 Gets a new BATCH_ID using a sequence

    2 locks the current row in the table control and uses / change the value "last".

    3 creates a new line in the control table for the new batch process

    4. the line of control to date with the start time, end time, result State, County, etc. for the batch

    Your likely PROBLEM of has NOTHING to do with the links of the db.

  • Execution of the stored procedure Oracle EF6 error.

    Hello

    Need help with the oracle error

    {"ORA-06550: line 1, column 8:"}

    PLS-00306: wrong number or types of arguments in the call to "sp_name".

    ORA-06550: line 1, column 8:

    {"PL/SQL: statement ignored '}

    This error occurs when the code runs the line in Vb.net application in Model Designer

    MyBase.ExecuteFunction ("sp_name" para1, para2, para3, dOBpara4, para5)

    I create the SSDL and CSDL, MSL files for oracle to MS SQL connection by the method mentioned in the link JasonShort - professional profile - CodeProject it worked perfectly fine without the stored procedures. I managed to insert, update, and delete records. Then, I created stored procedures for Insert, Update, Delete. It worked fine with MS SQL. I copied and updated oracle files respectively. I gives me the error mentioned above.

    I executed stored procedures in Oracle SQL Developer, and it works without error. But when it is executed via the model there is light of the error. Can anyone let me know the solution for this error. I'm using VS2010, EF6, Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Thank you

    Prachin Soparkar

    Hello

    Sorry for the inconvenience. After I posted this question I took a break and saw that the error was nothing, but I had given FNAME as parameter name in MS SQL. In oracle when I created the sp I created the parameter with p_FNAME. Where the schema defined in the language SSDL and CSDL, MSL had to be changed to MS, but since I want to that it would be same in different databases, I choose to have changed it in oracle stored procedure. The error msg is confusing, it should be something not found parameter or incompatibility etc.

    Thank you

    Prachin Soparkar

  • Pass an array of bytes to the oracle stored procedure

    I have a problem with moving from byte array in Oracle stored procedure as an input parameter by using odp.net.

    Here is the signature of the stored procedure:

    SOMEPROCEDURE(session IN NUMBER, data IN RAW)

    Here is c# code, which calls the procedure:

    var cmd = new OracleCommand("SOME_PROCEDURE", _connection);

    cmd.CommandType = CommandType.StoredProcedure;

    var bt = new byte[]{1,68,0,83,128,1};

    OracleParameter sessionId = new OracleParameter("dbSessionId", OracleDbType.Decimal, new OracleDecimal(_dbSessionId), ParameterDirection.Input);

    OracleParameter data = new OracleParameter("statusData", OracleDbType.Raw, new OracleBinary(bt), ParameterDirection.Input);

    cmd.Parameters.Add(sessionId);

    cmd.Parameters.Add(data);

    cmd.ExecuteNonQuery();

    This code does not (stored procedure throws exception, which cannot receive), because in byte array hadou number 128!, if I display 128 on another number, minus 128, it works great!

    What should I do?

    After some tests I found the solution. Initially, you cannot switch to the array of bytes via the odp.net stored procedure, if the table contains 127 large values.

    Yes, solution: 1. create the wrapper procedure

    procedure SOME_PROCEDURE_WRAPPER (p_session_id in number, p_data  in varchar2)
     is v_data raw(1024);
     rawdata raw(1024); 
     rawlen number;
     hex varchar2(32760);
     i number;
     begin
      rawlen := length(p_data);
      i := 1;
      while i <= rawlen-1
      loop 
     hex := substrb(p_data,i,2); 
         rawdata := rawdata || HEXTORAW(hex); 
         i := i + 2; end loop; 
         SOME_PROCEDURE(p_session_id , rawdata); 
     end;
    

    2 then need to modify the code c# in this way:

     var cmd = new OracleCommand("SOME_PROCEDURE_WRAPPER", _connection);
     cmd.CommandType = CommandType.StoredProcedure;
     string @string = statusData.ToHexString();
     OracleParameter sessionId = new OracleParameter("dbSessionId", OracleDbType.Decimal, new OracleDecimal(_dbSessionId), ParameterDirection.Input);
     OracleParameter data = new OracleParameter("statusData", OracleDbType.Varchar2,@string.Length, new OracleString(@string), ParameterDirection.Input);
     cmd.Parameters.Add(sessionId);
     cmd.Parameters.Add(data);
     cmd.ExecuteNonQuery();
    

    where

    public static string ToHexString(this byte[] bytes)
     { 
         if(bytes == null || bytes.Length == null)
               return string.Empty;
          StringBuilder hexStringBuilder = new StringBuilder();
          foreach (byte @byte in bytes)
          { 
              hexStringBuilder.Append(@byte.ToString("X2")); 
          } 
          return hexStringBuilder.ToString();
     }
    

Maybe you are looking for