<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://frp.sage.fr/wiki1000/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=InsertInto_%28selector%29</id>
		<title>InsertInto (selector) - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=InsertInto_%28selector%29"/>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=InsertInto_(selector)&amp;action=history"/>
		<updated>2026-04-06T15:15:04Z</updated>
		<subtitle>Historique pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=InsertInto_(selector)&amp;diff=14810&amp;oldid=prev</id>
		<title>Syfre : Page créée avec « &lt;source lang='delphi'&gt;function InsertInto(const iTableName:string; const iInsertColumns:Array of string; const iInsertValues:Array of variant):Integer;&lt;/source&gt;  Cette mé... »</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=InsertInto_(selector)&amp;diff=14810&amp;oldid=prev"/>
				<updated>2025-12-23T08:22:06Z</updated>
		
		<summary type="html">&lt;p&gt;Page créée avec « &amp;lt;source lang=&amp;#039;delphi&amp;#039;&amp;gt;function InsertInto(const iTableName:string; const iInsertColumns:Array of string; const iInsertValues:Array of variant):Integer;&amp;lt;/source&amp;gt;  Cette mé... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang='delphi'&amp;gt;function InsertInto(const iTableName:string; const iInsertColumns:Array of string; const iInsertValues:Array of variant):Integer;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cette méthode insère les objets de la sélection dans une table temporaire&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Paramètre&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|Result&lt;br /&gt;
|Nombre d'objets affectés par l'opération&lt;br /&gt;
|-&lt;br /&gt;
|iTableName&lt;br /&gt;
|Nom de table temporaire&lt;br /&gt;
|-&lt;br /&gt;
|iInsertColumns&lt;br /&gt;
|Tableau de noms de colonne supplémentaires à insérer&lt;br /&gt;
|-&lt;br /&gt;
|iUpdatePropValues&lt;br /&gt;
|Tableau de valeurs des colonnes supplémentaires&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Cette fonction retourne le nombre d'objets insérés par l'opération.&lt;br /&gt;
&lt;br /&gt;
* iInsertPropnames,iInsertPropValues&lt;br /&gt;
:Ces deux tableaux doivent avoir le même nombre d'élément&lt;br /&gt;
&lt;br /&gt;
{{tip|L'opération est effectué par un ordre SQL en mode auto commit, si une transaction longue est ouverte la session de la transaction longue est utilisée.}}&lt;br /&gt;
&lt;br /&gt;
Exemple :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='delphi'&amp;gt;&lt;br /&gt;
Type&lt;br /&gt;
  IvueSource = interface&lt;br /&gt;
    ....&lt;br /&gt;
  end;&lt;br /&gt;
&lt;br /&gt;
  vueSource = viewOf(AClassSource,iVueSource)&lt;br /&gt;
   .... &lt;br /&gt;
  end;&lt;br /&gt;
&lt;br /&gt;
  sqlClass = sqlClass(iVue)&lt;br /&gt;
  end;&lt;br /&gt;
&lt;br /&gt;
var sel:TSelector; aJob,aTempTable1:string; keepTables:boolean;&lt;br /&gt;
begin&lt;br /&gt;
  Result := FALSE;&lt;br /&gt;
  aJob := CreateGuid; &lt;br /&gt;
  keepTables := False; &lt;br /&gt;
&lt;br /&gt;
  sel := vueSource.CreateSelector('','',True,[]);&lt;br /&gt;
  sel.useCTE := True; &lt;br /&gt;
  sel.NoFrameworks := True; &lt;br /&gt;
  sel.NoOrderBy := True; &lt;br /&gt;
&lt;br /&gt;
  try&lt;br /&gt;
    // Create a Temp table from a source selector&lt;br /&gt;
    // &lt;br /&gt;
    aTempTable1 := ClassManager.DefDatabase.AllocTempTable(aJob);&lt;br /&gt;
    sel.InsertInto(aTempTable1,[],[]); &lt;br /&gt;
&lt;br /&gt;
    // Use the temp table as source of operation&lt;br /&gt;
    // &lt;br /&gt;
    sel := sqlClass.CreateSelector('','',True,[]);&lt;br /&gt;
    sel.SourceTableName := aTempTable1;&lt;br /&gt;
    ....&lt;br /&gt;
&lt;br /&gt;
    ....&lt;br /&gt;
  finally&lt;br /&gt;
  if not KeepTables then ClassManager.DefDatabase.DropTempTables(aJob); &lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Voir aussi :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Footer|Selecteur (tech)}}&lt;br /&gt;
[[category:Sélecteur]]&lt;/div&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	</feed>