Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 13B369FC32B for ; Fri, 10 Aug 2007 02:53:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 26902-09 for ; Fri, 10 Aug 2007 02:53:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp.guitar.ocn.ne.jp (guitar.ocn.ne.jp [61.207.12.174]) by postgresql.org (Postfix) with ESMTP id E43F29FC4C0 for ; Fri, 10 Aug 2007 02:53:16 -0300 (ADT) Received: from HP22720319231 (221x112x108x194.ap221.ftth.ucom.ne.jp [221.112.108.194]) by smtp.guitar.ocn.ne.jp (Postfix) with SMTP id A9D5A384D; Fri, 10 Aug 2007 14:53:15 +0900 (JST) Message-ID: <068701c7db12$bfd04460$c601a8c0@HP22720319231> From: "Hiroshi Saito" To: , References: <46854.203.148.220.220.1186560534.squirrel@203.148.220.220> Subject: Re: How to insert data pass by parameter Date: Fri, 10 Aug 2007 14:53:17 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/32 X-Sequence-Number: 9149 Hi. From: > Hi support > I have problem about insertion into postgres db and details > like below; > 1. I use IBM DataStage as client connect to Postgrest db 8.2.4 via > psqlOdbc 8.0.4 > 2. I can read data from table but I cannot insert data in to target table > on Postgrest DB and I 've got error message like this > > "SQL statement:INSERT INTO a(emp_id) VALUES (?) > SQLSTATE=00000, DBMS.CODE=-1 > [DataStage][SQL Client][ODBC][unixODBC]Error while executing the query > (non-fatal); > ERROR: syntax error at end of input at character 47 " I do not use IBM Datastage... However, For example, a parameter can be used as follows. -- Set cmd = New ADODB.Command cmd.ActiveConnection = cn cmd.CommandText = "insert into MYTABLE(main,object) values(?,?)" cmd.CommandType = adCmdText ' The main parameter Set main = cmd.CreateParameter("main", adInteger, adParamInput) main.Value = 100 '' a random integer value '' cmd.Parameters.Append main -- I want this to be help you. Regards, Hiroshi Saito