Gossamer Forum
Home : Products : DBMan SQL : Discussion :

DbMan and SQL Triggers

Quote Reply
DbMan and SQL Triggers
I have a standard database addition script that works correctly (record is added to SQL and a return "add_success" screen appears). When I add a field trigger to the MSSQL database the data is inserted into the DB and the trigger completes (it does what it is supposed to do) but then I get an error screen back from DbMan (See below).

My Question: Does DbMan require some type of "completion OK" back from the SQL server and could my DB trigger be preventing that? Can I just have my trigger respond back with the data that DbMan needs (eg. a return value)?

A fatal error has occured:

Can't use an undefined value as a HASH reference at Dbsql::Home::add_success line 21.

Stack Trace
Dbsql (2756): Dbsql::Home::add_success called at Dbsql::Home::add_record line 30 with arguments
(Dbsql::Home=HASH(0x80fba1c), 27).
Dbsql (2756): Dbsql::Home::add_record called at /users/a/allied/public_html/code/admin/GT/Plugins.pm line 165 with arguments
Dbsql (2756): GT::Plugins::dispatch_method called at /users/a/allied/public_html/code/admin/Dbsql/Home.pm line 82 with arguments
(GT::Plugins, /users/a/allied/public_html/code/admin/Plugins/Dbsql, add_record, Dbsql::Home=HASH(0x80fba1c), add_record).
Dbsql (2756): Dbsql::Home::process called at /users/a/allied/public_html/code/db.cgi line 29 with arguments
(Dbsql::Home=HASH(0x80fba1c), in, GT::CGI=HASH(0x848980c), sql, GT::SQL=HASH(0x84a32fc), cfg, Dbsql::Config=HASH(0x81f6978)).
Dbsql (2756): main::main called at /users/a/allied/public_html/code/db.cgi line 22 with no arguments.

System Information
Perl Version: 5.006001
DBMan SQL Version: 2.1.0
DBI.pm Version: 1.32
@INC =

Confirm => true
Diagnosis => 844.8
FName => Alyssa
FirstTreatment => 05/10/2003
Goals =>
History =>
LName => Wilson
Onset => 05/07/2003
PatientID => 000000-alyssawil
Progress => Processing Initial Visit...
Rationale =>
Username => 000000
Visitscomplete => 2
Visitsreason =>
db => Claims
do => add_record
sid => 46f1b979affec90c9f7082c72fe0a010
submit.x => 63
submit.y => 17
Quote Reply
Re: [LanceWilson2] DbMan and SQL Triggers In reply to

I am not quite sure about this problem, but if can give me more detail what exact the field trigger does, I will do a test on my local server.


Quote Reply
Re: [TheStone] DbMan and SQL Triggers In reply to
Ok... Maybe I should have qualified my situation a bit better. I'm using an ODBC bridge software to connect to a Win2k/MsSQL 2k server. But DbMan (and the webserver) is running on a RedHat 8.0 box. I'm using Easysoft's ODBC - ODBC bridge software. Actually it works great!

I don't think that the problem lies within the connection but rather what DbMan is (or isn't) seeing back from the SQL server because the database entry works just fine when I take out the field trigger.

I have included the trigger that I am using below. Basically it just watches for whenever a new record is added. When it is, it fires off a stored procedure. Right now it does not return any value upon completion. Do you think DbMan SQL is looking for a return value? What is it looking for?

ALTER TRIGGER dbo.Claims_Trigger1
ON dbo.Claims
DECLARE @RetVal int
DECLARE @_ClaimID int

SELECT @_ClaimID = ClaimID from inserted
IF UPDATE (ClaimID) EXEC AHSWeb.spClaimsRecordEval @_ClaimID, @RetVal OUTPUT
Quote Reply
Re: [LanceWilson2] DbMan and SQL Triggers In reply to
Can you post the store procedure 'spClaimsRecordEval'?


Quote Reply
Re: [TheStone] DbMan and SQL Triggers In reply to
I have sent that code to your email address (I don't want it publically posted here). Note that this script also recursively calls other SQL scripts but the main thing to note here is that they will all return a 1 if successful. If not, it is noted in an admin table.
Quote Reply
Re: [LanceWilson2] DbMan and SQL Triggers In reply to
Just so you know that I haven't gotten any email from you yet.