473,765 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Incorrect Column Type!!

I am a newbie and struggling to get the correct Column "Type". I really
appreciate if someone can shed some light here..

I have a table XXX which has 4 columns with types char(2), varchar(5),
int(10) and int(10) respectively.

But, when I use the following code, I don't get the correct type from
MYSQL_FIELD structure!!

int nSuccess = mysql_query ( (MYSQL*)m_hdb, "select * from XXX" );
if ( nSuccess == 0 ) {
MYSQL_RES *Result = mysql_store_res ult ( (MYSQL*)m_hdb );
if ( Result ) {
MYSQL_FIELD *msField;
for ( int i = 0; msField = mysql_fetch_fie ld ( m_Result ); i++ ) {
printf ( "Column Name is %s\n", msField->name );
}
}
}

When I am looking the msField->type values in the "Watch" window, I see
MYSQL_TYPE_LONG , MYSQL_TYPE_LONG , 1098016098 and 191985148
respectively!!

Am I missing something here or is there a problem with the call

Thanks in advance.

- Venkat

Aug 4 '05 #1
0 1326

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

Similar topics

0
1874
by: chris | last post by:
What is the recommended way of storing 10 digit phone numbers? I like bigint(10), but it seems most are using varchar? Or I've also seen 2 int columns, one for area code and another for the rest of the digits? I wish phone numbers had their own column type, so I can send 123-456-7890 or (123) 456-7890 or whatever and have mysql do the right thing.
3
2597
by: Jeff Godfrey | last post by:
I am putting together a SQL table which will hold a latitude and longitude for each record. An example of a latitude is: 47 05 36.5 Which column type would best represent this and retain the spaces between degrees, minutes, seconds? Text, varchar, char? Thanks Jeff jeff-godfrey@wa.nacdnet.org
0
1515
by: Dan Hartshorn | last post by:
VS.NET 2003, C#, Windows Server 2003. I have a datagrid and I want the last column to be either an EditCommandColumn or a template column, depending on a value I have. The value changes for each row. So some rows will have an EditCommandColumn, others just a text message in the last column. Is this possible? I am already using the ItemDataBound method to perform some function on each row, but I can't seem to change the datagrid's column...
4
6465
by: Ying Lu | last post by:
Hello, Under mysql, we have "desc tablename" to get the detail information about a table. My question is about to get column name, and column type for a specific table under PostgreSQL through JDBC. Assume we have a table named "test". Under PSQL, we can input "\d test" to see the details about table "test" successufully. However, my main purpose is trying to get column name, column name of a table through JDBC.
2
2279
by: Bill Nguyen | last post by:
I'm learning DatagridView. How do I define a checkbox column type? Thanks Bill
1
3189
by: lee1212 | last post by:
Hi I use vb.Net to open an access db for my software and i have one issue that i don't know how to do, I need to change an exsiting Column that might have some records in it from Text(250) to Memo type cuz i need to store some text that its length is more then 250. Is there any way that i can do something like: Alter Table TABLENAME {Alter Column COLUMN1 Memo} and to change the column type from text to memo without delete the records?...
1
2577
by: gomzi | last post by:
hi, I would like to know as to what the column type should be, in case i want to store some text in the encrypted format. i m using md5 alogrithm available in .net. I tried using binary, but it didnt work...some strange characters were inserted into the table when i used it. thanks, gomzi.
4
2984
by: pks83 | last post by:
In MSSQL I am using datetime as the column type and trying to execute the below mentioned query select time from tickets where ticket_id = '1'; when i execute the query on sql manager window it shows it correctly with seconds and milliseconds in the output like this 2008-01-30 13:58:04.000 But when i run the sql through PHP it replaces the seconds and milliseconds with AM/PM sql1="select time from tickets where ticket_id = '1' ";
0
1741
by: lucindaa | last post by:
Hi EveryBody, i have a problem in setting the column type of datagrid dynamically in C# .Net Windows App. i am generating the grid automatically by assigning datasource of a datatable the columns are dynamicallygenerated when i do like this all the columns are generated as textbox but i want some of the column should be in combo box, Checkbox so Please help me to set column type of datagrid dynamically in C# .Net Windows App
0
10163
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
10007
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
9957
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
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
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();...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.