473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

convert int field to a string

can anyone tell me how to convert a int field into a string ... i've
had a look at the mysql site but unable to look for the right function
.... thank you ..
Jul 19 '05 #1
6 26224
shaffer wrote:
can anyone tell me how to convert a int field into a string ... i've
had a look at the mysql site but unable to look for the right function


Are you wanting to change the column type in the table structure to a
string, or are you wanting to cast the data from the resultset into a
string?

Also, what language are you using to get the data, as you may want to cast
the data in the language code instead. In PHP, for example, you can cast a
variable as a type in the script eg

$foo = 1;
$bar = (string)$foo;

In this example $bar is an explicitly cast string version of $foo

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 19 '05 #2
shaffer wrote:
can anyone tell me how to convert a int field into a string ... i've
had a look at the mysql site but unable to look for the right function


Are you wanting to change the column type in the table structure to a
string, or are you wanting to cast the data from the resultset into a
string?

Also, what language are you using to get the data, as you may want to cast
the data in the language code instead. In PHP, for example, you can cast a
variable as a type in the script eg

$foo = 1;
$bar = (string)$foo;

In this example $bar is an explicitly cast string version of $foo

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 19 '05 #3
I'm wanting to cast the data from the resultset into a
string.

I'm using coldfusion mx 6

#On Sun, 04 Apr 2004 22:46:51 +1200, Chris Hope
<bl*******@electrictoolbox.com> wrote:

Jul 19 '05 #4
I'm wanting to cast the data from the resultset into a
string.

I'm using coldfusion mx 6

#On Sun, 04 Apr 2004 22:46:51 +1200, Chris Hope
<bl*******@electrictoolbox.com> wrote:

Jul 19 '05 #5
shaffer wrote:
I'm wanting to cast the data from the resultset into a
string.

I'm using coldfusion mx 6


I quickly searched the MySQL manual using Google and found this:

http://www.mysql.com/doc/en/Cast_Functions.html

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 19 '05 #6
shaffer wrote:
I'm wanting to cast the data from the resultset into a
string.

I'm using coldfusion mx 6


I quickly searched the MySQL manual using Google and found this:

http://www.mysql.com/doc/en/Cast_Functions.html

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 19 '05 #7

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

Similar topics

4
by: Serge Klokov | last post by:
Hello! I have a Oracle table with a BLOB field. Each field is actually a simple text file of several lines. How to get this BLOB fields in readable format? I tryied something like...
6
by: ORC | last post by:
I will use FieldInfo to import values from a XML file into the fields of an objects. But how to convert to the proper type like in this: public void Load(object MyClass) { foreach( FieldInfo...
1
by: James dean | last post by:
The following code is the current method i have for converting an image to Base64.Is this the most efficient way to convert an image to base64 or are there others. The Image class's Save method is...
5
by: simon | last post by:
I have datetime variable: Datetime tsEndTime; Should I use (DateTime): tsEndTime=(DateTime)rdr.GetValue(15) or is better to use: tsEndTime=Convert.ToDateTime(rdr.GetValue(15))
12
by: Brian Henry | last post by:
first question... I have a flat file which unfortinuatly has columns seperated by nulls instead of spaces (a higher up company created it this way for us) is there anyway to do a readline with this...
15
by: JenHu | last post by:
Hi expert, I have a data field (birthdate) contains a datetime datatype (mm/dd/yyyy), how can I convert to mmdd?? say, the birthday is 8/1/1979 and convert to mmdd DOB =...
7
by: Wilson | last post by:
Hi, How do get the Dictioanry object from FiedlInfo ? my code : fieldInfo = this.GetType().GetField("dictioanry1"); ??Dictionary<string, string> dicTemp1 = (Dictionary<string,...
10
by: satishrajana | last post by:
Hi, My SQL returns a NULL in a datefield if there is no date in that field. If there is a NULL in this column, I want to replace it with spaces in my SELECT statement when I am selecting these...
1
by: dean.brunne | last post by:
Hi, In the code below I scroll throught the firldnames of a query ignoring the first three then converting the remaining fields to first: the fieldnames as a record in a field called Product...
5
by: =?Utf-8?B?YmJkb2J1ZGR5?= | last post by:
I am having a problem converting string to binary and I am hoping someone can help me out I have a sql query that does an update that updates a binary field calles password ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.