Itgensql056 構文エラー on result_set_name(***"ProjectTimeTransactions"***)

Invantive Data Hub Multi-Platform (26.0.168-PROD+5986) でこのSQLステートメントにエラーが発生しました:

create or replace table pjttime@inmemorystorage
as
select /*+ result_set_name("ProjectTimeTransactions") */
       pjt.DivisionLabel
,      pjt.Code ProjectCode
,      ptn.EntryNumber
,      pjt.ClassificationDescription 
       label '{res:itgen_eol_project_classification}'
,      pjt.TypeDescription 
       label '{res:itgen_project_type}'
,      ptn.date
,      to_char(ptn.StartTime, 'HH24:MI') 
       StartTime
       label '{res:itgen_eol_start_time}'
,      to_char(ptn.EndTime, 'HH24:MI')
       EndTime
       label '{res:itgen_eol_end_time}'
,      to_char(ptn.date, 'YYYY-IW') 
       iso_week
       label '{res:itgen_iso_week_number}'
,      to_char(ptn.date, 'D') 
       day_of_iso_week
       label '{res:itgen_day_number_iso_week}'
,		emp.id
,      emp.EmployeeHID
,      emp.FullName
       EmployeeFullName
       label '{res:itgen_eol_employee}'
,      aet.JobTitleDescription
,      aet.departmentcode
,      aet.InternalRate
,      ptn.Quantity
,      ptn.Currency
,      ptn.AmountFC
,      ptn.PriceFC
,      act.Code
       AccountCode
       label '{res:itgen_eol_account_code}'
,      act.Name 
       AccountName
       label '{res:itgen_eol_account_name}'
,      wbs.Description
       ActivityDescription
       label '{res:itgen_eol_activity_description}'
,      ssn.Number
       SubscriptionNumber
       label '{res:itgen_eol_subscription_number}'
,      ssn.Description
       SubscriptionDescription
       label '{res:itgen_eol_subscription_description}'
,      pjt.ManagerFullName
,      pts.Description 
       HourStatusDescription
       label '{res:itgen_eol_hour_status}'
,      itm.Code
       ItemCode
       label '{res:itgen_eol_item_code}'
,      itm.Description
       ItemDescription
       label '{res:itgen_eol_item_description}'
,      igp.Code
       ItemGroupCode
       label '{res:itgen_eol_item_group_code}'
,      igp.Description
       ItemGroupDescription
       label '{res:itgen_eol_item_group_description}'
,      itm.Unit
,      ptn.Notes
from   pjt@inmemorystorage pjt
join   PjtTimeTransactionsIncremental@eol ptn
on     ptn.Division = pjt.Division
and    ptn.Project  = pjt.id
join   ProjectTimeTransactionHourStatuses@eol pts
on     pts.Code = to_char(ptn.HourStatus)
join   ExactOnlineREST..Employees@eol emp
on     emp.id       = ptn.Employee
left
outer
join   ExactOnlineREST..ActiveEmployments@eol aet
on     aet.employee = emp.id
left
outer
join   ItemsIncremental@eol itm
on     itm.Division = ptn.Division
and    itm.id       = ptn.item
left
outer
join   ItemGroups@eol igp
on     igp.Division = ptn.Division
and    igp.id       = itm.ItemGroup
left
outer
join   AccountsIncremental@eol act
on     act.Division = ptn.Division
and    act.id       = ptn.account
left
outer
join   SubscriptionsIncremental@eol ssn
on     ssn.Division      = ptn.Division
and    ssn.EntryId       = ptn.Subscription
left
outer
join   pjtwbs@inmemorystorage wbs
on     wbs.Division   = ptn.Division
and    wbs.ID         = ptn.WBS

エラーメッセージ:

itgensql056
行3, 列27の2つの '’ の間の構文エラー。
create or replace tabl…ct /
+ result_set_name(
“ProjectTimeTransactions”**) */ pjt.DivisionLabel,…

エラー: 入力で「create or replace table pjttime@inmemorystorage\r\nas\r\nselect /*+ result_set_name(“ProjectTimeTransactions”」に応じた選択肢がありません。
Invantive.Basics.ValidationException..ctor(GlobalState owner, ExecutionOptions executionOptions, String messageCode, String errorMessage, String kindRequest, String localStackTrace, String nk, Exception innerException, Boolean inheritMessageCodeWhenPresent, Nullable1 uid, Nullable1 isRecoverable, String poolIdentityId, String url, Nullable1 partyUid, String partitionCode, String tableName, String parameter1, String parameter2, String parameter3, String parameter4, String parameter5, String clientId) にて Invantive.Basics.InvantiveSqlException..ctor(GlobalState owner, ExecutionOptions executionOptions, String validationCode, String errorMessage, String kindRequest, String stackTrace, String nk, Exception innerException, Boolean inheritMessageCodeWhenPresent, Nullable1 uid, Boolean isRecoverable, String poolIdentityId, String partitionCode, String tableName, String parameter1, String parameter2, String parameter3, String parameter4, String parameter5, String clientId) にて
Invantive.Data.InvantiveParserErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException triggeringException) にて

これをどう解決すればよいですか?

ヒント result_set_name では二重引用符を使用しています。リリース25.0までは、単一引用符の代わりに二重引用符を使用することが可能でした。

標準化の観点から、リリース26.0以降ではこれができなくなります。

二重引用符を単一引用符に置き換えることをお勧めします。

まだ機能していません。彼はそれを通り抜けますが、SQLで結果セットを返しません。具体的に言うと、私が毎回変更したのは以下の通りです。

元:

select /*+ result_set_name("Projects") */

変更後:

select /*+ result_set_name('Projects') */

つまり、ダブルクォートをシングルクォートに置き換えました。

しかし、まだSQLで結果セットを記録していません。

推奨されるのは、ユーザーが十分な権限を持っていることを確認することです。これは、このクエリの後に SessionIOs@DataDictionary を確認することで行えます。権限が不十分の場合、行は返されず、また登録にエラーメッセージが表示されます。

それでも解決しない場合は、以下に記載されたように、この処理のトレースファイルを送信することが推奨されます:

ユーザーに十分な権限があることを99.9%確信しています。なぜでしょうか?

  • 顧客は権限を変更していないことを保証しています。
  • クエリエディタ経由でテーブルにアクセスできます。

結果セットがうまく流れているのに、書き込みがされません。

それでもまだ動作しません。

私はこの種類のクエリに基づいてSQLデータベース内に INVOICETERMS のようなテーブルを期待しています:

use
select spn.code
,      'eol'
from   systempartitions@DataDictionary spn
where  spn.provider_data_container_alias = 'eol'

declare
  l_incl_pjt_type_campaign      boolean  := true;
  l_incl_pjt_type_fixed_price   boolean  := true;
  l_incl_pjt_type_time_material boolean  := true;
  l_incl_pjt_type_non_billable  boolean  := true;
  l_incl_pjt_type_prepaid       boolean  := true;
  l_incl_pjt_historic           boolean  := true;
  l_incl_pjt_active             boolean  := true;
  l_incl_pjt_future             boolean  := true;
  l_pjt_code                    varchar2 := null;
  l_pjt_classification          varchar2 := null;
  l_pjt_account_name_pattern    varchar2 := null;
  l_pjt_description_pattern     varchar2 := null;
  l_pjt_manager_pattern         varchar2 := null;
begin
  --
  -- 選択されたプロジェクト。
  --
  create or replace table pjt@inmemorystorage
  as
  select sdn.Label
         DivisionLabel
         label '{res:itgen_eol_division_label}'
  ,      pjt.division
  ,      act.Code
         AccountCode
  ,      act.Name
         AccountName
  ,      pjt.id
  ,      pjt.code
  ,      pjt.description
  ,      pjt.BudgetedCosts
  ,      pjt.BudgetedRevenue
  ,      pjt.BudgetedAmount
  ,      pjt.BudgetedRevenue - pjt.BudgetedCosts BudgetedMargin
  --
  -- 追加項目。
  --
  ,      pjt.startdate
  ,      pjt.enddate
  ,      pjt.type
  ,      pcn.Description 
         ClassificationDescription
         label '{res:itgen_eol_classification}'
  ,      pjt.InternalNotes
  ,      pte.Description TypeDescription
  ,      usr.FullName
         ManagerFullName
         label '{res:itgen_eol_manager_full_name}'
  ,      act.country
         AccountCountry
  from   ProjectsIncremental@eol pjt
  left
  outer
  join   projectclassifications@eol pcn
  on     pcn.Division = pjt.Division
  and    pcn.id       = pjt.Classification
  --
  -- クラス分類によるフィルタリング。
  --
  and    ( l_pjt_classification is null
           or
           pcn.Description = l_pjt_classification
         )
  left
  outer
  join   ExactOnlineREST..Users@eol usr
  on     usr.Division = pjt.Division
  and    usr.UserId   = pjt.Manager
  --
  -- プロジェクトマネージャーによるフィルタリング。
  --
  and    usr.Fullname like coalesce(l_pjt_manager_pattern, '%')
  join   ProjectTypes@eol pte
  on     pte.Code = to_char(pjt.Type)
  join   AccountsIncremental@eol act
  on     act.Division = pjt.Division
  and    act.id       = pjt.account
  --
  -- アカウント名によるフィルタリング。
  --
  and    act.name like coalesce(l_pjt_account_name_pattern, '%')
  join   SystemDivisions@eol sdn
  on     sdn.Code = pjt.Division
  where  true
  --
  -- 固定価格 / T&M。
  --
  and    ( ( pjt.type = 1 and l_incl_pjt_type_campaign = true )
           or
           ( pjt.type = 2 and l_incl_pjt_type_fixed_price = true )
           or
           ( pjt.type = 3 and l_incl_pjt_type_time_material = true )
           or
           ( pjt.type = 4 and l_incl_pjt_type_non_billable = true )
           or
           ( pjt.type = 5 and l_incl_pjt_type_prepaid = true )
         )
  --
  -- 日付の選択。
  --
  and    ( ( l_incl_pjt_historic = true and coalesce(pjt.enddate, trunc(sysdate)) < trunc(sysdate) )
           or
           ( l_incl_pjt_active = true and pjt.startdate <= trunc(sysdate) and coalesce(pjt.enddate, trunc(sysdate)) >= trunc(sysdate) )
           or
           ( l_incl_pjt_future = true and pjt.startdate > trunc(sysdate) )
         )
  --
  -- コードによるフィルタリング。
  --
  and    pjt.code = coalesce(l_pjt_code, pjt.code)
  --
  -- 説明によるフィルタリング。
  --
  and    pjt.description like coalesce(l_pjt_description_pattern, '%')
  ;
end;


create or replace table pjtitm@inmemorystorage
as
select pjt.DivisionLabel
,      pjt.code 
       projectcode 
       label '{res:itgen_eol_project_code}'
,      pjt.description
       ProjectDescription
       label '{res:itgen_eol_project_description}'
,      itm.deliverable
,      itm.description
,      itm.amount
,      itm.percentage
--
-- 請求予定日または実際の請求日、既に請求されたかどうかに依存します。
--
,      itm.invoicedate 
,      itm.ExecutionFromDate
,      itm.ExecutionToDate
,      itm.itemdescription
from   pjt@inmemorystorage pjt
join   invoiceterms@eol itm
on     itm.Division = pjt.Division
and    itm.project  = pjt.id

create or replace table InvoiceTerms@Master
as
select /*+ result_set_name('InvoiceTerms') */
       pim.DivisionLabel
,      pim.ProjectCode
,      pim.projectdescription
,      pim.deliverable
,      pim.description
,      pim.amount
,      pim.percentage
,      pim.invoicedate 
,      pim.ExecutionFromDate
,      pim.ExecutionToDate
,      pim.itemdescription
from   pjtitm@inmemorystorage pim
order
by     pim.DivisionLabel
,      pim.ProjectCode
,      pim.Description

Invantive Cloud を介して実行すると、92 のプロジェクトで 38 の InvoiceTerms が返され、きちんと保存されます。後でオンプレミスの状況を確認する必要があります。

接続は正常に機能しているように見えましたが、意図したのとは異なるSQLサーバーデータベースに書き込んでいました。