pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to insert data pass by parameter
2+ messages / 2 participants
[nested] [flat]

* How to insert data pass by parameter
@ 2007-08-08 08:08  usanee@mfec.co.th
  0 siblings, 1 reply; 2+ messages in thread

From: usanee@mfec.co.th @ 2007-08-08 08:08 UTC (permalink / raw)
  To: pgsql-odbc

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 "


                 Table name : a
                  Col Name     :emp_id  char(10)
                 Sql Statement : insert into a (emp_id) values (?);
       I use (?) for passing data by parameter.

Please give me a suggestion for using insert data by pass parameter

Thanks




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to insert data pass by parameter
@ 2007-08-10 05:53  Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
  parent: usanee@mfec.co.th
  0 siblings, 0 replies; 2+ messages in thread

From: Hiroshi Saito @ 2007-08-10 05:53 UTC (permalink / raw)
  To: usanee@mfec.co.th; pgsql-odbc

Hi.

From: <usanee@mfec.co.th>


> 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-08-10 05:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-08-08 08:08 How to insert data pass by parameter usanee@mfec.co.th
2007-08-10 05:53 ` Hiroshi Saito <z-saito@guitar.ocn.ne.jp>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox