The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Web Programming, Web 2.0 and Mashups > MySQL DevZone RSS
.
google unix.com



MySQL DevZone RSS MySQL Developer Zone RSS

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Detection Theory: Signature Versus Anomaly Detection iBot IT Security RSS 0 11-29-2008 03:40 AM
MySQL University - Training on MySQL Development & Internals iBot Solaris BigAdmin RSS 0 11-12-2008 09:10 AM
MySQL Workbench for Database Change Management iBot MySQL DevZone RSS 0 09-09-2008 10:31 AM
mysql would not start: missing mysql.sock xnightcrawl UNIX for Advanced & Expert Users 2 05-26-2006 10:06 AM
MySQL problem >> missing mysql.sock _hp_ UNIX for Advanced & Expert Users 8 11-03-2002 02:44 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 2.00 average. Display Modes
  #8 (permalink)  
Old 06-15-2009
amit_27 amit_27 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 43
Thanks. I got the information from INFORMATION_SCHEMA COLUMNS.

While retrieving the data from the result of query I faced following problem.

mysql> select select COLUMN_NAME, DATA_TYPE, IS_NULLABLE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION from INFORMATION_SCHEMA.COLUMNS where table_name='account');

In coding I run the query using mysql_real_query() whose result is stored in

pResult = mysql_store_result(pMySQLDB);
fields = mysql_fetch_field(pResult);
my_ulonglong noOfRows = mysql_num_rows(pResult);
row = mysql_fetch_row(pResult);

it will not return any rows.
But in fields I get select COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION that I don't want.
I want the value of these field like "amit, "MY_VAR_STRING", '10', '0'.
I want to store these data inot another variable however not getting it.

Can you please tell me how do I fetch the data what I want from the query output or I am doing anything wrong?
  #9 (permalink)  
Old 06-16-2009
amit_27 amit_27 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 43
Thanks you very much. I solved my problem.
  #10 (permalink)  
Old 06-17-2009
amit_27 amit_27 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 43
How do I get the native data type like we get in ORACLE using

OCIAttrGet(colHandle, OCI_DTYPE_PARAM, (dvoid *) &dataType, 0,
OCI_ATTR_DATA_TYPE, m_errorHandle);

It will return &datatype value for:
VARCHAR2 - 1
NUMBER - 2
Date - 12

How do we achieve this in MYSQL 5.1?
I saw in manual but not found any pointer. There is no any point described for native data types value.
  #11 (permalink)  
Old 06-17-2009
figaro figaro is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 267
I recommend that you open a new topic for every issue you are facing, because that will give people a better understanding of how to help you. If there are multiple issues in each thread, that makes it hard to understand and resolve the latest issue.
  #12 (permalink)  
Old 06-17-2009
amit_27 amit_27 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 43
Ok. I will create new thread.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0