mysql_pretty_print (file, res)
This function prints a table of rows resulting from a query to the file pointer file. The file pointer is the result of a call to the Gamma function open or open_string, or is one of stdout or stderr. The res argument is the result of a MySQL method like MYSQL.query.
This example is taken from Section 2.2, “Tutorial 2: create_pets.g”
... /* Test the MYSQL.query_and_store method, and print the whole table. */ allpets = mysql.query_and_store("SELECT * FROM pets"); princ("QUERY The .query_and_store method returns: \n"); mysql_pretty_print(stdout, allpets); ...
The output for this section of the code is as follows:
QUERY The .query_and_store method returns: id name owner species sex birth death -- -------- ------ ------- --- ---------- ---------- 1 Fluffy Harold cat f 1993-02-04 nil 2 Claws Gwen cat m 1994-03-17 nil 3 Buffy Harold dog 1989-05-13 nil 4 Fang Benny dog m 1990-08-27 nil 5 Bowser Diane dog m 1995-08-31 2002-07-29 6 Chirpy Gwen bird f 1998-09-11 nil 7 Whistler Gwen bird 1997-12-09 nil 8 Slim Benny snake m 1996-04-29 nil
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.