|
|
|
InsertCommand ...
|
|||
|---|---|---|---|
|
#18+
Привет Всем! Уже несколько дней вожусь не могу сделать, помогите: Попроую описать подробно. Выборка идет по 2 таблицам. Строиться дерево запрос след. : SELECT 'P'+ltrim(str(ResearchId))+'R0' as id, Code as Code, null as ParentId, ResearchId as ResearchId, null as ResStrucId, null as ResStrucParentId, null as ResStrucMasterId, null as StrucTypeId, null as StrucTypeCode, Descr as DistributionMaster, ResearchId as ProjectID FROM Research UNION ALL SELECT 'P'+ltrim(str(ResearchId))+'R'+ltrim(str(ResStrucId)) as id, ResStruc.Code as Code, 'P'+ltrim(str(ResearchId))+'R0' as ParentId, ResStruc.ResearchId as ResearchId, ResStruc.ResStrucId as ResStrucId, ResStruc.ResStrucParentId as ResStrucParentId, ResStruc.ResStrucMasterId as ResStrucMasterId, ResStruc.StrucTypeId as StrucTypeId, StrucType.Code as StrucTypeCode, ResStruc.DistributionMaster as DistributionMaster, null as ProjectID FROM ResStruc LEFT OUTER JOIN StrucType ON StrucType.StrucTypeId = ResStruc.StrucTypeId WHERE (ResStrucParentId is null) and (not(ResearchId is null)) UNION ALL SELECT 'P'+ltrim(str(ResearchId))+'R'+ltrim(str(ResStrucId)) as id, ResStruc.Code as Code, 'P'+ltrim(str(ResearchId))+'R'+ltrim(str(ResStrucParentId)) as ParentId, ResStruc.ResearchId as ResearchId, ResStruc.ResStrucId as ResStrucId, ResStruc.ResStrucParentId as ResStrucParentId, ResStruc.ResStrucMasterId as ResStrucMasterId, ResStruc.StrucTypeId as StrucTypeId, StrucType.Code as StrucTypeCode, ResStruc.DistributionMaster as DistributionMaster, null as ProjectID FROM ResStruc LEFT OUTER JOIN StrucType ON StrucType.StrucTypeId = ResStruc.StrucTypeId WHERE not(ResStrucParentId is null) данные показываю в трилисте(девекспресс). Update, Delete из соответствующих таблиц работает, а вот Insert не получается. Помогите. P.S. ParentId поле для одной из таблиц всегда null. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 28.08.2006, 11:01 |
|
||
|
|

start [/forum/topic.php?fid=17&fpage=105&tid=1353189]: |
0ms |
get settings: |
6ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
29ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
35ms |
get tp. blocked users: |
1ms |
| others: | 193ms |
| total: | 297ms |

| 0 / 0 |
