A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
JDBC and Relational Databases
how to convert?
Joined: Oct 09, 2004
Jul 01, 2006 00:51:00
I am using mssql. how can i convert varchar to int type.
id (int) txt(varchar)
i want to convert varchar to int. HOw? pls explain with query.
Thank You<br />Edward
author & internet detective
Joined: May 26, 2003
Jul 01, 2006 08:55:00
So you would want to covert 10 --> 1, 10a --> 2, etc?
I don't understand the relationship here. Is it just to give each varchar a unique value (you could use a sequence for this) or something else?
OCA 8 book
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
Joined: Aug 24, 2005
Jul 01, 2006 09:17:00
By "convert" do you mean "get the integer associated with the string"?
That would be something like:
select my_integer from my_table where my_string = "10b";
Joined: Jul 05, 2006
Jul 05, 2006 04:25:00
I think you just want to convert the varchar columns data to int data.
For this first retrieve the data as varchar and then convert to int as
this will throw the parse exception if the varchar contains any characters.
Otherway around , friend change the database column to int as actually you want int value . Why you r using varchar.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: how to convert?
Convert an int to a BigInteger
doubt in sybase
Node to int??
Couldn't Load Database Driver
Converting a 2 dimensional array to a Vector => Basic problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015