Home » SQL & PL/SQL » SQL & PL/SQL » Save the unsiged char * ,meet some error
Save the unsiged char * ,meet some error [message #6973] Wed, 14 May 2003 07:53 Go to next message
kworld
Messages: 23
Registered: February 2003
Junior Member
I use two host variable .
one is 'acc' to set the groupinfo.accessid value ;
two is 'getAcc' to get the groupinfo.accessid value;
(groupinfo.accessid is the one column accessid of table groupinfo ,the type is raw(32))l

the are all unsigned char [[32]] type.
unsigned char acc[[32]];
memset(acc,0,32);
acc[[0]]='1';
acc[[1]]='2';
acc[[5]]='y';
acc[[6]]='t';

the prototype function is :
setvalue(v_newValue IN raw);
the sentence is only update "update groupinfo set accessId :=v_newValue where groupId ='gp1';

then get the accessId .the value is

the 0 getAcc value is :1
the 1 getAcc value is :2
the 2 getAcc value is :
..
the 5 getAcc value is :
the 6 getAcc value is :
...

how to save "acc" value ?
Re: Save the unsiged char * ,meet some error [message #7074 is a reply to message #6973] Tue, 20 May 2003 01:43 Go to previous message
Barbara Boehmer
Messages: 9090
Registered: November 2002
Location: California, USA
Senior Member
It is unclear what you are trying to do. The only thing that I can offer from what you have provided is that your update statement has := where it should only have = without the : . I suspect that, once again, you are trying to use a function, where a procedure would be more appropriate. Is the update statement part of the function? If so, bear in mind that you cannot execute such a function from a select statement. Please provide more details, such as a cut and paste of the complete function, variable declarations, attempted execution from SQL*Plus, and resulting error messages. Also, if you can use VARCHAR2 instead of RAW and CHAR, it might eliminate some problems. Why are you using CHAR and RAW? It is unclear, from what little you have posted, what determines the "...getAcc value is..." and whether you are trying to dispaly those values or store them in the table or what. You say you want to save "Acc" value, but save it to where or what? What is the difference between Acc and getAcc? If one is used to set the groupinfo.accessid and the other retrieves it after it is set, then are they not the same value? Please provide as much clarification as you can. I suspect that nobody else is responding because, like me, they can't understand what you are asking.
Previous Topic: Changing Optimizer
Next Topic: update too slow
Goto Forum:
  


Current Time: Fri Apr 26 05:15:07 CDT 2024