Re: Multiple Statements in a query



On Fri, 02 Mar 2007 11:28:02 -0800, paladin.rithe@xxxxxxxxx wrote:

I have 2 statements that I'd like to string together in a query, but
according to everything I'm seeing, it's not possible.
What I'm doing is an insert of a row, where the primary key is an auto
increment. I want to retrieve that by using LAST_INSERT_ID(). I
tried sending another query after the first (once I knew that it the
data was what I need) but it didn't return anything. It seems that
that function can't be used in separate calls or something. Either
that or there's a setting that I need to check. Any ideas?

If you're trying to return the last inserted row on a table with an auto
increment field all you have to do is query the maximum value in that
field.

.



Relevant Pages

  • Re: Multiple Statements in a query
    ... What I'm doing is an insert of a row, where the primary key is an auto ... tried sending another query after the first (once I knew that it the ... increment field all you have to do is query the maximum value in that ...
    (comp.lang.php)
  • Re: Multiple Statements in a query
    ... there's an error in your second query. ... increment field all you have to do is query the maximum value in that ... either natively in a query or through a higher API function like ...
    (comp.lang.php)
  • Re: SP3 Inventory causing 100% CPU issues
    ... This new class added in SP3 collects auto run software information ... This class only collects auto run software information. ... can use wbemtest to find out which query caused the problem. ... at 100% cpu for hours causing the clients to be unusable since ...
    (microsoft.public.sms.admin)
  • Re: Append to table
    ... The problem appeared to be that I had not set the key fields increment ... I have an append query that adds a record to a Table. ...
    (microsoft.public.access.forms)
  • Re: When a field being queried is blank?
    ... Allen Browne - Microsoft MVP. ... Because these identifiers are meaningless to others they query ... words listed in another table that are related by Auto Number to the table ... Is Null OR Not "New York" ...
    (microsoft.public.access.queries)