If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > stored procedure help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-21-11, 05:38
dushan1987 dushan1987 is offline
Registered User
 
Join Date: Mar 2011
Posts: 7
stored procedure help

i want to write stored procedure to return bp_praccno char(5) and bp_prname char(20) values from the table called bt_provider. how can i do that?? pls help me. thank u
Reply With Quote
  #2 (permalink)  
Old 03-21-11, 05:46
dushan1987 dushan1987 is offline
Registered User
 
Join Date: Mar 2011
Posts: 7
name of the database is "hdfc" and returning two things are a account number and a provider name. thanks
Reply With Quote
  #3 (permalink)  
Old 03-21-11, 06:49
InformixWilli InformixWilli is offline
Registered User
 
Join Date: Sep 2010
Location: Germany, Brunswick
Posts: 52
Code:
create procedure test () returning char(5), char(20);
  define bp_praccno char(5);
  define bp_prname char(20);
  foreach c1 for
    select customer_num, lname into bp_praccno,bp_prname from bt_provider
    return bp_praccno, bp_prname  with resume;
  end foreach;
end procedure;

select bp_praccno, bp_prname 
from table(test())(bp_praccno,bp_prname)
where bp_praccno > 110;
Didn't test but should work.
__________________
WilhelmW
IBM Certified Database Associate

wilhelmw.de - www.isr.de
Reply With Quote
  #4 (permalink)  
Old 03-21-11, 23:22
dushan1987 dushan1987 is offline
Registered User
 
Join Date: Mar 2011
Posts: 7
thank u sir, but it gives me a error
674: Routine (get_provider) can not be resolved.
111: ISAM error: no record found.
what u mean by customer_num and lname in ur procedure ??
what s the meaning of where bp_praccno > 110;??

Last edited by dushan1987; 03-21-11 at 23:50.
Reply With Quote
  #5 (permalink)  
Old 03-22-11, 03:13
InformixWilli InformixWilli is offline
Registered User
 
Join Date: Sep 2010
Location: Germany, Brunswick
Posts: 52
Sorry

Code:
create procedure test () returning char(5), char(20);
  define bp_praccno char(5);
  define bp_prname char(20);
  foreach c1 for
    select bp_praccno,bp_prname into bp_praccno,bp_prname from bt_provider
    return bp_praccno, bp_prname  with resume;
  end foreach;
end procedure;

select bp_praccno, bp_prname 
from table(test())(bp_praccno,bp_prname)
where bp_praccno > 110;
__________________
WilhelmW
IBM Certified Database Associate

wilhelmw.de - www.isr.de
Reply With Quote
  #6 (permalink)  
Old 03-22-11, 03:21
dushan1987 dushan1987 is offline
Registered User
 
Join Date: Mar 2011
Posts: 7
thank u very much
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On