473,770 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RFX_Long "Oracle Null value" returned as junk integer [DoFieldExchange]

Hi,

I am retrieving my DB [Oracle] values and setting them in the
MyRS::DoFieldEx change(CFieldEx change* pFX) function. One of these
records is a Long datatype and could be "Null" in the DB table.

The issue is when the DB value is retrieved it is fine for all
integers but for a "Null" value it returns a junk long value
[1246576928, always] and not a pre-defined value, say.

How do I ensure that for DB Null values it returns me a pre-defined
value? Is the only way out to have my own function that overrides the
MFC's RFX_Long(...) method where-in I handle this [as given in
dbrfx.cpp]? If yes, what should the condition be.

Any pointers will be appreciated.

TIA.

Cheerz,
Denzil
Jul 22 '05 #1
1 3239
On 15 Jul 2004 10:53:45 -0700, Denzil <de*****@gmail. com> wrote:
Hi,

I am retrieving my DB [Oracle] values and setting them in the
MyRS::DoFieldEx change(CFieldEx change* pFX) function. One of these
records is a Long datatype and could be "Null" in the DB table.

The issue is when the DB value is retrieved it is fine for all
integers but for a "Null" value it returns a junk long value
[1246576928, always] and not a pre-defined value, say.

How do I ensure that for DB Null values it returns me a pre-defined
value? Is the only way out to have my own function that overrides the
MFC's RFX_Long(...) method where-in I handle this [as given in
dbrfx.cpp]? If yes, what should the condition be.

Any pointers will be appreciated.


You need to ask in a different group. This group deals with standard
C++ questions only, not database programming. Guessing that you are in
fact programming for Windows why not try a Windows programming group such
as news:comp.os.ms-windows.program mer.win32 but maybe an Oracle group
would be better. In any case you are off topic here.

This groups welcome message may give a few more pointers,
http://www.slack.net/~shiva/welcome.txt

john
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
20375
by: Pablo J Royo | last post by:
Hello: i have a function that reads a file as an argument and returns a reference to an object that contains some information obtained from the file: FData &ReadFile(string FilePath); But , for example, when the file doesnt exists, i should not return any reference to a bad constructed object, so i need something as a NULL reference object. I suppose i could return a pointer instead, but i have some code written with references which...
1
14951
by: arvee | last post by:
Hi - I'm updating an Oracle table with an empty string and getting the error: An unhandled exception of type 'System.Exception' occurred in system.data.dll Additional information: Parameter 'p1': No size set for variable length data type: String. The column is nullable and of type varchar2(50). I'm aware that I can store DBNull.Value instead and Oracle won't complain, but, I was hoping to avoid
13
3087
by: Don Vaillancourt | last post by:
What's going on with Javascript. At the beginning there was the "undefined" value which represented an object which really didn't exist then came the null keyword. But yesterday I stumbled across "null" string. I know that I will get an "undefined" when I try to retrieve something from the DOM which doesn't exist. I have used null myself to initialize or reset variables. But in which
388
21923
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's worth the $25USD. I'm just looking for a book on Pointers, because from what I've read it's one of the toughest topics to understand. thanks in advanced.
1
2418
by: Steph | last post by:
I am trying to save a simple integer value in ViewState. I set the value in the Page_Load() event and retrieve it in the function Page_Unload() event. The value seems to be set correctly, but upon the next Page_Load(), I get the following error when I try to retrieve the value from ViewState: "function 'ViewState.get_Item' evaluated and returned null". The page does have a form on it with the runat="server" attribute set. From the...
5
8091
by: Dmitriy Lapshin [C# / .NET MVP] | last post by:
Hi all, I think the VB .NET compiler should at least issue a warning when a function does not return value. C# and C++ compilers treat this situation as an error and I believe this is the right thing to do. And I wonder why VB .NET keeps silence and makes such function return some default value instead. Isn't it error-prone? -- Dmitriy Lapshin
6
9795
by: marcwentink | last post by:
Dear Sirs, Dear Newsgroup, Imagine I have some function that only gives me an iterator to a vector, but not the vector itself. Unfortunately this vector can be empty and the iterator can point to 'non valid'. Yes I know this is rather silly, but I did not write the code... Normally I know you would check for "iterator != vector.end()", but since I do not seem to have the vector without changing a lot of old
2
2029
by: Jeff | last post by:
Hey I've bought the book "ASP.NET 2.0 website programming, Problem, Design, Solution" and some of its code examples is this code: protected static string ConvertNullToEmptyString(string input) { return (input == null ? "" : input); }
21
2418
by: Steven T. Hatton | last post by:
I'm trying to improve my formal understanding of C++. One significant part of that effort involves clarifying my understanding of the vocabulary used to describe the language. This is from the C++ Standard: "" "...sequence of operators and operands that specifies a computation...". That means to me that an expression can be "executed". I am purposely
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.