Home » Developer & Programmer » Precompilers, OCI & OCCI » HELP: Pro*C -- Update table using host array
HELP: Pro*C -- Update table using host array [message #271726] Tue, 02 October 2007 12:25 Go to next message
raysonliu
Messages: 1
Registered: October 2007
Junior Member
Hi,
I got an issue with updating table using host array in Pro*C (on HP-UX). The scenario is:
select * from CSM_REPORT where department='CSM'

Got data set:

department network_status(char)
--------------------------------------------
CSM A
CSM B
CSM C


There is no primary key on this table.

Host array is declared as char newStatus[20]. And only first 3 elements have value in this case:

newStatus[0] = 'E'
newStatus[1] = 'F'
newStatus[2] = 'G'


Update this table using host array:
update CSM_REPORT
set network_status = :newStatus
where department='CSM'

Result is:
select * from CSM_REPORT where department='CSM'

Got data set:
department network_status(char)
--------------------------------------------
CSM G
CSM G
CSM G


And sqlerrd[2] shows 9.


Expected result:

department network_status(char)
--------------------------------------------
CSM E
CSM F
CSM G

And sqlerrd[2] shows 3.

Can anybody help with this?

Thanks and much appreciated.

[Updated on: Tue, 02 October 2007 15:03]

Report message to a moderator

Re: HELP: Pro*C -- Update table using host array [message #271730 is a reply to message #271726] Tue, 02 October 2007 13:02 Go to previous message
Michel Cadot
Messages: 68704
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why people first posting here are not able to read the guide before posting?

Please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

Regards
Michel
Previous Topic: What is Oracle Windows Interface and call Interface?
Next Topic: Passing VARCHAR2 arrays from ProC to PLSQL
Goto Forum:
  


Current Time: Mon Nov 04 05:49:37 CST 2024