Change detection in MySQL.

 
Thread Tools Search this Thread
Top Forums Web Development MySQL DevZone RSS Change detection in MySQL.
# 8  
Old 06-15-2009
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  
Old 06-16-2009
Thanks you very much. I solved my problem.
# 10  
Old 06-17-2009
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  
Old 06-17-2009
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  
Old 06-17-2009
Ok. I will create new thread.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help: Change date to datetime mysql using awk

#cat file1.log 10.51.61.38;Thu Nov 1 08:06:12 2012;Logout 10.51.62.21;Thu Nov 1 08:06:16 2012;Login output result: 10.51.61.38;2012-11-01 08:06:12;Logout 10.51.62.21;2012-11-01 08:06:16;Login how to write script using awk, need help (1 Reply)
Discussion started by: pillawa
1 Replies

2. UNIX and Linux Applications

MySQL Daemon failed to start - no mysql.sock file

After doing a yum install mysql mysql-server on Fedora 14 I wasn't able to fully install the packages correctly. It installed MySQL 5.1. I was getting the following error when running the: mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)... (3 Replies)
Discussion started by: jastanle84
3 Replies

3. Programming

Parallel Processing Detection and Program Return Value Detection

Hey, for the purpose of a research project I need to know if a specific type of parallel processing is being utilized by any user-run programs. Is there a way to detect whether a program either returns a value to another program at the end of execution, or just utilizes any form of parallel... (4 Replies)
Discussion started by: azar.zorn
4 Replies

4. UNIX for Advanced & Expert Users

mysql would not start: missing mysql.sock

I recently installed mysql-standard-5.0.21-solaris9-sparc-64bit.pkg on a Solaris 9 machine (SunOS 5.9 Generic_118558-19 sun4u sparc SUNW,Ultra-250). The package installation went very smooth, however, starting mysql is a different story. I get the message below everytime I try to start mysql: #... (2 Replies)
Discussion started by: xnightcrawl
2 Replies
Login or Register to Ask a Question