Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precision and Scale not handled yet #213

Open
programmergrammar opened this issue May 26, 2023 · 3 comments
Open

Precision and Scale not handled yet #213

programmergrammar opened this issue May 26, 2023 · 3 comments

Comments

@programmergrammar
Copy link

On one of my databases, I get the error "Precision and Scale not handled yet". I don't see how this is possible since the line that generates this error seems to be looking for the data type "numberic" https://github.com/sethreno/schemazen/blob/master/Library/Models/UserDefinedType.cs#L89. It seems like numberic is just a misspelling of numeric. I'm using SchemaZen v2. Any ideas on how to fix the issue would be appreciated.

@programmergrammar
Copy link
Author

I see now that my problem was with the 'decimal' type for a user defined type.

@sethreno
Copy link
Owner

@programmergrammar Hi there, will you post a create script the object so it's easy to reproduce?

@programmergrammar
Copy link
Author

--FeeVolume_UDT

USE [PDS]
GO

/****** Object:  UserDefinedDataType [dbo].[FeeVolume_UDT]    Script Date: 6/5/2023 12:08:28 PM ******/
CREATE TYPE [dbo].[FeeVolume_UDT] FROM [decimal](12, 6) NULL
GO


USE [PDS]
GO


--Table using the FeeVolume_UDT type
/****** Object:  Table [dbo].[SPBPmts]    Script Date: 6/5/2023 12:09:55 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[SPBPmts](
	[PmtNbr] [dbo].[PmtNbr_UDT] NOT NULL,
	[PmtAFIN] [dbo].[AFIN_UDT] NOT NULL,
	[PmtCounty] [dbo].[County_UDT] NOT NULL,
	[PmtIssueDate] [datetime] NULL,
	[PmtModDate] [datetime] NULL,
	[PmtExpirationDate] [datetime] NULL,
	[PmtVoidDate] [datetime] NULL,
	[PmtMedia] [dbo].[MediaCode_UDT] NOT NULL,
	[PmtType] [dbo].[Code4_UDT] NOT NULL,
	[PmtStaff] [dbo].[Init_UDT] NOT NULL,
	[PmtStatus] [char](2) NOT NULL,
	[PmtStatusDate] [datetime] NULL,
	[InitPmtFeeInvNbr] [dbo].[InvoiceNum_UDT] NOT NULL,
	[FeeCode] [dbo].[Code4_UDT] NOT NULL,
	[FeeVolume] FeeVolume_UDT(decimal(12,6), null),
	[InvComment] [varchar](75) NOT NULL,
	[InvCommentPrtYN] [dbo].[YN_UDT] NOT NULL,
	[InvSinglePmtYN] [dbo].[YN_UDT] NOT NULL,
	[InvSinglePmtLblYN] [dbo].[YN_UDT] NOT NULL,
	[PmtContactName] [dbo].[Name_UDT] NOT NULL,
	[PmtContactPhone] [dbo].[PhoneNbr_UDT] NOT NULL,
	[PmtFaxNbr] [dbo].[PhoneNbr_UDT] NOT NULL,
	[PmtEmail] [varchar](75) NOT NULL,
	[PmtMailAddr1] [dbo].[Addr_UDT] NOT NULL,
	[PmtMailAddr2] [dbo].[Addr_UDT] NOT NULL,
	[PmtMailAddr3] [dbo].[Addr_UDT] NOT NULL,
	[PmtMailCity] [dbo].[City_UDT] NOT NULL,
	[PmtMailState] [dbo].[State_UDT] NOT NULL,
	[PmtMailZip] [dbo].[Zip_UDT] NOT NULL,
	[PmtMailCountry] [dbo].[Country_UDT] NOT NULL,
	[OperatorID] [dbo].[Code4_UDT] NOT NULL,
	[PmtPrimarySICCode] [dbo].[SICCode_UDT] NOT NULL,
	[PmtSecondarySICCode] [dbo].[SICCode_UDT] NOT NULL,
	[PmtTertiarySICCode] [dbo].[SICCode_UDT] NOT NULL,
	[PmtPrimaryNAICSCode] [dbo].[NAICSCode_UDT] NOT NULL,
	[PmtSecondaryNAICSCode] [dbo].[NAICSCode_UDT] NOT NULL,
	[PmtTertiaryNAICSCode] [dbo].[NAICSCode_UDT] NOT NULL,
	[PriorPmtNbr] [dbo].[PmtNbr_UDT] NOT NULL,
	[PmtOtherIdentifier] [dbo].[OtherIdentifier_UDT] NOT NULL,
	[PmtComment] [varchar](300) NOT NULL,
	[PmtHistory] [varchar](1200) NOT NULL,
	[StreamSegment] [char](2) NOT NULL,
	[NearestStream] [dbo].[StreamName_UDT] NOT NULL,
	[BrineSystem] [varchar](30) NOT NULL,
	[BrineField] [varchar](20) NOT NULL,
	[BrineVolumeBSWPD] [int] NULL,
	[BrinePressurePSIG] [int] NULL,
	[BrineStorageBBL] [int] NULL,
	[BrineSystemWellsQty] [int] NULL,
	[BrineInjectionWells] [int] NULL,
	[BrineCutoffSwYN] [dbo].[YN_UDT] NULL,
	[FacSizeComment] [varchar](300) NOT NULL,
	[SPBNbrPoultryBroilers] [int] NULL,
	[SPBNbrPoultryLayers] [int] NULL,
	[SPBNbrPoultryHatchery] [int] NULL,
	[SPBNbrTurkeys] [int] NULL,
	[SPBNbrKennels] [int] NULL,
	[SPBNbrSwineOver55lbs] [int] NULL,
	[SPBNbrSwineUnder55lbs] [int] NULL,
	[SPBNbrMatureDairyCows] [int] NULL,
	[SPBNbrDairyHeifers] [int] NULL,
	[SPBNbrVealCalves] [int] NULL,
	[SPBNbrCattle] [int] NULL,
	[SPBNbrHorses] [int] NULL,
	[SPBNbrSheepOrLambs] [int] NULL,
	[SPBNbrDucks] [int] NULL,
	[SPBNbrOther] [int] NULL,
	[SPBNbrOtherSpecifyName] [varchar](75) NOT NULL,
	[PmtGISOriginalCoordinateSystem] [varchar](10) NOT NULL,
	[PmtGISOriginalDatumCode] [dbo].[GISDatumCode_UDT] NOT NULL,
	[PmtGISCurrentDatumCode] [dbo].[GISDatumCode_UDT] NOT NULL,
	[PmtLatDegrees] [dbo].[LLDegrees_UDT] NULL,
	[PmtLatMinutes] [dbo].[LLMinutes_UDT] NULL,
	[PmtLatSeconds] [decimal](4, 2) NULL,
	[PmtLongDegrees] [dbo].[LLDegrees_UDT] NULL,
	[PmtLongMinutes] [dbo].[LLMinutes_UDT] NULL,
	[PmtLongSeconds] [decimal](4, 2) NULL,
	[PmtLatDecimal] [decimal](9, 6) NULL,
	[PmtLongDecimal] [decimal](9, 6) NULL,
	[PmtUTMNorthing] [decimal](9, 2) NULL,
	[PmtUTMEasting] [decimal](8, 2) NULL,
	[PmtUTMZone] [dbo].[UTMZone_UDT] NOT NULL,
	[PmtSectionTownshipRange] [varchar](150) NOT NULL,
	[PmtGISDateMeasured] [datetime] NULL,
	[PmtGISSourceName] [varchar](50) NOT NULL,
	[PmtGISCollectorStaffCode] [varchar](6) NOT NULL,
	[PmtGISCertifiedMeasurementYN] [dbo].[YN_UDT] NOT NULL,
	[PmtGPSReceiverTypeName] [varchar](50) NOT NULL,
	[PmtGPSReceiverChannels] [int] NULL,
	[PmtGISBaseStationName] [varchar](50) NOT NULL,
	[PmtGISBaseStationDistance] [int] NULL,
	[PmtGISMinPointPositions] [int] NULL,
	[PmtGISPDOPMask] [decimal](4, 1) NULL,
	[PmtGISSNRMask] [int] NULL,
	[PmtGISHorizAccuracy] [varchar](50) NOT NULL,
	[PmtGISComment] [varchar](150) NOT NULL,
	[PmtGISHUC] [dbo].[GISHUC] NOT NULL,
	[PmtGISPlanningSegment] [dbo].[GISPlanningSegment] NOT NULL,
	[PmtGISArkSenDist] [dbo].[GISArkSenDist] NOT NULL,
	[PmtGISArkRepDist] [dbo].[GISArkRepDist] NOT NULL,
	[RecCreatedBy] [dbo].[UserID_UDT] NOT NULL,
	[RecCreatedDate] [datetime] NULL,
	[RecModifiedBy] [dbo].[UserID_UDT] NOT NULL,
	[RecModifiedDate] [datetime] NULL,
 CONSTRAINT [PK_SPBPmts] PRIMARY KEY CLUSTERED 
(
	[PmtNbr] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__Operato__251FAF49]  DEFAULT (' ') FOR [OperatorID]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__SPBNbrO__2613D382]  DEFAULT (' ') FOR [SPBNbrOtherSpecifyName]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISO__5582242B]  DEFAULT (' ') FOR [PmtGISOriginalCoordinateSystem]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISO__56764864]  DEFAULT (' ') FOR [PmtGISOriginalDatumCode]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISC__576A6C9D]  DEFAULT (' ') FOR [PmtGISCurrentDatumCode]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtSect__585E90D6]  DEFAULT (' ') FOR [PmtSectionTownshipRange]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISS__5952B50F]  DEFAULT (' ') FOR [PmtGISSourceName]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISC__5A46D948]  DEFAULT (' ') FOR [PmtGISCollectorStaffCode]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISC__5B3AFD81]  DEFAULT ('N') FOR [PmtGISCertifiedMeasurementYN]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGPSR__5C2F21BA]  DEFAULT (' ') FOR [PmtGPSReceiverTypeName]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISB__5D2345F3]  DEFAULT (' ') FOR [PmtGISBaseStationName]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISH__5E176A2C]  DEFAULT (' ') FOR [PmtGISHorizAccuracy]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISC__5F0B8E65]  DEFAULT (' ') FOR [PmtGISComment]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISH__5FFFB29E]  DEFAULT (' ') FOR [PmtGISHUC]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISP__60F3D6D7]  DEFAULT (' ') FOR [PmtGISPlanningSegment]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISA__61E7FB10]  DEFAULT (' ') FOR [PmtGISArkSenDist]
GO

ALTER TABLE [dbo].[SPBPmts] ADD  CONSTRAINT [DF__SPBPmts__PmtGISA__62DC1F49]  DEFAULT (' ') FOR [PmtGISArkRepDist]
GO

ALTER TABLE [dbo].[SPBPmts]  WITH NOCHECK ADD  CONSTRAINT [FK_SPBPmts_AFIN] FOREIGN KEY([PmtAFIN])
REFERENCES [dbo].[Facilities] ([AFIN])
GO

ALTER TABLE [dbo].[SPBPmts] CHECK CONSTRAINT [FK_SPBPmts_AFIN]
GO



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants