オスロエラーの説明“ M2037:SQL Generation Internal Error:Missing generator for variable&#8221 ;?

StackOverflow https://stackoverflow.com/questions/253746

  •  05-07-2019
  •  | 
  •  

質問

Microsoft Oslo SDK CTP 2008(Intellipadを使用)では、次のコードが正常にコンパイルされます。

module T {

    type A {
        Id : Integer32 = AutoNumber();
    } where identity Id;

    As : A*;

    type B {
        Id : Integer32 = AutoNumber();
//        A : A;
//    } where A in As && identity Id;
    } where identity Id;

    Bs : B*;

    type C {
        Id : Integer32 = AutoNumber();
        B : B;
    } where B in Bs && identity Id;

    Cs : C*;

}

そして、次のReach SQL出力になります:

set xact_abort on;
go

begin transaction;
go

set ansi_nulls on;
go

create schema [T];
go

create table [T].[As]
(
    [Id] int not null identity,
    constraint [PK_As] primary key clustered ([Id])
);
go

create table [T].[Bs]
(
    [Id] int not null identity,
    constraint [PK_Bs] primary key clustered ([Id])
);
go

create table [T].[Cs]
(
    [Id] int not null identity,
    [B] int not null,
    constraint [PK_Cs] primary key clustered ([Id]),
    constraint [FK_Cs_B_T_Bs] foreign key ([B]) references [T].[Bs] ([Id])
);
go

commit transaction;
go

ただし、モジュールTのコメント行を次のように変更した後

        A : A;
    } where A in As && identity Id;
//    } where identity Id;

エラーメッセージ" M2037:SQL Generation Internal Error:Missing generator for variable 'A'"が表示されます(IntellipadのReach SQLウィンドウに)。

アイデアはありますか

よろしく、タンバーグ

役に立ちましたか?

解決

あなたが望むのは次のとおりだと思います:

type A {
    Id : Integer32 = AutoNumber();
} where identity Id;

As : A*;

type B {
    Id : Integer32 = AutoNumber();
    A : A;
} where identity Id;

Bs : (B where value.A in As)*;

type C {
    Id : Integer32 = AutoNumber();
    B : B;
} where identity Id && B in Bs;

Cs : (C where value.B in Bs)*;

制約はここでは型ではなく外部にあることに注意してください。制約が型にあるとき、同様のコードを取得できましたが、複数の関係を深くすることはできませんでした。それらを外部に移動すると正しいように見え、予想されるReach SQLが生成されます。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top