I am using Delphi 10.3.2, UniDAC 8.0.1, SQL Server 2012 Express 64Bit, targeting Win32 platform.
I have following script:
Code: Select all
CREATE VIEW [CRM_DayAlert] AS
SELECT dbo.Customer.CustomerID, dbo.Customer.Username, dbo.CustomerContact.EntryDate, dbo.CustomerContact.EntryUser,
dbo.CustomerContact.ContactName, dbo.CustomerContact.CustomerPosition, dbo.CustomerContact.Email, dbo.CustomerContact.Phone,
dbo.CustomerContact.Extension, dbo.CustomerContact.MobilePhone, dbo.CustomerContact.Address, dbo.CustomerContact.Bithday,
dbo.CustomerContact.Weddingday, dbo.CustomerContact.PartnerName, dbo.CustomerContact.PartnerBirthday, dbo.CustomerContact.ChildrenBirthDay,
dbo.CustomerContact.VisitPeriod, dbo.CustomerContact.VisitDate, dbo.CustomerContact.PhoneCallPeriod, dbo.CustomerContact.PhoneCallDate,
DATEADD(day, { fn MOD(CAST(dbo.CustomerContact.PhoneCallPeriod AS INT), DATEDIFF(day, dbo.CustomerContact.PhoneCallDate, GETDATE())) },
GETDATE()) AS PhoneCallPeriodDate, DATEADD(day, { fn MOD(CAST(dbo.CustomerContact.VisitPeriod AS INT), DATEDIFF(day,
dbo.CustomerContact.VisitDate, GETDATE())) }, GETDATE()) AS VisitPeriodDate, CAST({ fn MOD(CAST(dbo.CustomerContact.VisitPeriod AS INT),
DATEDIFF(day, dbo.CustomerContact.VisitDate, GETDATE())) } AS NVARCHAR) + N' gün sonra' AS VisitPeriodDateName,
CAST({ fn MOD(CAST(dbo.CustomerContact.PhoneCallPeriod AS INT), DATEDIFF(day, dbo.CustomerContact.PhoneCallDate, GETDATE())) } AS NVARCHAR)
+ N' gün sonra' AS PhoneCallPeriodDateName, dbo.Customer.VipCustomer, dbo.Customer.CustomerLock, dbo.CustomerPool.CustomerPool,
dbo.CustomerCategory.CATEGORY, dbo.Customer.Customer
FROM dbo.Customer INNER JOIN
dbo.CustomerContact ON dbo.Customer.CustomerID = dbo.CustomerContact.CustomerID INNER JOIN
dbo.CustomerPool ON dbo.Customer.CustomerPoolID = dbo.CustomerPool.CustomerPoolID INNER JOIN
dbo.CustomerCategory ON dbo.Customer.CustomerCategoryID = dbo.CustomerCategory.CAT_ID
Code: Select all
Empty macro or function name.
Is there a way to run that script with TUniQuery?
Thanks & regards,
Ertan