Link to home
Start Free TrialLog in
Avatar of Moiz Saifuddin
Moiz Saifuddin

asked on

VB error

I am using VB.NET and a WebApp

Any one know what a trigger is, related to an Sql query

Ssql = "BEGIN Pack_Utility.Proc_Login('PATIENT', 'PATIENT', '" & Session("sClientSerialNo") & "'); END;"


This query exexutes and fetches a Id known as a PracId which exists in a DataGrid....but the funny thing is if I leave the website Idle for a while the code gives me error and the trigger does not execute,

ORA-01400: cannot insert NULL into ("SOURCE_DEV"."AUDITLOG"."PRACID") ORA-06512: at
"SOURCE_DEV.TAU_AUDIT_SCHEDAPPOINTMENTS", line 20 ORA-04088: error during execution of trigger
'SOURCE_DEV.TAU_AUDIT_SCHEDAPPOINTMENTS'

Avatar of mgroyal
mgroyal

A trigger is a defined PL/SQL-Code in the oracle-db itself which execute a specific action for an appropriate event.

It looks like that you enter a record without filling the primary key.
SOURCE_DEV"."AUDITLOG"."PRACID" = Primary Key (can't be null)

Remove the primary key for testing purposes...

Cheers *mg

before calling
Ssql = "BEGIN Pack_Utility.Proc_Login('PATIENT', 'PATIENT', '" & Session("sClientSerialNo") & "'); END;"
check if session is expired or not by adding condition like
if Session("sClientSerialNo") <> "" then

if session is expired you can redirect the users to login page or whatever the start page of your application.
solved?
Avatar of Moiz Saifuddin

ASKER

It took me a while to understand what I asked as a question, but yea its solved so basically it wasnt the primary key that was null when I left it idle nor it was anything to do with the session expiring, the problem was in the Connection params I passed through the code, everytime the query was executed the connection params would close and open and close.....so I put opened the connection once for the execution of all the queries in the Page_Load event.



i object for delete,

see the following  question, asked after this question and there he was asking how to redirect to another page when page expires, it implies he has taken input from the responses in this question and asked another question. now trying to delete both the questions.
https://www.experts-exchange.com/questions/20796139/Redirect-a-User-when-the-Session-Expires.html
well yu know yur answer did not help me however yu want to put it....and also i mentioned how to fix the error, other than that i dont know how to help yu

ORA-01400: cannot insert NULL into ("SOURCE_DEV"."AUDITLOG"."PRACID") ORA-06512: at
"SOURCE_DEV.TAU_AUDIT_SCHEDAPPOINTMENTS", line 20 ORA-04088: error during execution of trigger
'SOURCE_DEV.TAU_AUDIT_SCHEDAPPOINTMENTS'

i think the above error is not a result of connection problem. connection is proper and when executing the trigger it was trying to insert null into not null fields.
There was a open and close connection params that i had to place, some sort of wierd error but wasnt due to the null val of the primary key, other than this i dont know how to explain....

ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial