{"id":2307,"date":"2021-04-23T09:39:15","date_gmt":"2021-04-23T13:39:15","guid":{"rendered":"https:\/\/anvil-of-time.com\/?p=2307"},"modified":"2021-04-23T09:39:15","modified_gmt":"2021-04-23T13:39:15","slug":"powerbuilder-tables-script","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-tables-script\/","title":{"rendered":"PowerBuilder Tables Script"},"content":{"rendered":"<p>Here is a script to generate the PowerBuilder &#8216;cat&#8217; tables for SQL Server (pbcatcol, pbcatedt, pbcatfmt, pbcattbl, pbcatvld).\u00a0 Depending upon the permissions of the user who is connecting, these may not be created automatically from PB.\u00a0 Modify to reflect the database user as appropriate (dbo in this script).\u00a0 Supposedly this is available from the installation files but damn if I could find it.<\/p>\n<p>If you are migrating from one db to another you may need to generate your own scripts for the data depending upon whether or not you added to the tables.<\/p>\n<pre><code>\/****** Object:  Table [dbo].[pbcatcol]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nSET ANSI_NULLS ON\r\nGO\r\nSET QUOTED_IDENTIFIER ON\r\nGO\r\nCREATE TABLE [dbo].[pbcatcol](\r\n\t[pbc_tnam] [varchar](128) NOT NULL,\r\n\t[pbc_tid] [int] NULL,\r\n\t[pbc_ownr] [varchar](128) NOT NULL,\r\n\t[pbc_cnam] [varchar](128) NOT NULL,\r\n\t[pbc_cid] [smallint] NULL,\r\n\t[pbc_labl] [varchar](254) NULL,\r\n\t[pbc_lpos] [smallint] NULL,\r\n\t[pbc_hdr] [varchar](254) NULL,\r\n\t[pbc_hpos] [smallint] NULL,\r\n\t[pbc_jtfy] [smallint] NULL,\r\n\t[pbc_mask] [varchar](31) NULL,\r\n\t[pbc_case] [smallint] NULL,\r\n\t[pbc_hght] [smallint] NULL,\r\n\t[pbc_wdth] [smallint] NULL,\r\n\t[pbc_ptrn] [varchar](31) NULL,\r\n\t[pbc_bmap] [varchar](1) NULL,\r\n\t[pbc_init] [varchar](254) NULL,\r\n\t[pbc_cmnt] [varchar](254) NULL,\r\n\t[pbc_edit] [varchar](31) NULL,\r\n\t[pbc_tag] [varchar](254) NULL\r\n) ON [PRIMARY]\r\nGO\r\n\/****** Object:  Table [dbo].[pbcatedt]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nSET ANSI_NULLS ON\r\nGO\r\nSET QUOTED_IDENTIFIER ON\r\nGO\r\nCREATE TABLE [dbo].[pbcatedt](\r\n\t[pbe_name] [varchar](30) NOT NULL,\r\n\t[pbe_edit] [varchar](254) NULL,\r\n\t[pbe_type] [smallint] NULL,\r\n\t[pbe_cntr] [int] NULL,\r\n\t[pbe_seqn] [smallint] NOT NULL,\r\n\t[pbe_flag] [int] NULL,\r\n\t[pbe_work] [varchar](32) NULL\r\n) ON [PRIMARY]\r\nGO\r\n\/****** Object:  Table [dbo].[pbcatfmt]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nSET ANSI_NULLS ON\r\nGO\r\nSET QUOTED_IDENTIFIER ON\r\nGO\r\nCREATE TABLE [dbo].[pbcatfmt](\r\n\t[pbf_name] [varchar](30) NOT NULL,\r\n\t[pbf_frmt] [varchar](254) NULL,\r\n\t[pbf_type] [smallint] NULL,\r\n\t[pbf_cntr] [int] NULL\r\n) ON [PRIMARY]\r\nGO\r\n\/****** Object:  Table [dbo].[pbcattbl]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nSET ANSI_NULLS ON\r\nGO\r\nSET QUOTED_IDENTIFIER ON\r\nGO\r\nCREATE TABLE [dbo].[pbcattbl](\r\n\t[pbt_tnam] [varchar](128) NOT NULL,\r\n\t[pbt_tid] [int] NULL,\r\n\t[pbt_ownr] [varchar](128) NOT NULL,\r\n\t[pbd_fhgt] [smallint] NULL,\r\n\t[pbd_fwgt] [smallint] NULL,\r\n\t[pbd_fitl] [varchar](1) NULL,\r\n\t[pbd_funl] [varchar](1) NULL,\r\n\t[pbd_fchr] [smallint] NULL,\r\n\t[pbd_fptc] [smallint] NULL,\r\n\t[pbd_ffce] [varchar](18) NULL,\r\n\t[pbh_fhgt] [smallint] NULL,\r\n\t[pbh_fwgt] [smallint] NULL,\r\n\t[pbh_fitl] [varchar](1) NULL,\r\n\t[pbh_funl] [varchar](1) NULL,\r\n\t[pbh_fchr] [smallint] NULL,\r\n\t[pbh_fptc] [smallint] NULL,\r\n\t[pbh_ffce] [varchar](18) NULL,\r\n\t[pbl_fhgt] [smallint] NULL,\r\n\t[pbl_fwgt] [smallint] NULL,\r\n\t[pbl_fitl] [varchar](1) NULL,\r\n\t[pbl_funl] [varchar](1) NULL,\r\n\t[pbl_fchr] [smallint] NULL,\r\n\t[pbl_fptc] [smallint] NULL,\r\n\t[pbl_ffce] [varchar](18) NULL,\r\n\t[pbt_cmnt] [varchar](254) NULL\r\n) ON [PRIMARY]\r\nGO\r\n\/****** Object:  Table [dbo].[pbcatvld]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nSET ANSI_NULLS ON\r\nGO\r\nSET QUOTED_IDENTIFIER ON\r\nGO\r\nCREATE TABLE [dbo].[pbcatvld](\r\n\t[pbv_name] [varchar](30) NOT NULL,\r\n\t[pbv_vald] [varchar](254) NULL,\r\n\t[pbv_type] [smallint] NULL,\r\n\t[pbv_cntr] [int] NULL,\r\n\t[pbv_msg] [varchar](254) NULL\r\n) ON [PRIMARY]\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'###,###.00', N'###,###.00', 90, 1, 1, 32, N'10')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'#####', N'#####', 90, 1, 1, 32, N'10')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'###-##-####', N'###-##-####', 90, 1, 1, 32, N'00')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'MM\/DD\/YY', N'MM\/DD\/YY', 90, 1, 1, 32, N'20')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'DD\/MM\/YY', N'DD\/MM\/YY', 90, 1, 1, 32, N'20')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'MM\/DD\/YYYY', N'MM\/DD\/YYYY', 90, 1, 1, 32, N'20')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'DD\/MM\/YYYY', N'DD\/MM\/YYYY', 90, 1, 1, 32, N'20')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'DD\/MMM\/YY', N'DD\/MMM\/YY', 90, 1, 1, 32, N'20')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'JJJ\/YY', N'JJJ\/YY', 90, 1, 1, 32, N'20')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'JJJ\/YYYY', N'JJJ\/YYYY', 90, 1, 1, 32, N'20')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'HH:MM:SS', N'HH:MM:SS', 90, 1, 1, 32, N'30')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'HH:MM:SS:FFF', N'HH:MM:SS:FFF', 90, 1, 1, 32, N'30')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'HH:MM:SS:FFFFFF', N'HH:MM:SS:FFFFFF', 90, 1, 1, 32, N'30')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'MM\/DD\/YY HH:MM:SS', N'MM\/DD\/YY HH:MM:SS', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'DD\/MM\/YY HH:MM:SS', N'DD\/MM\/YY HH:MM:SS', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'MM\/DD\/YYYY HH:MM:SS', N'MM\/DD\/YYYY HH:MM:SS', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'DD\/MM\/YYYY HH:MM:SS', N'DD\/MM\/YYYY HH:MM:SS', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'DD\/MMM\/YY HH:MM:SS', N'DD\/MMM\/YY HH:MM:SS', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'JJJ\/YY HH:MM:SS', N'JJJ\/YY HH:MM:SS', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'JJJ\/YYYY HH:MM:SS', N'JJJ\/YYYY HH:MM:SS', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatedt] ([pbe_name], [pbe_edit], [pbe_type], [pbe_cntr], [pbe_seqn], [pbe_flag], [pbe_work]) VALUES (N'DD\/MM\/YY HH:MM:SS:FFFFFF', N'DD\/MM\/YY HH:MM:SS:FFFFFF', 90, 1, 1, 32, N'40')\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'[General]', N'[General]', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'0', N'0', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'0.00', N'0.00', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'#,##0', N'#,##0', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'#,##0.00', N'#,##0.00', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'$#,##0;($#,##0)', N'$#,##0;($#,##0)', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'$#,##0;[RED]($#,##0)', N'$#,##0;[RED]($#,##0)', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'$#,##0.00;($#,##0.00)', N'$#,##0.00;($#,##0.00)', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'$#,##0.00;[RED]($#,##0.00)', N'$#,##0.00;[RED]($#,##0.00)', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'0%', N'0%', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'0.00%', N'0.00%', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'0.00E+00', N'0.00E+00', 81, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'm\/d\/yy', N'm\/d\/yy', 84, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'd-mmm-yy', N'd-mmm-yy', 84, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'd-mmm', N'd-mmm', 84, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'mmm-yy', N'mmm-yy', 84, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'h:mm AM\/PM', N'h:mm AM\/PM', 84, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'h:mm:ss AM\/PM', N'h:mm:ss AM\/PM', 84, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'h:mm:ss', N'h:mm:ss', 84, 0)\r\nGO\r\nINSERT [dbo].[pbcatfmt] ([pbf_name], [pbf_frmt], [pbf_type], [pbf_cntr]) VALUES (N'm\/d\/yy h:mm', N'm\/d\/yy h:mm', 84, 0)\r\nGO\r\nSET ANSI_PADDING ON\r\nGO\r\n\/****** Object:  Index [pbcatc_x]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nCREATE UNIQUE NONCLUSTERED INDEX [pbcatc_x] ON [dbo].[pbcatcol]\r\n(\r\n\t[pbc_tnam] ASC,\r\n\t[pbc_ownr] ASC,\r\n\t[pbc_cnam] ASC\r\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\r\nGO\r\nSET ANSI_PADDING ON\r\nGO\r\n\/****** Object:  Index [pbcate_x]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nCREATE UNIQUE NONCLUSTERED INDEX [pbcate_x] ON [dbo].[pbcatedt]\r\n(\r\n\t[pbe_name] ASC,\r\n\t[pbe_seqn] ASC\r\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\r\nGO\r\nSET ANSI_PADDING ON\r\nGO\r\n\/****** Object:  Index [pbcatf_x]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nCREATE UNIQUE NONCLUSTERED INDEX [pbcatf_x] ON [dbo].[pbcatfmt]\r\n(\r\n\t[pbf_name] ASC\r\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\r\nGO\r\nSET ANSI_PADDING ON\r\nGO\r\n\/****** Object:  Index [pbcatt_x]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nCREATE UNIQUE NONCLUSTERED INDEX [pbcatt_x] ON [dbo].[pbcattbl]\r\n(\r\n\t[pbt_tnam] ASC,\r\n\t[pbt_ownr] ASC\r\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\r\nGO\r\nSET ANSI_PADDING ON\r\nGO\r\n\/****** Object:  Index [pbcatv_x]    Script Date: 4\/23\/2021 9:28:38 AM ******\/\r\nCREATE UNIQUE NONCLUSTERED INDEX [pbcatv_x] ON [dbo].[pbcatvld]\r\n(\r\n\t[pbv_name] ASC\r\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\r\nGO\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is a script to generate the PowerBuilder &#8216;cat&#8217; tables for SQL Server (pbcatcol, pbcatedt, pbcatfmt, pbcattbl, pbcatvld).\u00a0 Depending upon the permissions of the user who is connecting, these may not be created automatically from PB.\u00a0 Modify to reflect the database user as appropriate (dbo in this script).\u00a0 Supposedly this is available from the installation&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/2307"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=2307"}],"version-history":[{"count":2,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/2307\/revisions"}],"predecessor-version":[{"id":2309,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/2307\/revisions\/2309"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=2307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=2307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=2307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}