Changing columns descriptions...

2008-12-30 Thread Carlos Savoretti
Hi all:

Is it possible to change a column description
_without_ having to reset its type ? It is,
I has not to change its type, just its comment ...

Example:
ALTER TABLE products CHANGE COLUMNS product_id product_id INTEGER
COMMENT 'Foo';

In Postgresql, it's done with:
COMMENT ON COLUMN products.product_id IS 'Foo';

Thanks in advance

Carlos Savoretti.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org




Prepared statement cursors problem.

2008-07-29 Thread Carlos Savoretti
Hi all:

I need to set a cursor for doing a SELECT (using the C API)
According the documentation I did in order to setup the cursor.

---
const unsigned long cursor_type = CURSOR_TYPE_READ_ONLY;
if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_CURSOR_TYPE,
(void *) cursor_type)) {
g_print (failed\n);
return NULL;
}
---

All it's ok so far. Thereafter, I call mysql_stmt_store_result() after
binding data buffers with mysql_stmt_bind_result() (according docs),
but:

---
if (mysql_stmt_store_result (cdata-mysql_stmt)) {
g_warning (mysql_stmt_store_result failed: %s\n,
mysql_stmt_error (cdata-mysql_stmt));
}
---
fails giving:   The statement (1) has no open cursor.

??? Why could be this ? , provided the cursor was set up 
before successfully 

What I missed up ?

Thanks in advance.


Carlos Savoretti.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Prepared statement cursors problem.

2008-07-29 Thread Carlos Savoretti
Hi all:

I need to set a cursor for doing a SELECT (using the C API)
According the documentation I did in order to setup the cursor.

---
const unsigned long cursor_type = CURSOR_TYPE_READ_ONLY;
if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_CURSOR_TYPE,
(void *) cursor_type)) {
g_print (failed\n);
return NULL;
}
---

All it's ok so far. Thereafter, I call mysql_stmt_store_result() after
binding data buffers with mysql_stmt_bind_result() (according docs),
but:

---
if (mysql_stmt_store_result (cdata-mysql_stmt)) {
g_warning (mysql_stmt_store_result failed: %s\n,
mysql_stmt_error (cdata-mysql_stmt));
}
---
fails giving:   The statement (1) has no open cursor.

??? Why could be this ? , provided the cursor was set up 
before successfully 

What I missed up ?

Thanks in advance.


Carlos Savoretti.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Information schema question.

2008-03-18 Thread Carlos Savoretti
Hi all!

Well, question is how could I to retrieve information about
types supported . In PostgreSQL the query would be:

--
SELECT pg_type.oid, typname, usename, obj_description(pg_type.oid)
FROM pg_type, pg_user 
WHERE typowner=usesysid AND typrelid = 0 AND typname !~ '^_' 
--

Is there some way to obtain equivalent columns from INFORMATION_SCHEMA,
as similar as possible ?

Thanks in advance...

Carlos Savoretti.





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Optimizing a big query...

2005-03-09 Thread Carlos Savoretti
Hi all:

I programming a GUI which retrieve big tables oftenly.

So, I retrieve chunks of 1000 rows and paginate then

to browse the entire table. It works fine, but it's rather

slow.

I would like to know if I could set some option thru

mysql_option() to optimize the client side (mysql-client-3.23.58)

and what is the the recommended value to clamp the `page' for a

gui app. (For 1000 rows it uses about 12 seconds).

Thanks a lot...

-- 
Carlos Savoretti [EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Local variables

2004-09-10 Thread Carlos Savoretti
Hello all:

I need to make certain operations like this:

select tbl_no as 'Number' , @sal1 := tbl_db - tbl_hb + @sal1 as 'Total'

I'm using the C API; so I make it through mysql_query()

Problem is than having `tbl_db' and 'tbl_hb' with certain values no 

operation is carried out, and `Total' is NULL.

What am I doing bad ?

Please, help me

Thanks all

Carlos Savoretti
[EMAIL PROTECTED]
...



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Alternative for storing results...

2001-06-01 Thread Carlos Savoretti

Hi.

I'm using the C API to access mySQL database (trying to reuse a lot of
existing

software, mixing an old database  mySQL, but it's not the point).

Due the way the old database (named Ideafix) run the keys sometimes the
translated

query produce too many rows (running out ot memory) although I need just
one.

I would like to know if there's any way to get one row at a time
returning quickly 

(not efficient, of course) but it would work.

How I would must to do this ? By now I use:


result = mysql_store_result(connection);

row = mysql_fech_row(result);

...


Thanks. Regards.

[EMAIL PROTECTED]
ARGENTINA.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Help me with mysql_store_result()

2001-06-01 Thread Carlos Savoretti


Hello, mysql:

Can anyone say if exist some function in the C API that do not store

all the requested rows before returning but it returns inmediatly for

each one and the storing be in the remote server.

Thanks a lot !

[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Can I do this ?

2001-05-24 Thread Carlos Savoretti

I'm using C API to access MySQL from another database in order to re-use

a lot of existing software. Due the way the old database works I need 

a query be done like this:

SELECT * FROM some_table WHERE field1 = 1 AND field2  0

ORDER BY CONCAT(field1,field2) LIMIT 1

This is for not to create a new field formed by field1+field2 because

every time a row be updated, I would update this key field... (not

sure about consistency).

The point is that I've an error: syntax error near 'CONCAT(field1,...'

What thing is wrong ?

Regards

[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php