タイトル : Re: For文でInsertを連続的に使う方法 投稿日 : 2006/07/10(Mon) 09:18 投稿者 : なおこ(・∀・)
お世話になります。 話をシンプルにするために。 SALES_NUMBER,LINE_NUMBER,TRADE_CODE の 3 つの項目に値を Insert する SQL 文を生成するならば、 For Each の中でこうでしょうか。 Dim sqlBuf As System.IO.StringWriter = New System.IO.StringWriter With sqlBuf .WriteLine("INSERT INTO SALES_LINE(") .WriteLine("SALES_NUMBER,LINE_NUMBER,TRADE_CODE") .WriteLine(") VALUES (") .WriteLine(i.Tostring() + "," + i.tostring() + ",'1'") .WriteLine(")") End With myOracleCommand.CommandText = sqlBuf.ToString() |