Need to query in a stored procedure

Hi all

I need to create a stored procedure that does not take any parameter, it's simply an SP which only made the update.

I update two tables here twice, I update the tables matched_news and matched_news_industries under certain conditions.

I update two tables twice and after two update tables once, I need to update another table is gm_sector_activity_tracker table, in this update that I need
update of is_transfered = 'Y' where is_transfered = "M" but I need to update only the rows that are updated in above two updates.

It means assume that my above two updated day to day only 4 rows, so I need to update the records in the gm_sector_activity_tracker table.

Here's the code for MS:

CREATE OR REPLACE PROCEDURE SI_UPDATE_SOURCES_LOGO_PDF AS

BEGIN

update of matched_news one

Set logo_source = (select distinct source_logo from news_sources

where channel_id = a.channel_id

and a.newS_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am')

and 'a.newS_type =' Reports

and a.LOGO_SOURCE is null

and a.channel_id not in (6522,6835,6944,6945,6946,7189,8396,8397,8398,5395,9176,9177));

COMMIT;

update of matched_news_industries one

Set logo_source = (select distinct source_logo from news_sources

where channel_id = a.channel_id

and a.newS_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am')

and 'a.newS_type =' Reports

and a.LOGO_SOURCE is null

and a.channel_id not in (6522,6835,6944,6945,6946,7189,8396,8397,8398,5395,9176,9177));

COMMIT;

/ * Once this is done, we need to update the table "gm_sector_activity_tracker" column is_transferred = 'Y' where is_transferred = am' one by one.* /

Matched_News update

source_name = value (select distinct (ltrim (rtrim (source_name))) of channel_source_type)

WHERE CHANNEL_ID = A.CHANNEL_ID

and ONTO_ID = a.ONTO_ID

and a.channel_id not in (6522,6835,6944,6945,6946,7189,8396,8397,8398,5395,9176,9177)

and 'a.news_type =' Reports

and a.auto_status = 'Categorized'

and a.news_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am'))

where exists (select channel_source_type source_name

where channel_id = a.channel_id

and ONTO_ID = a.ONTO_ID

and a.channel_id not in (6522,6835,6944,6945,6946,7189,8396,8397,8398,5395,9176,9177)

and 'a.news_type =' Reports

and a.auto_status = 'Categorized'

and a.news_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am'));

COMMIT;

Update matched_news_industries has

source_name = value (select distinct (ltrim (rtrim (source_name))) of channel_source_type)

WHERE CHANNEL_ID = A.CHANNEL_ID

and ONTO_ID = a.ONTO_ID

and a.channel_id not in (6522,6835,6944,6945,6946,7189,8396,8397,8398,5395,9176,9177)

and 'a.news_type =' Reports

and a.auto_status = 'Categorized'

and a.news_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am'))

where exists (select channel_source_type source_name

where channel_id = a.channel_id

and ONTO_ID = a.ONTO_ID

and a.channel_id not in (6522,6835,6944,6945,6946,7189,8396,8397,8398,5395,9176,9177)

and 'a.news_type =' Reports

and a.auto_status = 'Categorized'

and a.news_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am'));

COMMIT;

/ * Once this is done, we need to update the table "gm_sector_activity_tracker" column is_transferred = 'Y' where is_transferred = am' one by one.*.

END SI_UPDATE_SOURCES_LOGO_PDF;

Thank you


Your instructions to update, it's what you do:

MERGE INTO MATCHED_NEWS HAS

WITH THE HELP OF NEWS_SOURCES B

WE (A.CHANNEL_ID = B.CHANNEL_ID)

WHEN MATCHED THEN

UPDATE

SET A.LOGO_SOURCE = B.SOURCE_LOGO

WHERE A.NEWS_ID IN (NEWS_ID HAS SELECTION SUMMER)

OF GM_SECTOR_ACTIVITY_TRACKER

WHERE IS_TRANSFERRED = AM')

AND A.NEWS_TYPE = 'reports '.

AND A.LOGO_SOURCE IS NULL

AND A.CHANNEL_ID NOT IN (6522,

6835,

6944,

6945,

6946,

7189,

8396,

8397,

8398,

5395,

9176,

9177);

You can do the same for the other tables as separate MERGE one after the other.

Tags: Database

Similar Questions

  • Need to query to find stored procedures that takes great execution time

    Hi all

    I use the oracle version below:

    Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    is it possible to find the name of stored procedure that take too long to run, I need those optimized all SPs.

    Is there a query as top queries that are used to find queries albums that have great time for execution...

    or y at - it another way to find the names of MS. I try with AWR report but showing only used the names of MS.

    Thank you

    No, it not there no such request as far as I know.

    or y at - it another way to find the names of MS.

    Just listen to complaints from the user...

  • I need to return the result of a query on a stored procedure

    I need to return the result of a query to a stored procedure, I mean when I run a stored procedure it returns a result set in a select statement.
    Best regards...

    Hello.

    Do you really want a stored procedure for this?
    Why not just a script that contains the query?

    Assuming that you don't really want a stored procedure, you'll have to decide what to do with the results.
    An option is a slider.

    For example, you can write a procedure of this type to hold the query:

    CREATE OR REPLACE PROCEDURE USP_TEST
    (     out_cursor     OUT     SYS_REFCURSOR
    )
    IS
    BEGIN
         OPEN  out_cursor
         FOR     SELECT     *
              FROM     scott.emp;
    END  USP_TEST;
    /
    SHOW ERRORS
    

    You can move the cursor to another procedure for handling.

    You could test this in SQL * more by creating a variable blond:

    VARIABLE     usp_test_cursor     REFCURSOR;
    
    EXEC  usp_test (:usp_test_cursor);
    
    PRINT     :usp_test_cursor
    
  • Need help to convert a sql query to a stored procedure

    I have a task to convert a script sql in a stored precedure. The sql with different pr_id test_type are below. And the stored procedure must accept a pr_id and a test_type as an argument. Test type will be 3 for ATI and 2 for TI.  It must return a single value, the greatest distance calculated to fill the value of tap.  It is possible that they will pass a prid, test_type combination that will have all the records in the dsltdr table.

    {
    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464529581
    AND test_type = 3
    ORDER BY pw CSA;
    }



    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464528353
    AND test_type = 3
    ORDER BY pw CSA;


    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464527142
    AND test_type = 2
    ORDER BY pw CSA;


    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464528984
    AND test_type = 2
    ORDER BY pw CSA;



    >

    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464529918
    AND test_type = 2
    ORDER BY pw CSA;

    How to start with?

    Thanks in advance.

    I removed the dbms_output statement because it does not seem to turn it on. If you do this from sqlplus
    Make sure that you type "serverout on" and press return.

    declare
    vPW number := 0 ;
    vDistance number := 0 ;
    begin
    sp_dsl_test(3,'12345',vDistance,vPW) ;
    DBMS_OUTPUT.PUT_LINE('Distance = '|| vDistance || ' PW = '|| vPW);
    end;
    

    Published by: FlyingGuy on March 3, 2011 14:24

  • A query in the stored procedure

    Hello

    I use EXECUTE IMMEDIATE to run a DDL statement in a stored procedure.

    But I can't see this picture, please tell me why.


    create or replace procedure names
    is
    Start
    EXECUTE IMMEDIATE ' CREATE TABLE execute_table (col1 VARCHAR (10))';
    commit;
    end;
    */*

    Created procedure.

    You must perform the procedure as well; only for creating it does not table:

    BEGIN
     NAmes;
    END;
    
    OR 
    
    EXEC NAmes; (from SQL*PLUS)
    
  • Need help by calling the stored procedure

    Hi Experts,

    I created under procedure, while calling me, it throws an error.
    CREATE OR REPLACE PROCEDURE spdemo (param1 OUT NUMBER)
     is
     BEGIN
     SELECT COUNT(*) INTO param1
     FROM TEST_DEMO;
     END;
    Can any1 help me get the result or to call this procedure?

    Thnx in advance...

    Published by: 977490 on January 18, 2013 02:25

    Hello

    977490 wrote:
    ... I created under procedure, while calling me, it throws an error.

    If the problem of the call, and then after the call.

    Here's a possible way to call spdemo and see the results:

    SET   SERVEROUTPUT   ON
    
    DECLARE
        test_demo_cnt  NUMBER;
    BEGIN
        spdemo (test_demo_cnt);
    
        dbms_output.put_line (test_demo_cnt || ' = value returned by spdemo');
    END;
    /
    
    CREATE OR REPLACE PROCEDURE spdemo (param1 OUT NUMBER)
    is
    BEGIN
    SELECT COUNT(*) INTO param1
    FROM TEST_DEMO;
    END;
    

    I'm tempted to make a function, not a procedure.

    CREATE OR REPLACE FUNCTION spdemo
    RETURN NUMBER
     IS
        cnt          NUMBER;
     BEGIN
         SELECT  COUNT (*)
         INTO    cnt
         FROM    test_demo;
    
         RETURN  cnt;
     END;
    /
    SHOW ERRORS
    

    Then you can call it in the SQL statements, as you call functions such as SYSDATE:

    SELECT     spdemo
    FROM     dual
    ;
    
  • How to do this consult of a hierarchical recursion on a stored procedure? Help!

    Please help me, im using oracle 11g

    I have 2 tables

    Department table (number of I_Depto (1), number of E_Depto (30));

    i_depto e_dept

    1 Finance

    2 shopping

    3 sistemas

    4               rh

    Empleado table (I_Emp number (5), N_Emp varchar (20), Q_salary (8.2) number, number of I_boss (5), the number of I_Depto (1));

    i_emp n_emp q_salary i_boss i_dept

    Juan 100 300 null 1

    200 100 100 1 Pedro

    300 Angélique 150 100 1

    400 70 300 2 alberto

    500 60 300 2 Miriam

    600 3 500 80 moises

    And yet, I have 3 conditions:

    If the boss has 3 employees or more, he has increased his salary by 20%

    If the boss have 2 employees, there was an increase in his salary of 10%

    And if 0 or 1 employee, there is an increase of 5%

    herarchical diagram is like that

    -> Pedro Juan

    Juan-> Angelica-> Alberto

    Juan-Angelica-Miriam-Moses > > >

    I have to present the name of the Department (e_depto) in the console and the result should be like this;



    SQL > exec p_example ('finance');

    Employees of BOSS of the boss pay increase employees (name) boss of the salary increase employee employees employees

    juan             6                                              60                             pedro                                   0                                      5

    juan             6                                              60                             angelica                               3                                    45

    pedro           0                                                5                              NULL                                  0                                     0

    Angelica       3                                              45                              alberto                                0                                     5

    Anglica         3                                               45                              miriam                               1                                     3

    SQL > exec p_example ('shopping');

    Employees of BOSS of the boss pay increase employees (name) boss of the salary increase employee employees employees

    alberto             0                                              3.5                             -                                   0                                      0

    miriam             1                                                3                         moises                            0                                    4

    SQL > exec p_example('sistemas);

    Employees of BOSS of the boss pay increase employees (name) boss of the salary increase employee employees employees

    moises             0                                            4                              -                                  0                                      0

    His need to create a recurrence, stored procedure

    The query I have is this, but it only shows me that the boss and the boss employees.

    createor replace procedure deptos (depto varchar) as

    t_boss varchar (49);

    t_employ varchar (50);

    cursor c_depto (t_depto varchar) is

    Select a.n_emp boss, employee of b.n_emp

    of empleado a, b empleado, departamento d

    where a.i_emp = b.i_boss (+) and d.i_dept = a.i_dept

    and a.i_emp in (select i_EMP from empleado where i_dept = t_dept);

    Start

    Open c_depto (depto);

    loop

    extract the c_depto in t_boss t_employ;

    When the output c_depto % notfound;

    dbms_output.put_line (t_boss |) Chr (9) | Chr (9) | t_employ);

    end loop;

    end;

    /

    Hello

    I know it's a pain to post CREATE TABLE and INSERT statements for the sample data.  Think about why it is necessary: that people who want to help you can recreate the problem and test their ideas.  If you post statements that do not work, which does not recreate the problem or to test their ideas.  Test (and, if necessary, correct) your statements before committing.  Make sure all quotes are balanced.

    I don't understand the desired output.  For example, when n_emp = 'Juan', why is-employees_ofthe_boss = 6, 5 no?  When n_emp is 'Angelic', why is-salary_increase = 45, not 30?  When n_emp = 'Alberto', why is-salary_increase = 5, not 3.5?

    You may want something like this:

    WITH universe_dup AS

    (

    SELECT i_emp, n_emp, q_sueldo, i_jefe

    SYS_CONNECT_BY_PATH (i_emp, ","). ',' AS line

    ,       LEVEL                                    AS lvl

    Of empleado

    START WITH (IN) i_depto

    SELECT i_depto

    OF Department

    WHERE e_depto = 'Finance' - or what you want

    )

    CONNECT BY i_jefe = PRIOR i_emp

    )

    universe

    (

    SELECT i_emp, n_emp, q_sueldo, i_jefe

    MAX (lineage) DUNGEON (DENSE_RANK LAST ORDER BY lvl) AS lineage

    MIN AS min_level (lvl)

    Of universe_dup

    GROUP of i_emp, n_emp, q_sueldo, i_jefe

    )

    got_salary_increase AS

    (

    SELECT a.i_emp, a.n_emp, a.i_jefe, a.min_level

    EARL of (d.i_emp) AS employee_cnt

    , a.q_sueldo * CASE

    WHEN COUNT (d.i_emp) > = 3 PUIS.2

    WHEN COUNT (d.i_emp) = 2 PUIS.1

    OF AUTRE.05

    END AS salary_increase

    OF the universe a

    LEFT OUTER JOIN universe d ON d.lineage LIKE '%', | a.i_emp | ',%'

    AND d.i_emp <> a.i_emp

    GROUP OF a.i_emp, a.n_emp, a.i_jefe, a.min_level, a.q_sueldo

    )

    SELECT p.n_emp AS boss

    p.employee_cnt AS employees_ofthe_boss

    p.salary_increase AS salary_increase_boss

    c.n_emp AS employees_name

    , NVL (c.employee_cnt, 0) AS employees_ofthe_employee

    , NVL (c.salary_increase, 0) AS salary_increase_employee

    OF got_salary_increase P

    LEFT OUTER JOIN got_salary_increase c ON c.i_jefe = p.i_emp

    WHERE p.min_level = 1

    ;

    Depending on your data and your needs, it may be more effective to do "START WITH i_jefe IS NULL", as one of the above.  I guess "START WITH i_depto (...)" in the largest tables, when efficiency is more important.

  • How to call a stored procedure PL/SQL of the Disqualification?

    I figured I could do this from a Groovy script but I am unable to make it work.

    Let's take the simplest scenario:

    At the end of a job, I have a need to call an once stored procedure that has no arguments.

    Translated by the logic of the stored procedure with Disqualification is not an option.

    If you must call it once at the end of a task, you must use the external task.

    If you call a procedure for each record, it can be done using a script.

  • call a pl/sql stored procedure from a report link

    Hi all:

    I have a report with a link in a column, which you take to another page and passes the values to this page, but also need to link, run a stored procedure before you go to the other page.

    In the Forum, I found a case similar to this one, but none of the examples is clear to me that I'm doing this. It seems that the target of the link must be URL, and also I have to call the stored procedure with a javascript function.

    My questions are:
    -Is the best way to do what I need?
    -How should be the syntax of the link that takes me to another page and run the "procedure".
    -How and where I put the "javascript" function to execute the "stored procedure".


    BDD: Oracle 11 g
    Apex 4.1 version


    Best regards

    Gerard

    Hello

    Change the link to call an apex.submit procedure. (javascript).

    Edit:

    I created a basic example.

    Region 1 (just so that you can see the value ready):

    Select: P27_HIDDEN item_Value
    of the double

    Region 2:

    rownum SELECT id, dbms_random.string ('U', 12) sss
    of the double
    connect by level<=>

    element attributes for ID:

    Target: URL
    URL: javascript:apex.submit ({request: 'NAVIGATE', value: {'P27_HIDDEN': #ID #}});

    (P27_HIDDEN is just a hidden item I created)

    http://Apex.Oracle.com/pls/Apex/f?p=54920:27

    Edit2:

    In your case, then you can only have a page based on conditions request = expression1, expression1: NAVIGATE... then a branch of the page to go to the desired page, also with the same conditions

    Edit3:

    I'm not sure what examples you're talking about, that you provide no link; but you mention calling the stored procedure of javascript, so would probably involve some AJAX, but is not necessary IMO.

  • Call of postChanges() front of a stored procedure

    I use 11.1.1.2 JDeveloper and ADF with BC. I have the following situation:

    I am updating a record via a modifiable display object. When I click on validate, I also need to call an existing stored procedure on my database to do some updates. The stored procedure queries the table on which my principal object based and did the updates with other tables/records based on this information. Is there a mistake in the stored procedure, then I want to roll back the changes in my app module, so I can't commit changes in module app until I know that the stored procedure was a success. But the stored procedure cannot see my changes from the object until they are committed (or changes).

    I am considering the following:
    (1) make changes to display the object
    (2) call postChanges() on transaction of my app module
    (3) call the procedure stored via the PreparedStatement class
    (4) commit (if errors, rollback)

    This is the preferred method for this situation?

    Thank you
    Brad

    Brad,

    As long as the stored procedure does not commit, there is no autonomous transaction and you can be sure that the postChanges() and commit() will be called in the same request, I think you should be OK.

    Nick

  • How to return a value from stored procedure.

    Hello

    I have an insert in which insert a username through generated sequence number.

    I need this generated sequence number stored procedure return.

    Kindly help me to achieve this goal.

    It might be useful if there is a code sample for the same thing.

    Thank you
    Ahmed Shareefuddin

    Something like this:

    create or replace procedure xproc (num out number) is
    begin
     insert into mytab values (myseq.nextval);
     select myseq.currval into num from dual;
    end;
    /
    

    Max
    http://oracleitalia.WordPress.com

  • Passing parameters to the query to extract in a stored procedure

    How pass us in a parameter of a query retrieves in a stored procedure?

    Because for example I: -.

    FOR SheikYerbouti in company

    LOOP

    SELECT extract (response,'/ list/hwid [@name = "Tom"] / descendant::node () / address) employee where id = 9506;

    END OF LOOP

    Instead of TOM, I want to pass a variable because I use the stored procedure. The variable is emp_rec.name

    SELECT extract (response,'/ list/hwid [@name = emp_rec.name]/descendant::node()/address) employee where id = 9506; does not work?

    The XPath expression is of type string, concatenate the value:

    extract (answer, "/ List/hwid[@name="' |) emp_rec. Name | ([""] descendant::node () ')

    However, depending on your version of the database, there may be better alternatives, so if you can give us a little more explanation on your requirement, we would be able to offer other options.

  • Can get us data back from a stored procedure in a select query?

    Hello
    Suppose I have a function GetSum(x,y) that returns the sum of two numbers x and y. We can call this function from a function sql like this:
    select GetSum(4,5) SUM from dual;
    But it's possible thanks to a stored procedure? for example, can I call a stored procedure from a select query, as I did above code?

    bootstrap wrote:
    Hello
    Suppose I have a function GetSum(x,y) that returns the sum of two numbers x and y. We can call this function from a function sql like this:

    select GetSum(4,5) SUM from dual;
    

    But it's possible thanks to a stored procedure?

    NO!

  • Need help, run the stored procedure in ASP.

    I have a web page in which I would use a query like http://ereply.us/q/l.asp?id=383966476 string

    It directs the user to a page that contains the following code:

    <!-queue = "database_connection.asp #include" - > "
    < %
    If not isempty (request.querystring ("id")) then
    SQL = "exec dbo.fp_qr_code @sequence (request.querystring ("id")) =" "

    If rs.state = 1 then rs.close
    RS. Open sql, conn, 3, 2

    If rs.recordcount <>0 then
    session("Name") = rs ("name")
    session("JobID") = rs ("jobid")
    session("SEQ") = rs ("seq")

    If rs ("id") <>"" then the answer. " Redirect ("index.asp")
    end if
    end if
    % >

    It queries a SQL database to return the value of 'name '. In turn, according to the code of the user should be directed to 'Index.asp' that contains:

    Welcome < % response.write (session("name")) % >

    And the page you should see the page with"Welcome".  Instead, I get a server 500 error.  The stored procedure runs as a stand-alone query in SQL Management Studio.

    Any ideas would be greatly appreciated.

    I solved this.  This is the query that worked:

    < %="">< br="">SQL = "" exec fp_qr_code ' "& request.querystring ("id") &" ' " < br=""> set rs = Conn.Execute (sql) < br=""> if rs.eof then response.write ("no registration") < br=""> while not rs.eof" ""
    response.write (("name") rs)

    response.write (("imgname") rs)

    response.write (rs ('url'))

    RS.MoveNext
    Wend < br=""> %>

  • Stored procedure for IN query parameter

    Hello

    Here's the scenario

    The user is allowed to search for a product on multiple values. Interface user can enter value as

    A, B, C, D (all string values)

    This value is passed to a stored procedure as parameter (say v_multipleId). Can I use the v_multipleId directly IN the query?

    Example of

    Select some_value in the une_table where some_colum IN (v_multipleId)?

    If not, then how can I do this?

    Thanks in advance

    N ° you can use dynamic SQL statements. You can also do the following. Just spent a values separated by commas, for example ", A, B, D,' like v_multipleId and use:"

    Select some_value from some_table where v_multipleId like '%,' || some_colum || ',%'
    

    Keep in mind, index on some_colum (assuming there is one) will not be used.

    SY.

Maybe you are looking for

  • I need to change the keyboard on Tecra M5

    Hello I need to change the keyboard on a tecra m5.Unfortunately, this is not mentioned in the manual how to do this. Please advice. Thanks in advance for your help. Best regardsWim Gijsels

  • Hardware upgrade - Ram

    Product: HP DV6-3217TU Product no.: LQ916PA Operating system: Windows 7 Ultimate 64 - Bit Hello HP,. I need to apply my RAM upgrade, now I'm using 2 * 2 = 4 GB of ram ddr3 an i want to upgrade to 8 GB ddr3 ram... I have 2 memoryslots... Can I install

  • Setup / uninstall no longer works

    I am running Windows Vista Home Premium, 32 bit, the pk 2 on a Dell XPS 410 PC service.  I recently downloaded "SpeedUpMyPc" and now wish to uninstall it.  After clicking on this program in the folder programs, by clicking on the button uninstall, I

  • Client Security Microsoft is missing

    my MSC seems to have disappeared or does not appear in my files. How can I reinstall this Microsoft security customer / Microsoft Security Essentials? My backup failed to set restore for some reason points any. Can I get a download of restore Microso

  • XmlType or dbms_xmlstore

    Hi allI did not understand something, you can help me.If I have a xml file and I want to relational table mapping tool should I use?the DBMS package, or using functions defined in XMLType ?? and why?Thank you