
Опытный
 
Профиль
Группа: Участник
Сообщений: 332
Регистрация: 27.12.2008
Репутация: нет Всего: 1
|
Блин не фига не понимаю как можно вывести в DBGRID? вот вложеная процедура, писал сам так что не пинайте сильно Код | create or alter procedure FUNC_SEARCH_IN_GROUP ( IGROUP_ID integer, ISEARCH varchar(30)) returns ( OFIO varchar(50), OGROUP_TITLE varchar(100), OTELS varchar(100), OADRESES varchar(100), OEMAILS varchar(100), OATTACHMETS varchar(1000), OSUBINFO varchar(3000)) as declare variable PFIO varchar(100); declare variable PCONTACT_ID varchar(100); declare variable PGROUP_TITLE varchar(100); declare variable PGROUP_ID integer; begin if (igroup_id = 0) then begin for select contacts.fio, contacts.id, contacts.groups_id from contacts where (contacts.fio containing :isearch) into :pfio, :pcontact_id, :pgroup_id do begin ofio = :pfio; if (exists(select groups.title from groups where groups.id = :pgroup_id)) then begin for select groups.title from groups where (groups.id = :pgroup_id) into :pgroup_title do begin ogroup_title = :pgroup_title; end end else begin ogroup_title = 'none'; end execute procedure func_show_phones_contact_by_id(:pcontact_id) returning_values otels; otels = iif(otels is null, '', otels); execute procedure func_show_adreses_contact_by_id(:pcontact_id) returning_values oadreses; oadreses = iif(oadreses is null, '', oadreses); execute procedure func_show_emails_contact_by_id(:pcontact_id) returning_values oemails; oemails = iif(oemails is null, '', oemails); execute procedure func_show_attach_contact_by_id(:pcontact_id) returning_values oattachmets; oattachmets = iif(oattachmets is null, '', oattachmets); execute procedure func_show_subinfo_contact_by_id(:pcontact_id) returning_values osubinfo; osubinfo = iif(osubinfo is null, '', osubinfo); suspend; end end else if (:igroup_id = 1) then begin for select contacts.fio, contacts.id, contacts.groups_id from contacts where (contacts.fio containing :isearch) into :pfio, :pcontact_id, :pgroup_id do begin if (not exists(select groups.id from groups where (groups.id = :pgroup_id))) then begin ofio = :pfio; ogroup_title = ('none'); execute procedure func_show_phones_contact_by_id(:pcontact_id) returning_values otels; otels = iif(otels is null, '', otels); execute procedure func_show_adreses_contact_by_id(:pcontact_id) returning_values oadreses; oadreses = iif(oadreses is null, '', oadreses); execute procedure func_show_emails_contact_by_id(:pcontact_id) returning_values oemails; oemails = iif(oemails is null, '', oemails); execute procedure func_show_attach_contact_by_id(:pcontact_id) returning_values oattachmets; oattachmets = iif(oattachmets is null, '', oattachmets); execute procedure func_show_subinfo_contact_by_id(:pcontact_id) returning_values osubinfo; osubinfo = iif(osubinfo is null, '', osubinfo); suspend; end end end else if (igroup_id > 1) then begin for select contacts.fio, contacts.id, groups.title from contacts, groups where ((contacts.fio containing :isearch) and (contacts.groups_id = :igroup_id) and (groups.id = :igroup_id)) into :pfio, :pcontact_id, :pgroup_title do begin ofio = :pfio; execute procedure func_show_phones_contact_by_id(:pcontact_id) returning_values otels; otels = iif(otels is null, '', otels); execute procedure func_show_adreses_contact_by_id(:pcontact_id) returning_values oadreses; oadreses = iif(oadreses is null, '', oadreses); execute procedure func_show_emails_contact_by_id(:pcontact_id) returning_values oemails; oemails = iif(oemails is null, '', oemails); execute procedure func_show_attach_contact_by_id(:pcontact_id) returning_values oattachmets; oattachmets = iif(oattachmets is null, '', oattachmets); execute procedure func_show_subinfo_contact_by_id(:pcontact_id) returning_values osubinfo; osubinfo = iif(osubinfo is null, '', osubinfo); ogroup_title = pgroup_title; suspend; end end end
|
|