|
The oracle table (worker) is defined as:
workid number 10
workname varchar2 10
The stored procedure (pwork) is defined as
(
pworkid in worker.workid% type,
pworkname in worker.workname% type
)
as
begin
insert into worker (workid, workname) values (pworkid, pworkname);
end;
I wrote a program as follows:
int main ()
{
DBHANDLE * pDBHandle;
SQLUINTEGER PartID;
SQLCHAR PartName [10];
SQLINTEGER PartIDInd = 0, PartNameInd = 0;
SQLRETURN ret = 0;
Ranch
Programs such as connecting to the database (omitted)
Ranch
if (SQL_SUCCESS! = SQLBindParameter (pDBHandle-> hSTMT, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0,&PartID, 0,&PartIDInd))
printf ("Error: SQLBindParameter.\n");
if (SQL_SUCCESS! = SQLBindParameter (pDBHandle-> hSTMT, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 10, 0, PartName, 0,&PartNameInd))
printf ("Error: SQLBindParameter.\n");
Ranch
PartID = 1024;
strcpy (PartName, "ABC");
Ranch
if (mDBSuccess! = SQLExecDirect (pDBHandle-> hSTMT, "{call pwork (?,?)}", SQL_NTS))
{
printf ("ERROR.\n");
return -1;
}
Ranch
return 0;
}
The question is:
The query is as follows:
10:55:25 10:55:25
WORKID WORKNAME
---------- ----------
1024
1 row selected.
That is, why the data "ABC" of WORKNAME is not stored in the database. I checked it for a long time, I don't know? Hope to know who can give pointers! |
|