Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-16-2010, 09:41 PM   PM User | #1
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
Retrieving the column count of a temporary table?

Is it possible to retrieve the column count of a temporary table. Basically I want to get it like this where I can check column names and data types. But I keep getting an error. Saying table doesn't exist, I believe because it is looking for the actual table not the temp one.

Code:
SELECT COUNT(*) 
FROM `INFORMATION_SCHEMA`.`Columns` 
WHERE `TABLE_NAME`='Split' && ((`COLUMN_NAME`='id' && `DATA_TYPE`='INT') || (`COLUMN_NAME`='value' && `DATA_TYPE`='TEXT') || (`COLUMN_NAME`='key' && `DATA_TYPE`='INT')) && `TABLE_SCHEMA`=@database

Last edited by Coyote6; 02-16-2010 at 09:50 PM..
Coyote6 is offline   Reply With Quote
Reply

Bookmarks

Tags
column, count, mysql, table, temporary

Jump To Top of Thread


Thread Tools
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

Forum Jump


All times are GMT +1. The time now is 03:36 AM.


Advertisement
Log in to turn off these ads.