(no subject)

Trevor DeVore lists at mangomultimedia.com
Sat Jan 20 10:16:31 EST 2007


On Jan 20, 2007, at 6:18 AM, Robert Mann wrote:

> I know there is a way to get the column type using
>
> revDatabaseColumnTypes(firstcurID)
>
> is there also a way to get all the other information about the  
> column such
> as PK, and the column type value   int(10)

I think you need to use the database specific queries for this  
information.  Here are ones for mysql, sqlite and postgresql (I  
*think* the postgresql one is right):

put "mytable" into pTable

SWITCH theDBType	# get query to extract table info
	CASE "mysql"
		put "SHOW FULL COLUMNS FROM `" & pTable & "`" into theSQL
		break
	CASE "sqlite"
		put "PRAGMA table_info(" & quote & pTable & quote & ")" into theSQL
		break
	CASE "postgresql"
		put "SELECT column_name FROM information_schema.columns WHERE  
table_name = '" & pTable & "'" into theSQL
		break
END SWITCH

Using one of the above queries and open a cursor.  You should then  
get one record for each field.

-- 
Trevor DeVore
Blue Mango Learning Systems - www.bluemangolearning.com
trevor at bluemangolearning.com





More information about the use-livecode mailing list