SQLException [message #896708] |
Thu, 19 July 2012 09:04  |
Eclipse User |
|
|
|
Windows XP
EDT 0.8.0
RichUI calling dedicated service
I have modified some RBD code in edt to replace sqllib. The two sets of code below both correctly access a row in a table when the requested row exist. No exception is encountered in that case.
When I try to access a row that does not exist I do not get an sqlexception. Per the tutorial and all the help I can find on try, get and onexception I believe an sql exception should occur if no row exist?
I simply want to know if the attempt to access a row was successful or not.
Sorry for the stupid but I must be doing something wrong and just do not see it.
I also note that I do not see any sql related debug variables.
Can anyone help? Am I approaching this wrong?
Much thx,
Nathan Reed
function getProcessorMasterRecord(ProcessorID decimal(11,0) in, ProcessorMasterRecord ProcessorMaster inout) returns (error)
ProcessorMasterRecord.PROCID = ProcessorID;
try
get ProcessorMasterRecord from ProcessorMasterTable;
NoErrorRecord.severity = 0;
NoErrorRecord.message = " ";
return(NoErrorRecord);
onexception(sqlex sqlexception)
if (sqlex.SQLState == "02000")
ErrorRecord.severity = 0000001;
ErrorRecord.message = "Record not found.";
return(ErrorRecord);
else
ErrorRecord.severity = 0000002;
ErrorRecord.message = "SQL error getting record.";
return (ErrorRecord);
end // End if
end // End try
end // End function
function getProcessorMasterRecord(ProcessorID decimal(11,0) in, ProcessorMasterRecord ProcessorMaster inout) returns (error)
ProcessorMasterRecord.PROCID = ProcessorID;
try
get ProcessorMasterRecord
from ProcessorMasterTable
using (ProcessorID)
with #sql{ select * from ProcessorMaster
where ProcID = ?};
NoErrorRecord.severity = 0;
NoErrorRecord.message = " ";
return(NoErrorRecord);
onexception(sqlex sqlexception)
if (sqlex.SQLState == "02000")
ErrorRecord.severity = 0000001;
ErrorRecord.message = "Record not found.";
return(ErrorRecord);
else
ErrorRecord.severity = 0000002;
ErrorRecord.message = "SQL error getting record.";
return (ErrorRecord);
end // End if
end // End try
end // End function
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08688 seconds