locked
mysql - requery() does not work RRS feed

  • Question

  • Hi expects,

    I use requery() function say, REQUERY("curacode") to get the latest updated MYSQL data but it comes out "function not supported for SQL pass-through cursors".  How can I refresh mysql cursor or by what function to do it? Thank you.

    Thursday, October 20, 2011 5:14 AM

Answers

  • Why do you even get the idea of retrieving all data? The voucher number is in one field only, isn't it? Why query all other fields too. Also: does the voucher number increase? Then only the max voucher number is of interest, isn't it? And there are even better ideas of how to go about creating a unique value.

    1. Creation of primary or secondary key values, which also are unique values, is a standard job for any database in general, it should be done by the database. For example it can be done by the fields default value, so you simply omit the field in an insert, the server generates the default value, eg an auoincrementing integer, and you read it back. Eg simply via SELECT LAST_INSERT_ID().

    2. If you don't have a default value in the table and no stored proc creates the voucher you can create a random voucher number or a mix of a alphanumeric characters in a fashin guaranteeing there won't be a double number. GUID or in MySQL UUID() is such a value.

    3. if both these solutions don't fit your needs, but the voucher number is at least an incrementing value or string, you could eg SELECT MAX(vouchernumber) FROM table and increment that, store it. Afterwards check it's double, and if not use it, if it's double increment it further and repeat.

    I think I could come up with even more ideas. You're free to do whatever creates unique numbers or strings.

    Bye, Olaf.

    • Marked as answer by fanda3333 Monday, October 24, 2011 7:16 AM
    Friday, October 21, 2011 8:54 AM

All replies

  • You can't. You can only refresh views, local or remote. If you want a refresh from MySQL, simply repeat the SQLExec.

    Bye, Olaf.


    • Edited by Olaf Doschke Thursday, October 20, 2011 7:15 AM
    • Proposed as answer by Mike Feng Saturday, October 22, 2011 8:27 AM
    Thursday, October 20, 2011 7:13 AM
  • Hi,

    I need to refresh mysql cursor in order to get the latest updated voucher number to avoid duplication. The case is that mysql table contains more than 500,000 of records. I have to execute the following SQLExec every time in order to get the latest updated voucher number when I input new records. Surely the server needs to spend several minutes to finish the process. This would be unacceptable by the end user. Is there any way to get the updated data without execute such SQLExce? Or is there any tricky way to do it? Thank you.

    =SQLEXEC(gnHandle,'SELECT * FROM acode',"curacode")

     

    Friday, October 21, 2011 3:05 AM
  • Why do you even get the idea of retrieving all data? The voucher number is in one field only, isn't it? Why query all other fields too. Also: does the voucher number increase? Then only the max voucher number is of interest, isn't it? And there are even better ideas of how to go about creating a unique value.

    1. Creation of primary or secondary key values, which also are unique values, is a standard job for any database in general, it should be done by the database. For example it can be done by the fields default value, so you simply omit the field in an insert, the server generates the default value, eg an auoincrementing integer, and you read it back. Eg simply via SELECT LAST_INSERT_ID().

    2. If you don't have a default value in the table and no stored proc creates the voucher you can create a random voucher number or a mix of a alphanumeric characters in a fashin guaranteeing there won't be a double number. GUID or in MySQL UUID() is such a value.

    3. if both these solutions don't fit your needs, but the voucher number is at least an incrementing value or string, you could eg SELECT MAX(vouchernumber) FROM table and increment that, store it. Afterwards check it's double, and if not use it, if it's double increment it further and repeat.

    I think I could come up with even more ideas. You're free to do whatever creates unique numbers or strings.

    Bye, Olaf.

    • Marked as answer by fanda3333 Monday, October 24, 2011 7:16 AM
    Friday, October 21, 2011 8:54 AM
  • Hi Olaf, Thank you for your advice to refresh my mind.

     

    Monday, October 24, 2011 7:16 AM
  • Why do you even get the idea of retrieving all data? The voucher number is in one field only, isn't it? Why query all other fields too. Also: does the voucher number increase? Then only the max voucher number is of interest, isn't it? And there are even better ideas of how to go about creating a unique value.

    1. Creation of primary or secondary key values, which also are unique values, is a standard job for any database in general, MS SQL Server to MySQL it should be done by the database. For example it can be done by the fields default value, so you simply omit the field in an insert, the server generates the default value, eg an auoincrementing integer, and you read it back. Eg simply via SELECT LAST_INSERT_ID().

    2. If you don't have a default value in the table and no stored proc creates the voucher you can create a random voucher number or a mix of a alphanumeric characters in a fashin guaranteeing there won't be a double number. GUID or in MySQL UUID() is such a value.

    3. if both these solutions don't fit your needs, but the voucher number is at least an incrementing value or string, you could eg SELECT MAX(vouchernumber) FROM table and increment that, store it. Afterwards check it's double, and if not use it, if it's double increment it further and repeat.

    I think I could come up with even more ideas. You're free to do whatever creates unique numbers or strings.

    Bye, Olaf.

    Thread: php does not work last post 06-02-2009 10:33 pm by dragon52 6 replies. Php: mysql_pconnect - manual a small orange (php 5 2 12 or php 4 4 9, mysql 5 0 90 or mysql 4 1 22, apache) aplus.net - does not work with akismet due to requirements asking for permission for all. Four hundred guru--getting mysql working with php insert does not work inserting data into a simple table does not work works fine so, for ooo, this is not a problem: mysql does not know tables which do not belong a. Php does not work : the official microsoft iis site if this does not work, please contact hostgator via phone or live chat it doesn t work that way mysql databases do not have web urls you need ssh, cpanel, or a php.


    Monday, October 24, 2011 1:25 PM
  • Why do you even get the idea of retrieving all data? The voucher number is in one field only, isn't it? Why query all other fields too. Also: does the voucher number increase? Then only the max voucher number is of interest, isn't it? And there are even better ideas of how to go about creating a unique value.

    1. Creation of primary or secondary key values, which also are unique values, is a standard job for any database in general, MySQL to MS SQL Server it should be done by the database. For example it can be done by the fields default value, so you simply omit the field in an insert, the server generates the default value, eg an auoincrementing integer, and you read it back. Eg simply via SELECT LAST_INSERT_ID().

    2. If you don't have a default value in the table and no stored proc creates the voucher you can create a random voucher number or a mix of a alphanumeric characters in a fashin guaranteeing there won't be a double number. GUID or in MySQL UUID() is such a value.

    3. if both these solutions don't fit your needs, but the voucher number is at least an incrementing value or string, you could eg SELECT MAX(vouchernumber) FROM table and increment that, store it. Afterwards check it's double, and if not use it, if it's double increment it further and repeat.

    I think I could come up with even more ideas. You're free to do whatever creates unique numbers or strings.

    Bye, Olaf.

    Thread: php does not work last post 06-02-2009 10:33 pm by dragon52 6 replies. Php: mysql_pconnect - manual a small orange (php 5 2 12 or php 4 4 9, mysql 5 0 90 or mysql 4 1 22, apache) aplus.net - does not work with akismet due to requirements asking for permission for all. Four hundred guru--getting mysql working with php insert does not work inserting data into a simple table does not work works fine so, for ooo, this is not a problem: mysql does not know tables which do not belong a. Php does not work : the official microsoft iis site if this does not work, please contact hostgator via phone or live chat it doesn t work that way mysql databases do not have web urls you need ssh, cpanel, or a php.


    Monday, October 24, 2011 1:28 PM
  • Hi expects,

    I use requery() function say, MySQL to MS SQL Server REQUERY("curacode") to get the latest updated MYSQL data but it comes out "function not supported for SQL pass-through cursors".  How can I refresh mysql cursor or by what function to do it? Thank you.

    Thread: php does not work last post 06-02-2009 10:33 pm by dragon52 6 replies. Php: mysql_pconnect - manual a small orange (php 5 2 12 or php 4 4 9, mysql 5 0 90 or mysql 4 1 22, apache) aplus.net - does not work with akismet due to requirements asking for permission for all. Four hundred guru--getting mysql working with php insert does not work inserting data into a simple table does not work works fine so, for ooo, this is not a problem: mysql does not know tables which do not belong a. Php does not work : the official microsoft iis site if this does not work, please contact hostgator via phone or live chat it doesn t work that way mysql databases do not have web urls you need ssh, cpanel, or a php.


    Monday, October 24, 2011 1:33 PM