[freetds] SELECT @@IDENTITY AS InsertID
Shaun Craig
s.craig at andronics.com
Wed Nov 16 06:00:51 EST 2005
At present i've taken out my select @@identity and replaced it with a
select top 1 ... order by ...desc, this also gets me my identity, its
safe for each 'Event' as another 'Event' from the same device cant be
processed till this 'Event' would be finished.
I dont use any stored procedures as code will have to be converted to
connect to mysql eventually.
martin wrote:
> you might be a lot better off writing your functionality into a stored
> procedure then setting a variable with the value of @@identity
> immediately after your insert so you know for sure you have the right
> value rather than playing trial and error with the scope of @@identity
> in sql server 7
>
> e.g.
>
> declare @myIdentity int
> insert into blah (a,b) values (1,2)
> select @myIdentity = @@identity
>
> ..
> ..
> ..
>
> select @myIdentity as returned_id
>
>
>
>
>
> Shaun Craig wrote:
>
>> Can you explain this abit further as i'm no dba!
>>
>> Igor Korot wrote:
>>
>>
>>> Shaun,
>>> Maybe its just a lock issue?
>>>
>>> Thank you.
>>>
>>> -----Original Message-----
>>> From: Shaun Craig <s.craig at andronics.com>
>>> Sent: Nov 15, 2005 10:00 AM
>>> To: s.craig at andronics.com, FreeTDS Development Group
>>> <freetds at lists.ibiblio.org>
>>> Subject: Re: [freetds] SELECT @@IDENTITY AS InsertID
>>>
>>> A bit more debug. I found that 2 inserts done on seperate pool
>>> connections at the same time returned the wrong identity for 1
>>> insert that had @@IDENTITY, the Identity returned belonged to the
>>> other insert that had no @@IDENTITY statement.
>>>
>>> To understand whats happening I will explain the system and how it
>>> works: Platform: Linux, Programming in C, Database: ms sql server 7
>>>
>>> * Receive data(Events) via socket, can receive multiple 'Events' at
>>> same time.
>>> * Each event has its own server program which will grab a pool
>>> connection and do inserts/updates/selects etc until completed and
>>> return connection to pool.
>>>
>>> What i seen happen was 2 'Events' hit our socket at same time, so 2
>>> server programs would have been created, each would grab a pool
>>> connection. One of these 'Events' had an @@IDENTITY statement after
>>> insert and the other had none. What happened was the 'Event' that
>>> had the @@IDENTITY returned the Identity of the Insert of the
>>> 'Event' that didn't have the @@IDENTITY statement. Am I making sense.
>>>
>>> Explained:
>>>
>>> 'Event1'
>>> INSERT
>>>
>>> 'Event2'
>>> INSERT.....SELECT @@IDENTITY
>>>
>>> 'Event1' Identity - checked in Table = 19488675
>>>
>>> 'Event2' Identity - checked in Table = 19488676, but @@IDENTITY
>>> returned value = 19488675
>>>
>>> As you can see the @@IDENTITY doesn't belong to that 'Event' but the
>>> first event that didn't have @@IDENTITY in the statement.
>>>
>>> Can anyone think of what may have happened?
>>>
>>> Thanks.
>>>
>>> Shaun.
>>>
>>> Shaun Craig wrote:
>>>
>>>
>>>
>>>
>>>> Right have my message/error handlers are in and working, know
>>>> they're working as I got this
>>>>
>>>> 'Msg 195, Level 15, State 10 - |IDENT_CURRENT| is not a recognized
>>>> function name.'
>>>>
>>>> So did a bit of research and found that IDENT_CURRENT,
>>>> SCOPE_IDENTITY() came in with ms sql 2000, I'm working of ms sql
>>>> server 7.0 which only has @@IDENTITY. This is going to cause
>>>> problems then, what is my best option, remove the trigger?
>>>>
>>>> Shaun.
>>>>
>>>> Pickett, David wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> OOPS! Reading that URL again, it does not describe any way to get
>>>>> the last
>>>>> identity of a specific table in the current scope!
>>>>>
>>>>> (I have never liked identity columns -- I like to know what I am
>>>>> inserting
>>>>> ahead of time, and there are a myriad of ways to achieve
>>>>> uniqueness, many of
>>>>> them using real world, application-relevant data.)
>>>>>
>>>>> Best regards,
>>>>>
>>>>> David
>>>>>
>>>>> -----Original Message-----
>>>>> From: Pickett, David Sent: Thursday, November 10, 2005 9:39 AM
>>>>> To: 'FreeTDS Development Group'
>>>>> Subject: Re: [freetds] SELECT @@IDENTITY AS InsertID
>>>>>
>>>>>
>>>>> Maybe he wants SCOPE_IDENTITY() to just see his own?:
>>>>>
>>>>>
>>>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_
>>>>>
>>>>> ia-iz_82i1.asp
>>>>>
>>>>> -----Original Message-----
>>>>> From: Rogers, Tom [mailto:tom.rogers at ccur.com]
>>>>> Sent: Thursday, November 10, 2005 9:35 AM
>>>>> To: s.craig at andronics.com; FreeTDS Development Group
>>>>> Subject: Re: [freetds] SELECT @@IDENTITY AS InsertID
>>>>>
>>>>>
>>>>> If the table you are inserting into has an insert trigger and that
>>>>> insert
>>>>> trigger inserts into another table with an identity column than
>>>>> you can rest
>>>>> assured that you will NOT get back the identity of the FIRST table
>>>>> with
>>>>> SELECT @@IDENTITY.
>>>>>
>>>>> To overcome this problem, Microsoft supplied the IDENT_CURRENT()
>>>>> function.
>>>>> Use the SQL Books Online for its documentation, but for the most
>>>>> part you
>>>>> use it JUST like @@IDENTITY, but it has a single parameter to the
>>>>> function,
>>>>> which is the name of the table you want to get the last identity
>>>>> id from:
>>>>>
>>>>> e.g.
>>>>>
>>>>> SELECT IDENT_CURRENT('MyTable')
>>>>>
>>>>> Thomas Rogers
>>>>> System Engineer
>>>>> Concurrent Computer Corporation
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> phone: 215.712.7422 x7261
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> The information contained herein is proprietary and confidential
>>>>> and should
>>>>> be treated in accordance with the Non-Disclosure Agreement and any
>>>>> Amendments to said Agreement executed between the discloser and
>>>>> recipient.
>>>>> If the reader of this message is not the intended recipient, you
>>>>> are hereby
>>>>> notified that any dissemination, distribution, or copy of this
>>>>> information
>>>>> is strictly prohibited. If you have received this information in
>>>>> error,
>>>>> please immediately notify discloser, and then destroy the information
>>>>> contained herein. Thank you.
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: freetds-bounces at lists.ibiblio.org
>>>>> [mailto:freetds-bounces at lists.ibiblio.org]On Behalf Of Shaun Craig
>>>>> Sent: Thursday, November 10, 2005 9:28 AM
>>>>> To: Rogers, Tom; FreeTDS Development Group
>>>>> Subject: Re: [freetds] SELECT @@IDENTITY AS InsertID
>>>>>
>>>>>
>>>>> Thanks for all the input guys,
>>>>>
>>>>> The table I'm inserting to does have an insert trigger to another
>>>>> table although i dont think this is the value i got back. I know
>>>>> this as the trigger insert can only be done on a value between
>>>>> 100-2000 and the number i get is way above that.
>>>>>
>>>>> I'm currently working on something else thats holding me back from
>>>>> getting stuck into this. What happened and at present i dont know
>>>>> if it was a one off or happens regularly is that an insert into
>>>>> table followed by select identity on a single pool connection was
>>>>> returning a different identity to that of the inserted record, as
>>>>> i dont have any error/message handlers in this could be down to my
>>>>> code, when i get the handlers in and get testing i should know more.
>>>>>
>>>>> Will let you know the results.
>>>>>
>>>>> Shaun.
>>>>>
>>>>> Rogers, Tom wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Sorry if this has already come up, but the CLASSIC problem that
>>>>>> causes this
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> is you have an insert trigger on the table you are inserting into
>>>>> and that
>>>>> trigger ends up inserting into another table and what you are
>>>>> getting is the
>>>>> identity id of that last table inserted into.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Could that be happening?
>>>>>>
>>>>>> Thomas Rogers
>>>>>> System Engineer
>>>>>> Concurrent Computer Corporation
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> phone: 215.712.7422 x7261
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> The information contained herein is proprietary and confidential
>>>>>> and should
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> be treated in accordance with the Non-Disclosure Agreement and any
>>>>> Amendments to said Agreement executed between the discloser and
>>>>> recipient.
>>>>> If the reader of this message is not the intended recipient, you
>>>>> are hereby
>>>>> notified that any dissemination, distribution, or copy of this
>>>>> information
>>>>> is strictly prohibited. If you have received this information in
>>>>> error,
>>>>> please immediately notify discloser, and then destroy the information
>>>>> contained herein. Thank you.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: freetds-bounces at lists.ibiblio.org
>>>>>> [mailto:freetds-bounces at lists.ibiblio.org]On Behalf Of Shaun Craig
>>>>>> Sent: Thursday, November 03, 2005 7:07 AM
>>>>>> To: FreeTDS Development Group
>>>>>> Subject: Re: [freetds] SELECT @@IDENTITY AS InsertID
>>>>>>
>>>>>>
>>>>>> Thought everything was rosy with this but its not! I'm having a
>>>>>> small problem where the insertid i get back is incorrect, i think
>>>>>> that the value is not actually returned and the value i get is a
>>>>>> memory value. I have not used any error handlers before with
>>>>>> freetds, if someone could give us the code i could probably find
>>>>>> out whats wrong.
>>>>>>
>>>>>> Code example, take for granted I called the following before the
>>>>>> snipet below
>>>>>> DBINT InsertID;
>>>>>> int journey_insert_id //global program variable
>>>>>> etc...
>>>>>> dbcmd()
>>>>>> dbsqlexec()
>>>>>> dbresults()
>>>>>>
>>>>>> if ( strstr(statements[z],"SELECT @@IDENTITY AS InsertID") != NULL)
>>>>>> {
>>>>>> if (SUCCEED != dbbind(dbconn, 1, INTBIND, (DBINT)0, (BYTE
>>>>>> *)& InsertID))
>>>>>> {
>>>>>> if (error_level > 0)
>>>>>> LogError(GPRS_ERR,15,"Insert", "myDBQuery(), Could
>>>>>> Not Bind JourneyInsetID","fail");
>>>>>> return -1;
>>>>>> } while ( dbnextrow(dbconn) !=
>>>>>> NO_MORE_ROWS) // no error handling here which probably where
>>>>>> my problem is
>>>>>> {
>>>>>> journey_insert_id = InsertID;
>>>>>> } }
>>>>>>
>>>>>> Hope someone can help me out as I have to get this sorted before
>>>>>> christmas, then its off to Australia for a year!
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Shaun.
>>>>>>
>>>>>> Shaun Craig wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Finally got the insertid back from my insert, I just tinkered
>>>>>>> around with the code I had and eventually got it back.
>>>>>>>
>>>>>>> Thanks to all who helped me on it.
>>>>>>>
>>>>>>> Shaun.
>>>>>>>
>>>>>>> Shaun Craig wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Just realised my tdsdump file wasn't attached to email
>>>>>>>> yesterday, so here it is.
>>>>>>>>
>>>>>>>> util.c:269:Starting log file for FreeTDS 0.64.dev.20050228
>>>>>>>> on 2005-10-12 09:31:17 with debug flags 0x4fff.
>>>>>>>> iconv.c:364:iconv to convert client-side data to the
>>>>>>>> "ISO-8859-1" character set
>>>>>>>> iconv.c:517:tds_iconv_info_init: converting
>>>>>>>> "ISO-8859-1"->"UCS-2LE"
>>>>>>>> net.c:150:Connecting to 127.0.0.1 port 5000.
>>>>>>>> net.c:650:Sending packet
>>>>>>>> 0000 02 00 02 00 00 00 00 00-73 76 72 2d 73 75 73 65 |........
>>>>>>>> svr-suse|
>>>>>>>> 0010 2d 31 38 00 00 00 00 00-00 00 00 00 00 00 00 00 |-18.....
>>>>>>>> ........|
>>>>>>>> 0020 00 00 00 00 00 00 0b 73-61 00 00 00 00 00 00 00
>>>>>>>> |.......***.......|
>>>>>>>> 0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0040 00 00 00 00 00 02 72 75-6c 65 72 00 00 00 00 00
>>>>>>>> |......******.....|
>>>>>>>> 0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0060 00 00 00 00 05 33 37 38-37 36 00 00 00 00 00 00 |.....378
>>>>>>>> 76......|
>>>>>>>> 0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0080 00 00 00 05 03 01 06 0a-09 01 00 00 00 00 02 00 |........
>>>>>>>> ........|
>>>>>>>> 0090 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 00b0 00 00 00 6d 79 70 6f 6f-6c 00 00 00 00 00 00 00 |...mypoo
>>>>>>>> l.......|
>>>>>>>> 00c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 00d0 00 06 72 75 6c 65 72 00-00 00 00 00 00 00 00 00 |..*****.
>>>>>>>> ........|
>>>>>>>> 00e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 00f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0150 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0160 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0170 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 0190 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 01a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 01b0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........
>>>>>>>> ........|
>>>>>>>> 01d0 00 05 04 02 00 00 44 42-2d 4c 69 62 72 61 72 79 |......DB
>>>>>>>> -Library|
>>>>>>>> 01e0 0a 00 00 00 00 00 0d 11-75 73 5f 65 6e 67 6c 69 |........
>>>>>>>> us_engli|
>>>>>>>> 01f0 73 68 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |sh......
>>>>>>>> ........|
>>>>>>>>
>>>>>>>> net.c:650:Sending packet
>>>>>>>> 0000 02 01 00 4c 00 00 00 00-00 00 00 00 00 00 0a 00 |...L....
>>>>>>>> ........|
>>>>>>>> 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 69 73 6f |........
>>>>>>>> .....iso|
>>>>>>>> 0020 5f 31 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |_1......
>>>>>>>> ........|
>>>>>>>> 0030 00 00 00 00 00 00 00 00-00 00 00 05 01 35 31 32 |........
>>>>>>>> .....512|
>>>>>>>> 0040 00 00 00 03 00 00 00 00-00 00 00 00 |........
>>>>>>>> ....|
>>>>>>>>
>>>>>>>> token.c:317:tds_process_login_tokens()
>>>>>>>> net.c:437:Received header
>>>>>>>> 0000 04 01 00 dc 00 00 00 00- |........|
>>>>>>>>
>>>>>>>> net.c:531:Received packet
>>>>>>>> 0000 e3 14 00 01 0b 4c 65 6f-63 61 74 65 54 65 73 74 |.....Leo
>>>>>>>> cateTest|
>>>>>>>> 0010 06 6d 61 73 74 65 72 ab-3e 00 45 16 00 00 02 0a |.master.
>>>>>>>> >.E.....|
>>>>>>>> 0020 2a 00 43 68 61 6e 67 65-64 20 64 61 74 61 62 61 |*.Change
>>>>>>>> d databa|
>>>>>>>> 0030 73 65 20 63 6f 6e 74 65-78 74 20 74 6f 20 27 4c |se conte
>>>>>>>> xt to 'L|
>>>>>>>> 0040 65 6f 63 61 74 65 54 65-73 74 27 2e 04 4a 44 42 |eocateTe
>>>>>>>> st'..JDB|
>>>>>>>> 0050 43 05 5a 5a 5a 5a 5a 01-00 e3 0d 00 02 0a 75 73 |C.ZZZZZ.
>>>>>>>> ......us|
>>>>>>>> 0060 5f 65 6e 67 6c 69 73 68-00 ab 3d 00 47 16 00 00 |_english
>>>>>>>> ..=.G...|
>>>>>>>> 0070 01 0a 29 00 43 68 61 6e-67 65 64 20 6c 61 6e 67 |..).Chan
>>>>>>>> ged lang|
>>>>>>>> 0080 75 61 67 65 20 73 65 74-74 69 6e 67 20 74 6f 20 |uage set
>>>>>>>> ting to |
>>>>>>>> 0090 27 75 73 5f 65 6e 67 6c-69 73 68 27 2e 04 4a 44 |'us_engl
>>>>>>>> ish'..JD|
>>>>>>>> 00a0 42 43 05 5a 5a 5a 5a 5a-01 00 e3 07 00 04 04 31 |BC.ZZZZZ
>>>>>>>> .......1|
>>>>>>>> 00b0 30 32 34 00 ad 14 00 05-05 00 00 00 0a 73 71 6c |024.....
>>>>>>>> .....sql|
>>>>>>>> 00c0 20 73 65 72 76 65 72 01-00 00 01 fd 00 00 02 00 | server.
>>>>>>>> ........|
>>>>>>>> 00d0 01 00 00 00 - |....|
>>>>>>>>
>>>>>>>> token.c:321:looking for login token, got e3(ENVCHANGE)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
>>>>>>>> read.c:178:tds_get_string: reading 11 from wire to give 11 to
>>>>>>>> client.
>>>>>>>> read.c:178:tds_get_string: reading 6 from wire to give 6 to
>>>>>>>> client.
>>>>>>>> token.c:321:looking for login token, got ab(INFO)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is ab(INFO)
>>>>>>>> token.c:2640:tds_process_msg() reading message from server
>>>>>>>> read.c:178:tds_get_string: reading 42 from wire to give 42 to
>>>>>>>> client.
>>>>>>>> read.c:178:tds_get_string: reading 4 from wire to give 4 to
>>>>>>>> client.
>>>>>>>> read.c:178:tds_get_string: reading 5 from wire to give 5 to
>>>>>>>> client.
>>>>>>>> token.c:2702:tds_process_msg() calling client msg handler
>>>>>>>> token.c:2715:tds_process_msg() returning TDS_SUCCEED
>>>>>>>> token.c:321:looking for login token, got e3(ENVCHANGE)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
>>>>>>>> read.c:178:tds_get_string: reading 10 from wire to give 10 to
>>>>>>>> client.
>>>>>>>> token.c:321:looking for login token, got ab(INFO)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is ab(INFO)
>>>>>>>> token.c:2640:tds_process_msg() reading message from server
>>>>>>>> read.c:178:tds_get_string: reading 41 from wire to give 41 to
>>>>>>>> client.
>>>>>>>> read.c:178:tds_get_string: reading 4 from wire to give 4 to
>>>>>>>> client.
>>>>>>>> read.c:178:tds_get_string: reading 5 from wire to give 5 to
>>>>>>>> client.
>>>>>>>> token.c:2702:tds_process_msg() calling client msg handler
>>>>>>>> token.c:2715:tds_process_msg() returning TDS_SUCCEED
>>>>>>>> token.c:321:looking for login token, got e3(ENVCHANGE)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
>>>>>>>> read.c:178:tds_get_string: reading 4 from wire to give 4 to
>>>>>>>> client.
>>>>>>>> token.c:2528:increasing block size from to 1024
>>>>>>>> token.c:321:looking for login token, got ad(LOGINACK)
>>>>>>>> read.c:178:tds_get_string: reading 10 from wire to give 10 to
>>>>>>>> client.
>>>>>>>> token.c:321:looking for login token, got fd(DONE)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is fd(DONE)
>>>>>>>> token.c:2344:tds_process_end: more_results = 0
>>>>>>>> was_cancelled = 0
>>>>>>>> error = 0
>>>>>>>> done_count_valid = 0
>>>>>>>> token.c:2360:tds_process_end() state set to TDS_IDLE
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_IDLE
>>>>>>>> token.c:394:leaving tds_process_login_tokens() returning 1
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_QUERYING
>>>>>>>> mem.c:453:tds_free_all_results()
>>>>>>>> util.c:125:Changing query state from TDS_QUERYING to TDS_PENDING
>>>>>>>> net.c:650:Sending packet
>>>>>>>> 0000 01 01 00 1b 00 00 00 00-73 65 74 20 74 65 78 74 |........
>>>>>>>> set text|
>>>>>>>> 0010 73 69 7a 65 20 36 34 35-31 32 20 |size 645
>>>>>>>> 12 |
>>>>>>>>
>>>>>>>> util.c:125:Changing query state from TDS_PENDING to TDS_READING
>>>>>>>> net.c:437:Received header
>>>>>>>> 0000 04 01 00 11 00 00 00 00- |........|
>>>>>>>>
>>>>>>>> net.c:531:Received packet
>>>>>>>> 0000 fd 00 00 be 00 00 00 00-00 |........ .|
>>>>>>>>
>>>>>>>> token.c:526:processing result tokens. marker is fd(DONE)
>>>>>>>> token.c:2344:tds_process_end: more_results = 0
>>>>>>>> was_cancelled = 0
>>>>>>>> error = 0
>>>>>>>> done_count_valid = 0
>>>>>>>> token.c:2360:tds_process_end() state set to TDS_IDLE
>>>>>>>> util.c:125:Changing query state from TDS_READING to TDS_IDLE
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_PENDING
>>>>>>>> token.c:514:tds_process_result_tokens() state is COMPLETED
>>>>>>>> dblib.c:1138:dbuse()
>>>>>>>> dblib.c:1054:dbcmd() bufsz = 0
>>>>>>>> dblib.c:1104:in dbsqlexec()
>>>>>>>> dblib.c:5818:in dbsqlsend()
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_QUERYING
>>>>>>>> mem.c:453:tds_free_all_results()
>>>>>>>> util.c:125:Changing query state from TDS_QUERYING to TDS_PENDING
>>>>>>>> net.c:650:Sending packet
>>>>>>>> 0000 01 01 00 13 00 00 00 00-75 73 65 20 4c 65 6f 63 |........
>>>>>>>> use Leoc|
>>>>>>>> 0010 61 74 65 - |ate|
>>>>>>>>
>>>>>>>> dblib.c:4005:in dbsqlok()
>>>>>>>> net.c:437:Received header
>>>>>>>> 0000 04 01 00 63 00 00 00 00- |...c....|
>>>>>>>>
>>>>>>>> net.c:531:Received packet
>>>>>>>> 0000 e3 11 00 01 07 4c 65 6f-63 61 74 65 07 4c 65 6f |.....Leo
>>>>>>>> cate.Leo|
>>>>>>>> 0010 63 61 74 65 ab 3b 00 45-16 00 00 01 00 26 00 43 |cate.;.E
>>>>>>>> .....&.C|
>>>>>>>> 0020 68 61 6e 67 65 64 20 64-61 74 61 62 61 73 65 20 |hanged d
>>>>>>>> atabase |
>>>>>>>> 0030 63 6f 6e 74 65 78 74 20-74 6f 20 27 4c 65 6f 63 |context
>>>>>>>> to 'Leoc|
>>>>>>>> 0040 61 74 65 27 2e 09 53 51-4c 53 45 52 56 45 52 00 |ate'..SQ
>>>>>>>> LSERVER.|
>>>>>>>> 0050 01 00 fd 00 00 e2 00 00-00 00 00 |........
>>>>>>>> ...|
>>>>>>>>
>>>>>>>> dblib.c:4024:dbsqlok() marker is e3
>>>>>>>> util.c:125:Changing query state from TDS_PENDING to TDS_READING
>>>>>>>> token.c:526:processing result tokens. marker is e3(ENVCHANGE)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is e3(ENVCHANGE)
>>>>>>>> read.c:178:tds_get_string: reading 7 from wire to give 7 to
>>>>>>>> client.
>>>>>>>> read.c:178:tds_get_string: reading 7 from wire to give 7 to
>>>>>>>> client.
>>>>>>>> token.c:526:processing result tokens. marker is ab(INFO)
>>>>>>>> token.c:106:tds_process_default_tokens() marker is ab(INFO)
>>>>>>>> token.c:2640:tds_process_msg() reading message from server
>>>>>>>> read.c:178:tds_get_string: reading 38 from wire to give 38 to
>>>>>>>> client.
>>>>>>>> read.c:178:tds_get_string: reading 9 from wire to give 9 to
>>>>>>>> client.
>>>>>>>> token.c:2702:tds_process_msg() calling client msg handler
>>>>>>>> token.c:2715:tds_process_msg() returning TDS_SUCCEED
>>>>>>>> token.c:526:processing result tokens. marker is fd(DONE)
>>>>>>>> token.c:2344:tds_process_end: more_results = 0
>>>>>>>> was_cancelled = 0
>>>>>>>> error = 0
>>>>>>>> done_count_valid = 0
>>>>>>>> token.c:2360:tds_process_end() state set to TDS_IDLE
>>>>>>>> util.c:125:Changing query state from TDS_READING to TDS_IDLE
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_PENDING
>>>>>>>> dblib.c:4070:dbsqlok() end status was success
>>>>>>>> dblib.c:1288:dbresults()
>>>>>>>> token.c:897:tds_process_row_tokens() state is COMPLETED
>>>>>>>> dblib.c:1054:dbcmd() bufsz = 12
>>>>>>>> dblib.c:5007:in dbfreebuf()
>>>>>>>> dblib.c:1104:in dbsqlexec()
>>>>>>>> dblib.c:5818:in dbsqlsend()
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_QUERYING
>>>>>>>> mem.c:453:tds_free_all_results()
>>>>>>>> util.c:125:Changing query state from TDS_QUERYING to TDS_PENDING
>>>>>>>> net.c:650:Sending packet
>>>>>>>> 0000 01 01 00 ed 00 00 00 00-49 4e 53 45 52 54 20 49 |........
>>>>>>>> INSERT I|
>>>>>>>> 0010 4e 54 4f 20 4a 6f 75 72-6e 65 79 20 28 4a 6f 75 |NTO Jour
>>>>>>>> ney (Jou|
>>>>>>>> 0020 72 6e 65 79 53 74 61 72-74 54 69 6d 65 2c 53 74 |rneyStar
>>>>>>>> tTime,St|
>>>>>>>> 0030 61 72 74 4c 61 74 69 74-75 64 65 2c 53 74 61 72 |artLatit
>>>>>>>> ude,Star|
>>>>>>>> 0040 74 4c 6f 6e 67 69 74 75-64 65 2c 4f 64 6f 6d 65 |tLongitu
>>>>>>>> de,Odome|
>>>>>>>> 0050 74 65 72 53 74 61 72 74-2c 56 65 68 69 63 6c 65 |terStart
>>>>>>>> ,Vehicle|
>>>>>>>> 0060 49 44 29 20 56 41 4c 55-45 53 20 28 43 4f 4e 56 |ID) VALU
>>>>>>>> ES (CONV|
>>>>>>>> 0070 45 52 54 28 44 61 74 65-54 69 6d 65 2c 27 32 34 |ERT(Date
>>>>>>>> Time,'24|
>>>>>>>> 0080 20 41 75 67 75 73 74 20-32 30 30 35 20 31 37 3a | August
>>>>>>>> 2005 17:|
>>>>>>>> 0090 30 34 3a 34 39 27 29 2c-43 4f 4e 56 45 52 54 28 |04:49'),
>>>>>>>> CONVERT(|
>>>>>>>> 00a0 66 6c 6f 61 74 2c 27 35-33 2e 33 30 39 37 32 30 |float,'5
>>>>>>>> 3.309720|
>>>>>>>> 00b0 27 29 2c 43 4f 4e 56 45-52 54 28 66 6c 6f 61 74 |'),CONVE
>>>>>>>> RT(float|
>>>>>>>> 00c0 2c 27 2d 32 2e 37 30 33-34 33 39 27 29 2c 43 4f |,'-2.703
>>>>>>>> 439'),CO|
>>>>>>>> 00d0 4e 56 45 52 54 28 69 6e-74 2c 27 31 31 36 32 35 |NVERT(in
>>>>>>>> t,'11625|
>>>>>>>> 00e0 35 33 34 27 29 2c 27 31-31 31 30 27 29 |534'),'1
>>>>>>>> 110')|
>>>>>>>>
>>>>>>>> dblib.c:4005:in dbsqlok()
>>>>>>>> net.c:437:Received header
>>>>>>>> 0000 04 01 00 11 00 00 00 00- |........|
>>>>>>>>
>>>>>>>> net.c:531:Received packet
>>>>>>>> 0000 fd 10 00 c3 00 01 00 00-00 |........ .|
>>>>>>>>
>>>>>>>> dblib.c:4024:dbsqlok() marker is fd
>>>>>>>> util.c:125:Changing query state from TDS_PENDING to TDS_READING
>>>>>>>> token.c:526:processing result tokens. marker is fd(DONE)
>>>>>>>> token.c:2344:tds_process_end: more_results = 0
>>>>>>>> was_cancelled = 0
>>>>>>>> error = 0
>>>>>>>> done_count_valid = 1
>>>>>>>> token.c:2360:tds_process_end() state set to TDS_IDLE
>>>>>>>> util.c:125:Changing query state from TDS_READING to TDS_IDLE
>>>>>>>> token.c:2376: rows_affected = 1
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_PENDING
>>>>>>>> dblib.c:4070:dbsqlok() end status was success
>>>>>>>> dblib.c:1288:dbresults()
>>>>>>>> dblib.c:1054:dbcmd() bufsz = 230
>>>>>>>> dblib.c:5007:in dbfreebuf()
>>>>>>>> dblib.c:1104:in dbsqlexec()
>>>>>>>> dblib.c:5818:in dbsqlsend()
>>>>>>>> util.c:125:Changing query state from TDS_IDLE to TDS_QUERYING
>>>>>>>> mem.c:453:tds_free_all_results()
>>>>>>>> util.c:125:Changing query state from TDS_QUERYING to TDS_PENDING
>>>>>>>> net.c:650:Sending packet
>>>>>>>> 0000 01 01 00 25 00 00 00 00-53 45 4c 45 43 54 20 40 |...%....
>>>>>>>> SELECT @|
>>>>>>>> 0010 40 49 44 45 4e 54 49 54-59 20 41 53 20 49 6e 73 |@IDENTIT
>>>>>>>> Y AS Ins|
>>>>>>>> 0020 65 72 74 49 44 - |ertID|
>>>>>>>>
>>>>>>>> dblib.c:4005:in dbsqlok()
>>>>>>>> net.c:437:Received header
>>>>>>>> 0000 04 01 00 30 00 00 00 00- |...0....|
>>>>>>>>
>>>>>>>> net.c:531:Received packet
>>>>>>>> 0000 a0 09 00 08 49 6e 73 65-72 74 49 44 a1 06 00 19 |....Inse
>>>>>>>> rtID....|
>>>>>>>> 0010 00 01 00 6d 08 d1 08 00-00 00 00 00 80 43 40 fd |...m....
>>>>>>>> .....C at .|
>>>>>>>> 0020 10 00 c1 00 01 00 00 00- |........|
>>>>>>>>
>>>>>>>> dblib.c:4024:dbsqlok() marker is a0
>>>>>>>> dblib.c:4030:dbsqlok() found result token
>>>>>>>> dblib.c:1288:dbresults()
>>>>>>>> mem.c:453:tds_free_all_results()
>>>>>>>> util.c:125:Changing query state from TDS_PENDING to TDS_READING
>>>>>>>> token.c:526:processing result tokens. marker is a0(COLNAME)
>>>>>>>> read.c:178:tds_get_string: reading 8 from wire to give 8 to
>>>>>>>> client.
>>>>>>>> mem.c:453:tds_free_all_results()
>>>>>>>> token.c:526:processing result tokens. marker is a1(COLFMT)
>>>>>>>> token.c:1256:processing result. type = 109(float-null),
>>>>>>>> varint_size 1
>>>>>>>> util.c:125:Changing query state from TDS_READING to TDS_PENDING
>>>>>>>> dblib.c:1326:dbresults() process_result_tokens returned
>>>>>>>> result_type = 4049 retcode = 1
>>>>>>>> util.c:125:Changing query state from TDS_PENDING to TDS_READING
>>>>>>>> token.c:526:processing result tokens. marker is d1(ROW)
>>>>>>>> util.c:125:Changing query state from TDS_READING to TDS_PENDING
>>>>>>>> dblib.c:1326:dbresults() process_result_tokens returned
>>>>>>>> result_type = 4040 retcode = 1
>>>>>>>> dblib.c:2091:dbbind() column = 1 8 0
>>>>>>>> dblib.c:2123:dbbind() srctype = 62 desttype = 56
>>>>>>>> convert.c:2887:tds_willconvert()
>>>>>>>> convert.c:2891:tds_willconvert() 62 56 1
>>>>>>>> dblib.c:1545:dbnextrow()
>>>>>>>> dblib.c:1560:dbnextrow() dbresults_state = 2
>>>>>>>> util.c:125:Changing query state from TDS_PENDING to TDS_READING
>>>>>>>> token.c:907:processing row tokens. marker is d1(ROW)
>>>>>>>> token.c:2071:processing row. column is 0 varint size = 1
>>>>>>>> token.c:2128:processing row. column size is 8
>>>>>>>> util.c:125:Changing query state from TDS_READING to TDS_PENDING
>>>>>>>> dblib.c:6244:copy_data_to_host_var(62 [SYBFLT8] len 8 => 56
>>>>>>>> [SYBINT4] len 0)
>>>>>>>> dblib.c:6387:copy_data_to_host_var() called tds_convert returned 4
>>>>>>>>
>>>>>>>> HTH
>>>>>>>> _______________________________________________
>>>>>>>> FreeTDS mailing list
>>>>>>>> FreeTDS at lists.ibiblio.org
>>>>>>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> FreeTDS mailing list
>>>>>> FreeTDS at lists.ibiblio.org
>>>>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> FreeTDS mailing list
>>>>> FreeTDS at lists.ibiblio.org
>>>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>>> _______________________________________________
>>>>> FreeTDS mailing list
>>>>> FreeTDS at lists.ibiblio.org
>>>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>>> _______________________________________________
>>>>> FreeTDS mailing list
>>>>> FreeTDS at lists.ibiblio.org
>>>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>>> _______________________________________________
>>>>> FreeTDS mailing list
>>>>> FreeTDS at lists.ibiblio.org
>>>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> FreeTDS mailing list
>>>> FreeTDS at lists.ibiblio.org
>>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>>
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> FreeTDS mailing list
>>> FreeTDS at lists.ibiblio.org
>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>
>>>
>>
>>
>>
--
Shaun Craig
Andronics Ltd.
Tel: 02871273118
Web: http://www.andronics.co.uk
More information about the FreeTDS
mailing list