Two Cursor in Procedure

I was trying to use two cursors in a procedure and while compiling in DBA Studio, I get the following error: "Line # = 19 Column # = 14 Error Text = PLS-00341: declaration of cursor 'RECORD_ID_CURSOR' is incomplete or malformed"
Are you not supposed to have two cursors in a procedure? Please help. Thanks.
Paul

PLS-00341 declaration of cursor 'string' is incomplete or malformed
this is the error you are getting. You can have 2 cursors but the way it's defined is incorrect. Check your spellings and the way it's defined.

Similar Messages

  • Two Cursors in a procedure

    I am working on procedure, Please give ideas where i can develop this logic more meaning and easy
    the logic is as follows
    Table1 is having same Id's ABC having same seq number 100 as per legacy data (This is wrong entry in legacy data)
    ID     --    Seqnum
    ABC --     100
    ABC --     100
    I created a table2 where it will have max seqnum from legacy for this ID's for example ABC
    ID  -- Max seqnum
    ABC --500
    In my procedure I will have two cursors
    First cursor will be have Table1 detail
    Second Cursor will have Table2 Details
    In above ex the table will have the first record should be unchanged i.e.,
    ABC --     100 --100
    but second record will change to
    ABC --     100 -- 501(This next value of the max seq number from table 2/Cursor 2)
    I have to create third column which will hold the next seqnumber for that ID ABC
    I should load both records changing the seqnumber so I will not have any duplicate records for same ID.
    So final records will look like
    ID            Seq#       Final_Seq#
    ABC --     100 --     100
    ABC --     100 --      501
    Thanks in advance.

    Adjusted accordingly to the message above
    with
    data_tab as
    (select 'ABC' id,100 seq from dual union all
    select 'ABC',100 from dual union all
    select 'ABC',100 from dual union all
    select 'BCD',110 from dual union all
    select 'CDE',120 from dual union all
    select 'CDE',120 from dual union all
    select 'DEF',130 from dual union all
    select 'EFG',140 from dual union all
    select 'EFG',140 from dual union all
    select 'EFG',140 from dual union all
    select 'EFG',240 from dual union all
    select 'EFG',240 from dual union all
    select 'FGH',150 from dual
    max_nums as
    (select 'ABC' id,200 max_num from dual union all
    select 'BCD',300 from dual union all
    select 'CDE',400 from dual union all
    select 'DEF',500 from dual union all
    -- select 'EFG',600 from dual union all
    select 'FGH',700 from dual
    select d.id,d.seq,row_number() over (partition by d.id,d.seq order by null) rn,m.max_num,
           case when row_number() over (partition by d.id,d.seq order by null) = 1
                then d.seq
                else nvl(m.max_num,d.seq) + row_number() over (partition by d.id,d.seq order by null) - 1
           end new_seq
      from data_tab d,
           max_nums m
    where d.id = m.id(+)
    ID
    SEQ
    RN
    MAX_NUM
    NEW_SEQ
    ABC
    100
    1
    200
    100
    ABC
    100
    2
    200
    201
    ABC
    100
    3
    200
    202
    BCD
    110
    1
    300
    110
    CDE
    120
    1
    400
    120
    CDE
    120
    2
    400
    401
    DEF
    130
    1
    500
    130
    EFG
    140
    1
    140
    EFG
    140
    2
    141
    EFG
    140
    3
    142
    EFG
    240
    1
    240
    EFG
    240
    2
    241
    FGH
    150
    1
    700
    150

  • Two cursors in one procedure

    Hi All,
    Two cursors in the same procedure will slows down the execution ?. Please can any one suggest one this.

    I aggree with Sundar, you might be able to update this without using a cursor. My general understanding is to avoid using cursor as much as possible for performance reasons, if you are doing a lot of inserts/updates etc. If you are doing lot of updates and you must have to iterate through a loop due to some reason then try to use bulk processing (use bulk inserts, updates, one sql query to access data from database to avoid conext switching etc.).

  • Cursors in Procedures

    hi, i am writing a procedure where initially a cursor stores student ids in c_st_id based on certain conditions. Now on the selected Student ids i have to perform more logic which will filter them again and the filrered student ids are stored in cursor c_nf_st_id . Here i want those student ids that are in the cursor c_st_id but not present in c_nf_st_id. Can anybody suggest me how do i perform subtraction in cursors so that i get those that are in first cursor and not present in second cursor.
    CURSOR c_st_id IS
    SELECT st_id FROM ci_st_char a,ci_st b
    where a.adhoc_char_val in( select value from st_val) and a.prem_id=b.char_prem_id and char_type_cd = 'PLOT# '
    and trim(sa_type_cd) in ('stfr',stre,stup,stbo) and st_status_flg in ('20','50')
    ) where r_num=1;
    cr_st_rec c_st_id%ROWTYPE;
    OPEN c_st_id;
    LOOP
    FETCH c_st_id INTO cr_st_rec;
    EXIT WHEN c_st_id%NOTFOUND;
    BEGIN
    CURSOR c_nf_st_id IS
    SELECT st_id FROM ci_ft a,ci_adj b where a.st_id = cr_st_rec.st_id and a.parent_id='PIDPLFEE '
    and a.sibling_id = b.adj_id and b.adj_status_flg in ('50')
    cr_nf_st_rec c_nf_st_id%ROWTYPE;
    END LOOP;
    CLOSE c_st_id;
    Edited by: chesplay on Dec 22, 2011 12:07 AM

    chesplay wrote:
    I should modify my main query where the st id's are taken and perform the second cursor filter there itself , rather than using two cursors? is my undstanding correct?All SQLs are cursors. So there is no getting away from not using cursors.
    The issue is how to effectively use that SQL cursor (and PL/SQL supplies a bunch of interfaces to interact with a SQL cursor).
    A SQL select cursor represents the truth at a specific point in time. A simple example.
    - At T1 you create a cursor for select * from emp.
    - At T2 you fetched 2 of the 100 emp rows.
    - At T3 the CEO in a fit of rage, fires all employees and the employee table content is deleted using a delete from emp cursor and the transaction is committed.
    - At T4 your code, using your select cursor fetches the next set of rows output by that cursor.
    What happens? There are no more rows in the table.
    Your cursor sees the truth at T1. And that is what it will return - all 100 rows. Despite the fact that the new truth (version) of that table says that there are no more rows in that table.
    So from a basic issue of consistency, you need to realise that a cursor itself is consistent. But when you (in the client side) compare or match results from one cursor with another cursor, these cursors can represent different versions of the truth.
    Therefore it is safer to provide both sets of logic for getting the data of interest, and adding the logic for comparing the data of interest, into a single SQL. This is executed as a single cursor - that will look at a single truth and single version of the data of interest.
    The added benefits to this is performance and scalability.
    There is no need for data having to be pulled from the SQL engine for PL/SQL to process - and often then push back to the very same SQL engine for use via yet another cursor.
    Instead of sending SQL data via a detour through the PL/SQL engine to be processed, a single SQL statement is tasked to do this. There's no need for context switching to the PL/SQL engine. No need for the SQL engine to send data to the PL/SQL engine.
    SQL can be parallelised. If the data is being processed by PL/SQL, that by default means a single serialised process. No scalability to deal with larger volumes - unless that PL/SQL code is redesigned and rewritten to support some form of (mostly manual) parallel processing.
    So data crunching is best done using SQL and using SQL alone. It is the best, most flexible, and most performant and scalable language to crunch database data. Only when the crunching is too complex for the SQL language to deal with, then it makes sense to use PL/SQL to fill that gap.
    The basic mantra for using SQL and PL/SQL: maximise SQL and minimise PL/SQL

  • How to compare two cursors

    Hi all,
    I have two different cursors of same recors.
    create table temp_emp as select * from emp;
    cursor cr_emp IS
    select * from emp;
    cursor cr_tmp IS
    select * from temp_emp;
    how to compare these two cursors.
    Im trying to learn comparing cursors variables. I have oracle 11g, windows Vista.
    Initially, I tried to compare only ename coloum:
    create or replace procedure compare
    IS
    cursor cr_emp IS
    select * from emp;
    cursor cr_temp IS
    select * from temp_emp;
    v_cr_emp cr_emp%rowtype;
    v_cr_temp cr_temp%rowtype;
    emp_rownum integer;
    tmpy_rownum integer;
    V_CODE NUMBER;
    V_ERRM VARCHAR2(64);
    BEGIN
    select MAX(rownum) into emp_rownum from emp;
    select MAX(rownum) into tmpy_rownum from tmpy_emp;
    open cr_emp;
    open cr_temp;
    FETCH CR_EMP INTO v_cr_emp;
    FETCH CR_TEMP INTO v_cr_temp;
    for emp_rownum in cr_emp
    loop
    for tmpy_rownum in cr_tmpy
    loop
         if(v_cr_emp.ename = v_cr_temp.ename)
         then
         dbms_output.put_line('equal');
         else
         dbms_output.put_line( 'not equal');
         end if;
    end loop;
    end loop;
    EXCEPTION
    WHEN OTHERS
    THEN
    V_CODE := SQLCODE;
    V_ERRM := SUBSTR(SQLERRM,1,64);
    DBMS_OUTPUT.put_line ('ERROR CODE' || V_CODE || ':' || V_ERRM);
    close cr_emp;
    close cr_tmpy;
    END;
    SQL> start rain.sql
    Procedure created.
    SQL> exec compare
    ERROR CODE-6511:ORA-06511: PL/SQL: cursor already open
    PL/SQL procedure successfully completed.
    Edited by: user10676396 on Apr 16, 2009 7:50 PM

    Hi user10676396,
    Hope this helps you understand the Nested loop, which I assumed you are trying to do in you program.
    Note : Code not compiled and tested.
    create or replace procedure compare
    IS
    cursor cr_emp IS
    select * from emp;
    cursor cr_temp IS
    select * from temp_emp;
    v_cr_emp cr_emp%rowtype;
    v_cr_temp cr_temp%rowtype;
    emp_rownum integer;
    tmpy_rownum integer;
    V_CODE NUMBER;
    V_ERRM VARCHAR2(64);
    BEGIN
    select MAX(rownum) into emp_rownum from emp;
    select MAX(rownum) into tmpy_rownum from tmpy_emp;
    FOR REC IN cr_emp LOOP
         dbms_output.put_line('For Ename in EMP : '||REC.ename ');
    -- In FOR loops demo concept of nested loops
      FOR TREC in cr_temp LOOP
         if(REC.ename = TREC.ename)
         then -- only output when you found a record in Temp
         dbms_output.put_line('....EQUAL rec found in Temp : ' ||TREC.ename');
         else
           null ; -- Don't output if it is not equal
         end if ;
      END LOOP;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    V_CODE := SQLCODE;
    V_ERRM := SUBSTR(SQLERRM,1,64);
    DBMS_OUTPUT.put_line ('ERROR CODE' || V_CODE || ':' || V_ERRM);
    close cr_emp;
    close cr_tmpy;
    END;
    /Sanjay

  • Two "cursors" when in tablet mode

    X61 tablet, Windows 7, RC1, 64 bit. , pdfannotator, onenote, office
    When using the the tablet in tablet mode (screen folded down), I often will get two cursors on the screen when the pen is near or on it.  This happens in various application software, but usually begins after using the eraser, or the flyout keyboard and tablet input menu. 
    The extra cursor appears above, and to the right of the actual cursor. Actual cursor being a pen tip "dot" while the extra cursor is a random symbol, ranging from another offset dot, to a very dark right click ring, to a very dark hourglass, to an i-beam shaped bar.  It happens immediately when using grahl's pdf annotator, but has showed up in other programs as well including onenote, after using the flyout input panel in word, and a number of other programs. 
    I'm certain it has something to do with the tablet multitouch drivers, escpecially since the drivers for 7 seem to be a wacom dual-touch driver not designed specifically for the X61.  Anyone else run into this trouble and come across a solution?

    This is what Microsoft Support told me to do, and it worked, but I am stuck with a boring standard mouse cursor in Windows (no special Tablet PC cursors - for right click, etc.)
    Step 1:
    1. Open Local Group Policy Editor:Run... gpedit.msc
    2. Navigate to User Configuration - Administrative Templates - Windows Components - Tablet PC - Cursors
    3. Enable the Turn off pen feedback setting.
    Step 2:
    Go to Control Panel. Double click on Mouse. Find "Mouse Properties"
    Go to "Pointer Options". Put a check mark in the "Display Pointer trails"
    Slide the bar over to "short". Apply the changes and then restart PDF Annotator.
    I'm awaiting Microsoft's reply as to whether there is some way to keep my original cursors without having the PDF Annotator problem.

  • How can I get extract the data between two cursors on an XY graph

    How can I get extract the data between two cursors on an XY graph

    Well, you say xy graph, so this might be a more complicated problem.
    For a waveform graph it's trivial. Simply get the two cursor indices (property: cursor index) and apply them to array subset of the data. Is that all you need?
    Here's how the above code would look like. using cursor.index instead of cursor.x elimnates the need to include scaling information.
    For an xy graph, there could be multiple segments (e.g. imagine a spiral that passes the desired x range multiple times from both sides). This would neeed significantly more code for a general solution.
    Message Edited by altenbach on 11-24-2009 07:53 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    cursorsubset.png ‏17 KB

  • How return parameter ref Cursor from procedure using dynamic SQL?

    I sorry, but i very need help.
    I using Oracle 8.0.6
    I need to return parameter of type ref Cursor from procedure.
    create or replace package PlanExp is
    type cursortype is ref cursor;
    procedure ShowPlan (cursorparam out
    cursortype.............);
    end PlanExp;
    create or replace package body PlanExp is
    procedure ShowPlan (cursorparam out cursortype,
    .............) Is
    sql_str varchar2(1000);
    sql_str_select varchar2(100);
    sql_str_from varchar2(100);
    sql_str_where varchar2(500);
    Return_Code integer;
    Num_Rows integer;
    cur_id_sel integer;
    tSum_Plan DBMS_SQL.NUMBER_TABLE;
    tSum_Plan_Ch DBMS_SQL.NUMBER_TABLE;
    tSum_Plan_Day DBMS_SQL.NUMBER_TABLE;
    begin
    /* calculating string variables ........... /*
    sql_str := 'select ' || sql_str_select ||
    'from ' || sql_str_from ||
    'where ' || sql_str_where ||
    'group by ' || sql_str_select;
    cur_id_sel := dbms_sql.open_cursor;
    dbms_sql.parse(cur_id_sel, sql_str, dbms_sql.native);
    dbms_sql.define_array(cur_id_sel, 1, tSum_Plan, 20, 1);
    dbms_sql.define_array(cur_id_sel, 2, tSum_Plan_Ch, 20, 1);
    dbms_sql.define_array(cur_id_sel, 3, tSum_Plan_Day, 20, 1);
    Return_Code := dbms_sql.execute(cur_id_sel);
    delete from TEMP_SHOWPLAN;
    Loop
    Num_Rows := dbms_sql.Fetch_Rows(cur_id_sel);
    dbms_sql.column_value(cur_id_sel, 1, tSum_Plan);
    dbms_sql.column_value(cur_id_sel, 2, tSum_Plan_Ch);
    dbms_sql.column_value(cur_id_sel, 3, tSum_Plan_Day);
    if Num_Rows = 0 then
    exit;
    end if;
    Exit When Num_Rows < 20;
    End Loop;
    dbms_sql.close_cursor(cur_id_sel);
    end;
    end PlanExp;
    How return cursor (cursorparam) from 3 dbms_sql.column_value-s ?

    I am using Oracle 8.1.7, so I don't know if this will work in
    8.0.6 or not:
    SQL> CREATE TABLE test
      2    (col1                    NUMBER,
      3     col2                    NUMBER,
      4     col3                    NUMBER)
      5  /
    Table created.
    SQL> INSERT INTO test
      2  VALUES (1,1,1)
      3  /
    1 row created.
    SQL> INSERT INTO test
      2  VALUES (2,2,2)
      3  /
    1 row created.
    SQL> INSERT INTO test
      2  VALUES (3,3,3)
      3  /
    1 row created.
    SQL> CREATE TABLE temp_showplan
      2    (tSum_Plan               NUMBER,
      3     tSum_Plan_Ch            NUMBER,
      4     tSum_Plan_Day           NUMBER)
      5  /
    Table created.
    SQL> EDIT planexp
    CREATE OR REPLACE PACKAGE PlanExp
    IS
      TYPE CursorType IS REF CURSOR;
      PROCEDURE ShowPlan
        (cursorparam    IN OUT CursorType,
         sql_str_select IN     VARCHAR2,
         sql_str_from   IN     VARCHAR2,
         sql_str_where  IN     VARCHAR2);
    END PlanExp;
    CREATE OR REPLACE PACKAGE BODY PlanExp
    IS
      PROCEDURE ShowPlan
        (cursorparam    IN OUT CursorType,
         sql_str_select IN     VARCHAR2,
         sql_str_from   IN     VARCHAR2,
         sql_str_where  IN     VARCHAR2)
      IS
        sql_str                VARCHAR2 (1000);
        cur_id_sel             INTEGER;
        return_code            INTEGER;
      BEGIN
        DELETE FROM temp_showplan;
        sql_str := 'INSERT INTO   temp_showplan '
               || ' SELECT '   || sql_str_select
               || ' FROM '     || sql_str_from
               || ' WHERE '    || sql_str_where;
        cur_id_sel := DBMS_SQL.OPEN_CURSOR;
        DBMS_SQL.PARSE (cur_id_sel, sql_str, DBMS_SQL.NATIVE);
        return_code := DBMS_SQL.EXECUTE (cur_id_sel);
        DBMS_SQL.CLOSE_CURSOR (cur_id_sel);
        OPEN cursorparam FOR SELECT * FROM temp_showplan;
      END ShowPlan;
    END PlanExp;
    SQL> START planexp
    Package created.
    Package body created.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC PlanExp.ShowPlan (:g_ref, 'col1, col2,
    col3', 'test', ' 1 = 1 ')
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    TSUM_PLAN TSUM_PLAN_CH TSUM_PLAN_DAY
             1            1             1
             2            2             2
             3            3             3

  • How to out Dynamic ref cursor from Procedure to Forms

    Hi
    I am trying to out Dynamic ref cursor from Procedure to Forms, But I am unable to do so. however cursor return the value within procedure but I am failed to capture the same in Forms
    Pl advice suggestion if any, Here I am attaching full procedure for reference
    CREATE PACKAGE winepkg
    IS
    TYPE wine IS RECORD ( mynumber number);
    /* Define the REF CURSOR type. */
    TYPE wine_type IS REF CURSOR RETURN wine;
    END winepkg;
    CREATE procedure find_wine
    (col1_in in number,
    c1 out winepkg.wine_type) as
    vsql varchar2(1000);
    cur sys_refcursor;
    x number;
    BEGIN
    vsql:='select bo_id from bo_details where bo_details.bo_id = '||col1_in ;
    open cur for vsql;
    c1:=cur;
    --fetch c1 into x;
    --dbms_output.put_line(x);
    END find_wine;
    In front end forms
    Declare
    TYPE F is REF CURSOR;
    CUR_F F;
    rec number;
    Begin
    break;
    find_wine( 1601480000011078,cur_f ) ;
    Loop
    fetch cur_f into rec ;
    Message(rec ) ;pause;
    exit when cur_f%notfound ;
    End loop ;
    exception
    when others then
    Message(sqlerrm) ;pause;
    End ;

    yo can use
    declare
    c_cursor EXEC_SQL.CursType;
    v_stmt varchar2(2000) = 'select a, b, c from mytab where cond1'; -- you can create this value dynamically
    begin
    c_cursor := Exec_SQL.Open_cursor;
    EXEC_SQL.PARSE(c_articulos, v_stmt);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,1, v_colchar1, 30);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,2, v_colchar2, 15);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,3, v_colchar3, 30);
    v_exec := EXEC_SQL.EXECUTE(c_cursor);
    WHILE EXEC_SQL.FETCH_ROWS(c_cursor) > 0 LOOP
    EXEC_SQL.COLUMN_VALUE(c_cursor,1,v_colchar1);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,2,v_colchar2);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,3,v_colchar3);
    assign_values_to_block;
    END LOOP;
    EXEC_SQL.CLOSE_CURSOR(c_cursor);
    end;
    and WORKS IN FORMS 6

  • I have a plot with two cursors - how can I control the "visible" attribute of the second cursor?

    I have a waveform graph with multiple plots and two cursors. I can use the "cursor->visible" property to control cursor #1 but I cannot seem to find a way to control the visible attribute for cursor #2. Is there a way to do this?
    Thanks,
    RGA

    There's an "Active Cursor" property that allows you select which cursor the following actions operate on. Remember that property nodes "execute" from top to bottom...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Linear fit between two cursors from a signal from a NI-instruments via DAQ-Assistant

    Hi ! 
    I'm currently having som problem with my labview code. I'm trying to make regression on a specific part of my graph. The graph consist of a signal gathered from a NI cDAQ-9178. Currently I can get the live data in a graph (Raw Signal) and then  "zoom in" to the part of the graph that im intrested in by two cursors and then display the results in a new graph (Adjusted Signal). Now a want to make regresion in the new graph. How can i do this the best way ? 
    To be noted I'm a beginner of labview so my code maybe a bit off.
    Best regards Maurlind
    Solved!
    Go to Solution.
    Attachments:
    Rawsignal test.vi ‏245 KB
    rawsignal test.png ‏64 KB

    Hi maurlind,
    I got it, the function that derived the linear fit couldn't handle that large numbers on the x-axis. I edited the VI so that the large number is suctracted for the fit, i.e. the array will now begin at zero time for the fit. It will not affect your plots though, only the algorithm .
    Try it now with the files I provided. The file "pm_mod2_Rawsignal test.vi" should be used with "test3.lvm" (your data). The file "pm_mod3_Rawsignal test.vi" is the same as "pm_mod2_Rawsignal test.vi", but it is arranged to work with the simulated data. The file "test3.lvm" is your data, but the file is slightly edited to work on my system.
    Edit "pm_mod3_Rawsignal test.vi" to fit with your acquired signal as you did with the first file you got from me.
    Attachments:
    1412794.zip ‏483 KB

  • Implementation of linear fit between two cursors

    Hi,
    I am trying to implement a linear fit between two cursors, as I am using total of 4 cursors. I would like to implement linear fit between cursor 2&3. Please help me how to implement it and to find a slope. I am also attaching my code.
    With Regards
    Phani kiran
    Solved!
    Go to Solution.
    Attachments:
    Linear Fit Implementaion.PNG ‏44 KB

    phanikiran wrote:
    Hi koen,
    Now I would like to merge both graphs i.e., Bestfit and XY Graph (in the block diagram). Can you suggest me, I have tried with build array and concenate Inputs function, but no use. Dont mine as I  am new to Labview. Thanks in advance.
    First, get rid of the Express XYGraph subVIs and use the "real" XY graph VIs. The Express ones get you going faster for simple things, but your options are limited.
    Take your X and Y arrays for both your original points and the best fit points (just two points, right?) and combine them into clusters of arrays (instead of feeding them into the XY graph). Then combine these into an array and feed it into your graph. It's all outlined in the XY Graph section of the LabVIEW help file.
    The LV Help File is your friend, learn to use it. It gets lonely if you don't look in on it once in a while.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Operates on two table using procedure

    i want to handle two table using procedure in oracle 10g. i have created a procedure like this
    CREATE OR REPLACE PROCEDURE sold_car1(
    sid soldcar.sold_id%TYPE,
    cid soldcar.id%TYPE,
    cuid soldcar.customer_id%TYPE,
    eid soldcar.emp_id%TYPE,
    d soldcar.dat%TYPE
    ) IS
    BEGIN
    INSERT INTO soldcar VALUES(sid,cid,cuid,eid,to_date(d,'yyyy/mm/dd'));
    DELETE FROM pcar where id=cid;*
    COMMIT;
    END sold_car1;
    SHOW ERRORS
    i have found some errors. how can i do this.

    hi
    the errors are something like this ''the procedure is created with some errors''.
    actually i want to pass 4 parameters in the procedure that will insert in one table and among the 4 parameters by using one parameter i want to delete one row of another table.
    INSERT INTO soldcar VALUES(sid,cid,cuid,eid,to_date(d,'yyyy/mm/dd')); //soldcar is first table
    DELETE * FROM pcar where id=cid; //pcar is second table

  • How to return cursor from procedure to jdbc

    plz help me through example of code as wl as procedure where.... return cursor from procedure to jdbc

    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS OFF
    GO
    CREATE procedure anil3 @count INT OUT,@opcode INT OUT,@total_tiff INT OUT
    as
    declare @query2 varchar(300),@tiff_count int,@query1 varchar(300)
    set @query1='declare move_cursor   cursor forward_only static for
    select count(opcode),opcode from TABLE1 group by opcode
    open move_cursor'
    exec(@query1)
    fetch next  from move_cursor into @count,@opcode
    set @opcode="'"+@opcode+"'"
    set @total_tiff=0
    while (@@fetch_status=0)
    begin
         set @query2='declare move_cursor2  cursor static for '+
         ' select count(tiff) from TABLE2  where opcode='+@opcode+
           ' open move_cursor2 '
         exec(@query2)
         fetch next  from move_cursor2 into @tiff_count
         while (@@fetch_status=0)
         begin
              set @total_tiff=@total_tiff+@tiff_count
              fetch next  from move_cursor2 into @tiff_count
         end
         close move_cursor2
         deallocate move_cursor2
    print  @total_tiff
    print @count
    print @opcode
    fetch next  from move_cursor into @count,@opcode
    end
    close move_cursor
    deallocate move_cursor
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO******************************************************************************
    above this is sql server 2000 PL/SQL and i hv to get the value
    print @total_tiff
    print @count
    print @opcode
    through JDBC
    plz help me out how to return Cursor to JDBC and HOW toPRINT THESE THREE VALUE @total_tiff, @count, @opcode through JDBC
    get this values through JDBC

  • Comparing two cursors

    Hai friends,
    I have two cursors.
    one cursor have minus query(gl liability records minus ap liability records) -->4680 records
    another cursor have writeoff records which are only in gl.--> 254 records
    Now i want to find liability records related to writeoff records.
    To acheive this.
    i compared those two cursors by using cursor for loop
    i got the result ..but it took 2 hours time.so could you please tell me how i overcome this problem.
    Is there any option rather than cursor to compare those two sets of records.
    please let me know how i improve performance in that query..

    You will need to provide a lot more information than that, like table structures (at least for the relevant fields), size of the data etc. Things that can answer the questions you are going to get like:
    What tells you that a liablility record is related to a writeoff record?
    Is the gl_liability minus ap_liability query relevant? That is, does it identify liability records that may be realted to writeoff records?
    Are these three different tables you are looking at, or one table with different record types?
    John

Maybe you are looking for

  • How to create 9i database in NT system

    I'm a new user in Oracle9i. Is that possible anyone can help me to create database in NT system ? Thanks so much and really appreciate.

  • Full outer join Bug or my misunderstanding?

    CREATE GLOBAL TEMPORARY TABLE BP_ATTRIBUTE_CHARVAL_GTT    (     "ATTRIBUTE_ID" NUMBER(10,0),      "PARTNER_ID" NUMBER(10,0),      "CHAR_VALUE" VARCHAR2(4000 BYTE),      "LAST_UPDATE_DATE" DATE,      "DISABLE_DATE" DATE    ) ON COMMIT DEETE ROWS ; CRE

  • F-32 Problem

    Gurus, We have included the line item layout 'A1' for customer open items in the user master record using the transaction FB00 (Editing Options). However, when the user executes the transaction F-32, the line item layout seen on screen is different f

  • Database creation failed Oracle 10g x64

    Hello, Trying to install Oracle 10.2.0.1.0 (x64) on Windows Server 2003 SP2 (x64). Towards end of installation, it fails at Database creation stage, stopping at 2%. Anyone can give any clue on why it happens ??? Appreciate your help..

  • Mac created button will not open PC file (on PC)

    I am creating a simple menu in Acrobat 7, on a Mac. I have two buttons, one opens a mac file, the other opens a PC file. The idea is to click on the appropriate button depending on what platform the user is running. So on my mac, the button works fin