Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> help me!!! how can I insert data(pro*c)?

help me!!! how can I insert data(pro*c)?

From: kyutae lim <ktlim_at_lgtel.co.kr>
Date: Tue, 05 Jan 1999 21:41:55 +0900
Message-ID: <36920893.266E1C62@lgtel.co.kr>


hi , there.

I have a big problem in pro*c program.
this is sample program and table layout. I found ora-1400 error.
hw can I insert '1 byte space charactor' in not null column?



exec sql include sqlca.h;
typedef char char1;
EXEC SQL TYPE char1 IS char(1);
static char1 sql_dr_acc_type;
main()
{
  char username[10], password[10];

  strcpy(username, "SCOTT");
  strcpy(password, "TIGER");
  exec sql connect :username identified by :password;   sql_dr_acc_type = ' ';
  exec sql insert into a (b) values (:sql_dr_acc_type);   printf("code :%c:%d:\n", sql_dr_acc_type,sqlca.sqlcode);   exec sql commit;
}



table layout
table a (b char(1) not null)
                           ^^^^^^

Received on Tue Jan 05 1999 - 06:41:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US