Gauthier - thanks for the response.  

> -----Original Message-----
> From: [Gauthier] [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, November 20, 2002 10:53 AM
> To: Multiple recipients of list witango-talk
> Subject: Re: Witango-Talk: Tango & MSSQL questions
> 
> 
> Just for the second question:
> 
> Use the error HTML output on the specifc action (you need to 
> display attributes bar in the view menu) this special result 
> will only output if an error occur during the execution
> 
> you can use this error HTML output to display, assign 
> variables for debugging, <@sql> report error etc like any 
> other result (if possible with a complete error free code ;)

Question:  how do I get the error info coming back from SQL to show in
the Error HTML output for the action?  That's the part I can't figure
out.

For example, if I try to insert a record with no value in a field that
disallows nulls (and I've not touched the Error HTML output page) I get
this in the browser:

        Error
        An error occurred while processing your request:
        File: play.taf
        Position: Insert
        Class: DBMS
        Main Error Number: 515

        [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the
value NULL into column 'UpdateDt', table
'HIPAAinventory.dbo.tbl_UserInfo'; column does not allow nulls. INSERT
fails.
        23000

        File: play.taf
        Position: Insert
        Class: DBMS
        Main Error Number: 3621

        [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has
been terminated.
        01000

        File: play.taf
        Position: Insert
        Class: Internal
        Main Error Number: -101

        General error during data source operation.

I'd like to capture the error code 515 - I can't figure out how to get
hold of it.  If I put anything into the Error HTML page, I seem to lose
this info entirely.

(OK, I wouldn't actually capture THIS error because my data validation
would catch it up front, but it was an easy error message to get for
this email.  ;)

> 
> * normally each action are processed after each other so the 
> problem you mention shouldn't occur You may consider stored 
> procedure to return the id of the inserted record (the stored 
> procedure make the insert and return the id: SELECT
> IDENT_CURRENT('TABLENAME')+1)

I hadn't thought about stored procedures; I don't do much db work these
days & never got really proficient at SQL.  Is IDENT_CURRENT the last
record in the table in MSSQL?


Thanks!
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to