We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

working with sql inserting type double, string, int - How to detect unasigned value.

Medium Priority
487 Views
Last Modified: 2012-06-27
Hi there

i am try to work with data type
double, int, enum, string in vb.net and create a function to insert/select from mysql

i have issue when to create this function i have no way to know if the value should be insert to sql or not because i dont know if it unassigned or or assigned.

the idea is that if i know the value is unassigned then i will not generate TSQL to insert into SQL and so database will not insert incorrect value such as 0 or "".

On the other hand, when pull the data from SQL i need to know that these value is not assigned so i can display on application as not available... instead of showing 0 or something that has incorrect meaning...
Thanks,

 
Comment
Watch Question

Author

Commented:
To explain a bit more:
When I assigned no data as 0 for an enum type i can filter the zero out during TSQL insertion but it will be wrong b/c data can be 0....

My older application i assigned value like -987654321 to id the non assigned value but it get bulky.
and it would slow thing down.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Some more explanation please(outside of assigned/unassigned).

Author

Commented:
oh,

Say I want to update field columns in SQL with .. x y z .... My function does not know which  x y z is a new data... x y z are members in a class obj.

because If know which is not updated then I would exclude it from TSQL
The question is how do I identify if any member in this class has some value assigned to it.

for instance if class is a stock data ... some stock has volume field , and another doest have volume field ... sort of speak. but Volume can be 0.

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.