Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Column into a List using SQL
Message
From
20/09/2001 04:02:53
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00558622
Message ID:
00558631
Views:
18
Thanks Got It Here's the final solution for future reference:
create or replace
function get_list(p_mainkey in varchar2)
    return varchar2
    is
        --Use AT to avoid mutating table error in trigger
    	pragma autonomous_transaction;
    	l_str  varchar2(2000) default null;
        l_sep varchar2(1) default null;
   begin
        for x in ( select articleno from specific where mainkey = p_mainkey and artictype like 'artwork%') loop
           l_str := l_str || l_sep || x.articleno;
          
            l_sep:=',';
           
       end loop;
       return l_str;
   end;
/ 


--the trigger that does the job.
CREATE OR REPLACE TRIGGER tr_artwork_tomain
BEFORE INSERT OR UPDATE ON "SPECIFIC"
FOR EACH ROW
BEGIN
   --Copy a Search list to main based an artwork number...
    update styles set moc060=get_list(:new.mainkey) where mainkey=:new.mainkey;
 END;
/
Previous
Reply
Map
View

Click here to load this message in the networking platform