![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
#3
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
#4
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
#5
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
#6
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
#7
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
#8
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
#9
| |||
| |||
|
|
I have two pg tables that I try to define sub-forms and controls in: Table:formdef form_no serial, form_id varchar(10) Table:formdet form_no references(formdef), ctrl_id varchar(10) ctrl_type character(1) check(ctrl_type in ('c', 'f')) ctrl_type defines if ctrl_id is a sub-form or a control on form_no What I would like to do is to get a list of all forms that are sub-forms of a given (parameter passed) "main" form. If I do: select * from formdef where form_no = 1 union select * from formdef where form_no in (select ctrl_id from formdet where ctrl_type = 'f' and form_no = 1) the result is giving me all the form and sub-forms for form_no = 1, but what when I also want all sub-sub-forms and sub-sub[-sub[-sub]]...-forms if they do exist without having to predetermine how many levels there are defined? |
![]() |
| Thread Tools | |
| Display Modes | |
| |