cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-437747%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3EF%C3%BCgen%20Sie%20eine%20Option%20hinzu%2C%20um%20die%20unerwartete%20Erstellung%20neuer%20Spalten%20aus%20Tabellenvariablen%20bei%20der%20Verkettung%20zu%20verhindern.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-437747%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3ENach%20dem%20Ausf%C3%BChren%20dieses%20Skripts%20enth%C3%A4lt%20dt3%20eine%20Spalte%20%E2%80%9Ea%E2%80%9C.%20Wenn%20Sie%20in%20einem%20Skript%20die%20Funktion%20%E2%80%9EVerketten%E2%80%9C%20verwenden%2C%20kann%20dies%20zu%20unerwartetem%20Verhalten%20f%C3%BChren%20oder%20dazu%2C%20dass%20Variablen%2C%20die%20in%20der%20Tabelle%20nicht%20verwendet%20werden%2C%20manuell%20entfernt%20werden%20m%C3%BCssen.%20(Beispiel%3A%20Die%20Tabellenvariable%20%E2%80%9ESQL%E2%80%9C%20wird%20automatisch%20zu%20Tabellen%20hinzugef%C3%BCgt%2C%20die%20von%20SQL-Abfragen%20zur%C3%BCckgegeben%20werden.)%20Stellen%20Sie%20in%20%E2%80%9EVerketten%E2%80%9C%20eine%20Option%20bereit%2C%20um%20doppelte%20Tabellenvariablen%20vor%20der%20Verkettung%20umzubenennen%2C%20wenn%20sie%20zu%20einer%20neuen%20Spalte%20f%C3%BChren%20w%C3%BCrden.%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20default%20to%20here(1)%3B%0A%0Adt1%20%3D%20New%20Table(%20%22Test%22%2C%20Add%20Rows(1)%2C%20New%20Table%20Variable(%20%22a%22%2C%201%20)%20)%3B%0Adt2%20%3D%20New%20Table(%20%22Test%22%2C%20Add%20Rows(1)%2C%20New%20Table%20Variable(%20%22a%22%2C%202%20)%20)%3B%0A%0Adt3%20%3D%20dt1%20%26lt%3B%26lt%3B%20Concatenate(%20dt2%20)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-437747%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3EAutomatisierung%20und%20Skripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Choose Language Hide Translation Bar
0 Kudos

Add option to prevent unexpected new column creation from table variables in concatenate.

After running this script dt3 will contain a column 'a'. When using concatenate in a script this can result in unexpected behavior or the need to manually remove variables that are not used in the table. (Example: the 'SQL' table variable automatically added to tables returned from SQL Queries.) Provide an option in Concatenate() to rename duplicate table variables before concatenation if they would result in a new column. 

 

Names default to here(1);

dt1 = New Table( "Test", Add Rows(1), New Table Variable( "a", 1 ) );
dt2 = New Table( "Test", Add Rows(1), New Table Variable( "a", 2 ) );

dt3 = dt1 << Concatenate( dt2 );