Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2012
    Posts
    6

    Unanswered: Db2 sp with cursor

    Hi Friends,
    Am new to DB2...

    Could u please look at it what is wrong in the bellow sp in DB2 on Linux am not able to get the output




    create procedure insert_data()
    language sql
    begin
    declare sqlstate char(5) default '00000';

    declare v_id numeric(5);
    declare v_loc varchar(10);

    declare c1 cursor for
    select name,id,location
    from test_proc;

    open c1;

    fetch from c1 into v_name,v_id,v_loc;

    while(sqlstate = '00000') do

    insert into test_proc1(name,id,location) values(v_name,v_id,v_loc);

    commit;

    end while;

    close c1;

    end

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    so : what is the problem
    creating the sp - running the sp
    what is the error/symptom
    try dba studio and run in debug mode.....
    should we come over to resolve this ??
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Mar 2012
    Posts
    6
    Hey thanks i tried in debug mode and got the output

    Quote Originally Posted by przytula_guy View Post
    so : what is the problem
    creating the sp - running the sp
    what is the error/symptom
    try dba studio and run in debug mode.....
    should we come over to resolve this ??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •