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%3EAjoutez%20une%20option%20pour%20emp%C3%AAcher%20la%20cr%C3%A9ation%20inattendue%20de%20nouvelles%20colonnes%20%C3%A0%20partir%20de%20variables%20de%20table%20lors%20de%20la%20concat%C3%A9nation.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-437747%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EApr%C3%A8s%20avoir%20ex%C3%A9cut%C3%A9%20ce%20script%2C%20dt3%20contiendra%20une%20colonne%20%C2%AB%20a%20%C2%BB.%20Lors%20de%20l'utilisation%20de%20la%20concat%C3%A9nation%20dans%20un%20script%2C%20cela%20peut%20entra%C3%AEner%20un%20comportement%20inattendu%20ou%20la%20n%C3%A9cessit%C3%A9%20de%20supprimer%20manuellement%20les%20variables%20qui%20ne%20sont%20pas%20utilis%C3%A9es%20dans%20le%20tableau.%20(Exemple%26nbsp%3B%3A%20la%20variable%20de%20table%20%C2%AB%26nbsp%3BSQL%26nbsp%3B%C2%BB%20est%20automatiquement%20ajout%C3%A9e%20aux%20tables%20renvoy%C3%A9es%20par%20les%20requ%C3%AAtes%20SQL.)%20Fournissez%20une%20option%20dans%20Concatenate()%20pour%20renommer%20les%20variables%20de%20table%20en%20double%20avant%20la%20concat%C3%A9nation%20si%20elles%20aboutissent%20%C3%A0%20une%20nouvelle%20colonne.%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%3EAutomatisation%20et%20scripts%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 );