RE: v13 - SQL alter table, what is wrong?
Regarding v13 docs; we have this on the Doc Center doc.4d.com: https://i.imgur.com/czSO9xs.png Hope that helps. -Tim ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: v13 - SQL alter table, what is wrong?
I would, but could not find it... all I have/can find is in Japanese. My wife could make sense of it, but unfortunately not me :) On Mon, 17 Sep 2018 18:47:52 -0400, Charles Miller via 4D_Tech wrote: > That’s v14 look at 13 doc which is where I got it from > > Regards > Chuck > > On Mon, Sep 17, 2018 at 6:46 PM Chip Scheide via 4D_Tech < > 4d_tech@lists.4d.com> wrote: > >> Chuck, >> Thanks but... >> >> http://livedoc.4d.com/4D-SQL-Reference-14/Syntax-rules/primary-key-definition.300-1198391.en.html >> >> Says: >> [CONSTRAINT sql_name] PRIMARY KEY (sql_name, ... , sql_name) >> >> example: >> CREATE TABLE Customer >> (SID int32, >> Last_Name varchar(30), >> First_Name varchar(30), >> PRIMARY KEY (SID)); >> >> >> On Mon, 17 Sep 2018 17:10:56 -0400, Chuck Miller via 4D_Tech wrote: >>> I think it should be >>> >>> ALTER TABLE [Anmlprot_File_Link] >>> ADD [Journal_Key] [Primary KEY] >>> >>> This is from the 4D docs >>> ALTER TABLE sql_name >>> {ADD column_definition [PRIMARY KEY] [TRAILING] | >>> DROP sql_name | >>> ADD primary_key_definition | >>> DROP PRIMARY KEY | >>> ADD foreign_key_definition | >>> DROP CONSTRAINT sql_name | >>> [{ENABLE | DISABLE} REPLICATE] | >>> [{ENABLE | DISABLE} AUTO_INCREMENT] | >>> [{ENABLE | DISABLE} AUTO_GENERATE] | >>> SET SCHEMA sql_name} >>> >>> Chuck >>> >> >> >>> Chuck Miller Voice: (617) 739-0306 >>> Informed Solutions, Inc. Fax: (617) 232-1064 >>> mailto:cjmillerinformed-solutions.com >>> Brookline, MA 02446 USA Registered 4D Developer >>>Providers of 4D and Sybase connectivity >>> http://www.informed-solutions.com >>> >> >> >>> This message and any attached documents contain information which may >>> be confidential, subject to privilege or exempt from disclosure under >>> applicable law. These materials are intended only for the use of the >>> intended recipient. If you are not the intended recipient of this >>> transmission, you are hereby notified that any distribution, >>> disclosure, printing, copying, storage, modification or the taking of >>> any action in reliance upon this transmission is strictly >>> prohibited. Delivery of this message to any person other than the >>> intended recipient shall not compromise or waive such >>> confidentiality, privilege or exemption from disclosure as to this >>> communication. >>> On Sep 17, 2018, at 3:48 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> wrote: $SQl_Command:="ALTER TABLE [Anmlprot_File_Link] ADD PRIMARY KEY (Journal_Key)" >>> >>> ** >>> 4D Internet Users Group (4D iNUG) >>> Archive: http://lists.4d.com/archives.html >>> Options: https://lists.4d.com/mailman/options/4d_tech >>> Unsub: mailto:4d_tech-unsubscr...@lists.4d.com >>> ** >> --- >> Gas is for washing parts >> Alcohol is for drinkin' >> Nitromethane is for racing >> ** >> 4D Internet Users Group (4D iNUG) >> Archive: http://lists.4d.com/archives.html >> Options: https://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:4d_tech-unsubscr...@lists.4d.com >> ** > > -- > - > Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064 > Informed Solutions, Inc. > Brookline, MA 02446 USA Registered 4D Developer >Providers of 4D, Sybase & SQL Server connectivity > http://www.informed-solutions.com > - > This message and any attached documents contain information which may be > confidential, subject to privilege or exempt from disclosure under > applicable law. These materials are intended only for the use of the > intended recipient. If you are not the intended recipient of this > transmission, you are hereby notified that any distribution, disclosure, > printing, copying, storage, modification or the taking of any action in > reliance upon this transmission is strictly prohibited. Delivery of this > message to any person other than the intended recipient shall not > compromise or waive such confidentiality, privilege or exemption > from disclosure as to this communication. > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ---
Re: v13 - SQL alter table, what is wrong?
That’s v14 look at 13 doc which is where I got it from Regards Chuck On Mon, Sep 17, 2018 at 6:46 PM Chip Scheide via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Chuck, > Thanks but... > > http://livedoc.4d.com/4D-SQL-Reference-14/Syntax-rules/primary-key-definition.300-1198391.en.html > > Says: > [CONSTRAINT sql_name] PRIMARY KEY (sql_name, ... , sql_name) > > example: > CREATE TABLE Customer > (SID int32, > Last_Name varchar(30), > First_Name varchar(30), > PRIMARY KEY (SID)); > > > On Mon, 17 Sep 2018 17:10:56 -0400, Chuck Miller via 4D_Tech wrote: > > I think it should be > > > > ALTER TABLE [Anmlprot_File_Link] > > ADD [Journal_Key] [Primary KEY] > > > > This is from the 4D docs > > ALTER TABLE sql_name > > {ADD column_definition [PRIMARY KEY] [TRAILING] | > > DROP sql_name | > > ADD primary_key_definition | > > DROP PRIMARY KEY | > > ADD foreign_key_definition | > > DROP CONSTRAINT sql_name | > > [{ENABLE | DISABLE} REPLICATE] | > > [{ENABLE | DISABLE} AUTO_INCREMENT] | > > [{ENABLE | DISABLE} AUTO_GENERATE] | > > SET SCHEMA sql_name} > > > > Chuck > > > > > > Chuck Miller Voice: (617) 739-0306 > > Informed Solutions, Inc. Fax: (617) 232-1064 > > mailto:cjmillerinformed-solutions.com > > Brookline, MA 02446 USA Registered 4D Developer > >Providers of 4D and Sybase connectivity > > http://www.informed-solutions.com > > > > > > This message and any attached documents contain information which may > > be confidential, subject to privilege or exempt from disclosure under > > applicable law. These materials are intended only for the use of the > > intended recipient. If you are not the intended recipient of this > > transmission, you are hereby notified that any distribution, > > disclosure, printing, copying, storage, modification or the taking of > > any action in reliance upon this transmission is strictly > > prohibited. Delivery of this message to any person other than the > > intended recipient shall not compromise or waive such > > confidentiality, privilege or exemption from disclosure as to this > > communication. > > > >> On Sep 17, 2018, at 3:48 PM, Chip Scheide via 4D_Tech > >> <4d_tech@lists.4d.com> wrote: > >> > >> $SQl_Command:="ALTER TABLE [Anmlprot_File_Link] ADD PRIMARY KEY > >> (Journal_Key)" > > > > ** > > 4D Internet Users Group (4D iNUG) > > Archive: http://lists.4d.com/archives.html > > Options: https://lists.4d.com/mailman/options/4d_tech > > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > > ** > --- > Gas is for washing parts > Alcohol is for drinkin' > Nitromethane is for racing > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** -- - Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064 Informed Solutions, Inc. Brookline, MA 02446 USA Registered 4D Developer Providers of 4D, Sybase & SQL Server connectivity http://www.informed-solutions.com - This message and any attached documents contain information which may be confidential, subject to privilege or exempt from disclosure under applicable law. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: v13 - SQL alter table, what is wrong?
Chuck, Thanks but... http://livedoc.4d.com/4D-SQL-Reference-14/Syntax-rules/primary-key-definition.300-1198391.en.html Says: [CONSTRAINT sql_name] PRIMARY KEY (sql_name, ... , sql_name) example: CREATE TABLE Customer (SID int32, Last_Name varchar(30), First_Name varchar(30), PRIMARY KEY (SID)); On Mon, 17 Sep 2018 17:10:56 -0400, Chuck Miller via 4D_Tech wrote: > I think it should be > > ALTER TABLE [Anmlprot_File_Link] > ADD [Journal_Key] [Primary KEY] > > This is from the 4D docs > ALTER TABLE sql_name > {ADD column_definition [PRIMARY KEY] [TRAILING] | > DROP sql_name | > ADD primary_key_definition | > DROP PRIMARY KEY | > ADD foreign_key_definition | > DROP CONSTRAINT sql_name | > [{ENABLE | DISABLE} REPLICATE] | > [{ENABLE | DISABLE} AUTO_INCREMENT] | > [{ENABLE | DISABLE} AUTO_GENERATE] | > SET SCHEMA sql_name} > > Chuck > > Chuck Miller Voice: (617) 739-0306 > Informed Solutions, Inc. Fax: (617) 232-1064 > mailto:cjmillerinformed-solutions.com > Brookline, MA 02446 USA Registered 4D Developer >Providers of 4D and Sybase connectivity > http://www.informed-solutions.com > > This message and any attached documents contain information which may > be confidential, subject to privilege or exempt from disclosure under > applicable law. These materials are intended only for the use of the > intended recipient. If you are not the intended recipient of this > transmission, you are hereby notified that any distribution, > disclosure, printing, copying, storage, modification or the taking of > any action in reliance upon this transmission is strictly > prohibited. Delivery of this message to any person other than the > intended recipient shall not compromise or waive such > confidentiality, privilege or exemption from disclosure as to this > communication. > >> On Sep 17, 2018, at 3:48 PM, Chip Scheide via 4D_Tech >> <4d_tech@lists.4d.com> wrote: >> >> $SQl_Command:="ALTER TABLE [Anmlprot_File_Link] ADD PRIMARY KEY >> (Journal_Key)" > > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** --- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: v13 - SQL alter table, what is wrong?
I think it should be ALTER TABLE [Anmlprot_File_Link] ADD [Journal_Key] [Primary KEY] This is from the 4D docs ALTER TABLE sql_name {ADD column_definition [PRIMARY KEY] [TRAILING] | DROP sql_name | ADD primary_key_definition | DROP PRIMARY KEY | ADD foreign_key_definition | DROP CONSTRAINT sql_name | [{ENABLE | DISABLE} REPLICATE] | [{ENABLE | DISABLE} AUTO_INCREMENT] | [{ENABLE | DISABLE} AUTO_GENERATE] | SET SCHEMA sql_name} Chuck Chuck Miller Voice: (617) 739-0306 Informed Solutions, Inc. Fax: (617) 232-1064 mailto:cjmillerinformed-solutions.com Brookline, MA 02446 USA Registered 4D Developer Providers of 4D and Sybase connectivity http://www.informed-solutions.com This message and any attached documents contain information which may be confidential, subject to privilege or exempt from disclosure under applicable law. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. > On Sep 17, 2018, at 3:48 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > $SQl_Command:="ALTER TABLE [Anmlprot_File_Link] ADD PRIMARY KEY > (Journal_Key)" ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: v13 - SQL alter table, what is wrong?
I missed th v13 part. Is the field already set as indexed and unique. If not I would bet alter table would not work. I do not know what would happen in newer versions if you tried to assign UUID inside 4D without it being a UUID field Have you tried other data types. Regards Chuck Chuck Miller Voice: (617) 739-0306 Informed Solutions, Inc. Fax: (617) 232-1064 mailto:cjmillerinformed-solutions.com Brookline, MA 02446 USA Registered 4D Developer Providers of 4D and Sybase connectivity http://www.informed-solutions.com This message and any attached documents contain information which may be confidential, subject to privilege or exempt from disclosure under applicable law. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. > On Sep 17, 2018, at 4:28 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > what does a length of 0 have to do with setting the field as a primary > key? ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: v13 - SQL alter table, what is wrong?
title says what version :) what does a length of 0 have to do with setting the field as a primary key? On Mon, 17 Sep 2018 16:05:29 -0400, Charles Miller via 4D_Tech wrote: > Chip what version of 4D a UUID key has a lenght of 0 in at least v15 and > higher. > > > > On Mon, Sep 17, 2018 at 3:49 PM Chip Scheide via 4D_Tech < > 4d_tech@lists.4d.com> wrote: > >> trying to set a new field in a new table as primary key >> >> $SQl_Command:="ALTER TABLE [Anmlprot_File_Link] ADD PRIMARY KEY >> (Journal_Key)" >> >> Begin SQL >> Execute Immediate : $Sql_Command >> end SQL >> >> table : [Anmlprot_File_Link] exists >> Field : Journal_Key exists as a field in [Anmlprot_File_Link] >> >> Journal_Key defined as: String 255, Unique, Indexed, Null, UUID, Auto >> UUID >> >> When I run the above sql line of code - the field is NOT set to be a >> primary key. >> >> As an aside, is setting a field as primary key an option (check box) in >> the Field properties dialog? >> >> Thanks >> Chip >> --- >> Gas is for washing parts >> Alcohol is for drinkin' >> Nitromethane is for racing >> ** >> 4D Internet Users Group (4D iNUG) >> Archive: http://lists.4d.com/archives.html >> Options: https://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:4d_tech-unsubscr...@lists.4d.com >> ** > > > > -- > - > Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064 > Informed Solutions, Inc. > Brookline, MA 02446 USA Registered 4D Developer >Providers of 4D, Sybase & SQL Server connectivity > http://www.informed-solutions.com > - > This message and any attached documents contain information which may be > confidential, subject to privilege or exempt from disclosure under > applicable law. These materials are intended only for the use of the > intended recipient. If you are not the intended recipient of this > transmission, you are hereby notified that any distribution, disclosure, > printing, copying, storage, modification or the taking of any action in > reliance upon this transmission is strictly prohibited. Delivery of this > message to any person other than the intended recipient shall not > compromise or waive such confidentiality, privilege or exemption > from disclosure as to this communication. > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** --- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: v13 - SQL alter table, what is wrong?
Chip what version of 4D a UUID key has a lenght of 0 in at least v15 and higher. On Mon, Sep 17, 2018 at 3:49 PM Chip Scheide via 4D_Tech < 4d_tech@lists.4d.com> wrote: > trying to set a new field in a new table as primary key > > $SQl_Command:="ALTER TABLE [Anmlprot_File_Link] ADD PRIMARY KEY > (Journal_Key)" > > Begin SQL > Execute Immediate : $Sql_Command > end SQL > > table : [Anmlprot_File_Link] exists > Field : Journal_Key exists as a field in [Anmlprot_File_Link] > > Journal_Key defined as: String 255, Unique, Indexed, Null, UUID, Auto > UUID > > When I run the above sql line of code - the field is NOT set to be a > primary key. > > As an aside, is setting a field as primary key an option (check box) in > the Field properties dialog? > > Thanks > Chip > --- > Gas is for washing parts > Alcohol is for drinkin' > Nitromethane is for racing > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** -- - Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064 Informed Solutions, Inc. Brookline, MA 02446 USA Registered 4D Developer Providers of 4D, Sybase & SQL Server connectivity http://www.informed-solutions.com - This message and any attached documents contain information which may be confidential, subject to privilege or exempt from disclosure under applicable law. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **