Hoe kopieer ik Tixly naar SQL Server?

Tixly (voorheen: Tix) is een applicatie voor ticket management in leisure zoals voor bioscopen en theaters. Voor Tixly is een driver beschikbaar waarmee zowel vanuit SQL als Power BI eenvoudig gegevens verwerkt kunnen worden.

De volgende code kan als een voorbeeld gebruikt worden om de Tixly-data te kopieren naar een Azure SQL Server omgeving. Voor de basisinrichting zie ook Elementaire datareplicatie tussen Exact Online en Azure SQL Server.

De volgende code kopieert een aantal tabellen:

begin
  cloud_http.set_use_template(true);
  cloud_http.set_template_step_name('Kopieer Tixly naar SQL Server');
  cloud_http.append_line_to_response_body_text('<ul>');
  --
  -- Reference data.
  --
  -- Products
  --
  create or replace table TixlyProducts@mss
  as
  select * 
  from   ProductSaleRanges@tly /* Change to Products on next release. */
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyProducts: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Transaction data.
  --
  -- Customers
  --
  create or replace table TixlyCustomers@mss
  as
  select *
  from   customers@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyCustomers: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Gift card sales
  --
  create or replace table TixlyGiftCardSales@mss
  as
  select *
  from   giftcardrange@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyGiftCardSales: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Memberships
  --
  create or replace table TixlyMemberships@mss
  as
  select * 
  from   memberships@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyMemberships: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Product sales
  --
  create or replace table TixlyProductSales@mss
  as
  select * 
  from   SoldProducts@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyProductSales: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Event tickets
  --
  create or replace table TixlyEvents@mss
  as
  select *
  from   Events@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyEvents: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Event tickets
  --
  create or replace table TixlyEventAllocations@mss
  as
  select *
  from   EventAllocations@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyEventAllocations: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Event tags
  --
  create or replace table TixlyEventTags@mss
  as
  select *
  from   EventTags@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyEventTags: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Event categories
  --
  create or replace table TixlyEventCategories@mss
  as
  select *
  from   EventCategories@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyEventCategories: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Donations
  --
  create or replace table TixlyDonations@mss
  as
  select *
  from   Donations@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyDonations: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  -- Event tickets
  --
  create or replace table TixlyEventTickets@mss
  as
  select *
  from   EventTickets@tly
  ;
  cloud_http.append_line_to_response_body_text('<li>TixlyEventTickets: ' || to_char(sqlrowcount) || ' rijen gekopieerd om ' || to_char(sysdateutc, 'DD-MM-YYYY HH24:MI:SS') || '.</li>');
  --
  cloud_http.append_line_to_response_body_text('</ul>');
end;