Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Exclamation Unanswered: some question about mySQL's features

    Hi everybody,

    I am just a newbee for MySQL, about to decide to use or not use it depending
    on its features,for a new project. Api questions are related with MySQL C api.

    My questions:

    1.If I use a table with fixed row type and the table get full once a while then
    what happens if I want to insert a new record (row) in this table? Does it
    automatically increase or what?

    2. Again I want to use a fixed row type table for performance consideration.
    I will use use this table as an temporary buffer and will make alot of insert and
    delete operation. Is deleted row(s) used again for insertion or table size
    incremented that I don't intend it?

    3.After a query execution I have a result set in my hand. But I could not
    find any MySQL api to search the result set for a requested data and data type. The only avaible future seems to be use fetch all the rows one by one
    and compare against to the requested data. Am I mistaken or missing some
    things from MySQL's features?

    4.After a query execution MySQL gives me a result set and only access mechanism to the data returned in result set is fetching the each row one
    by one. But MySQL returns char** type when we fetch a row and only
    I can access the field values by array indexes. To use the returned data from
    result set I need to convert them to the proper type such as int, float,...
    etc which is overburdening the programming task. Does MySQL give us returned data by their type directly or not? Secondly can I access to
    field values not only by index element like row[i], but also field names as they
    are defined in database.

    Thanks in advace for all and sorry that my questions are alittle longer.
    Muarrem

  2. #2
    Join Date
    Jul 2004
    Location
    Dundee, Scotland
    Posts
    107
    1.If I use a table with fixed row type and the table get full once a while then
    what happens if I want to insert a new record (row) in this table? Does it
    automatically increase or what?
    >> yes, it increases automatically

    2. Again I want to use a fixed row type table for performance consideration.
    I will use use this table as an temporary buffer and will make alot of insert and delete operation. Is deleted row(s) used again for insertion or table size
    incremented that I don't intend it?
    >> deleted rows are used again. we have no control over the table size as MySQL manages that. The default MySQL table is "MyISAM", however the "HEAP" table may be of interest as it is a temporary memory table.

    3.After a query execution I have a result set in my hand. But I could not
    find any MySQL api to search the result set for a requested data and data type. The only avaible future seems to be use fetch all the rows one by one
    and compare against to the requested data. Am I mistaken or missing some
    things from MySQL's features?
    >> see http://dev.mysql.com/doc/mysql/en/C_API_datatypes.html
    Rows are obtained by calling mysql_fetch_row()

    4.After a query execution MySQL gives me a result set and only access mechanism to the data returned in result set is fetching the each row one
    by one. But MySQL returns char** type when we fetch a row and only
    I can access the field values by array indexes. To use the returned data from
    result set I need to convert them to the proper type such as int, float,...
    etc which is overburdening the programming task. Does MySQL give us returned data by their type directly or not? Secondly can I access to
    field values not only by index element like row[i], but also field names as they
    are defined in database.
    >> see http://dev.mysql.com/doc/mysql/en/C_API_datatypes.html
    You may obtain the MYSQL_FIELD structures for each field by calling mysql_fetch_field() repeatedly. Field values are not part of this structure; they are contained in a MYSQL_ROW structure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •