Kashyap Patel Guest
|
Posted: Fri Apr 22, 2005 8:45 pm Post subject: TStoredProc Connection Problem |
|
|
Hey guys, im new to this newsgroup so please bare with me if im going
against any server rules. Heres my situation:
I have set up a System DSN (called ODI) using the ODBC in control panel
using the latest Oracle ODBC driver (client version 9.2.0.1.0) for Oracle DB
9.2.0.5.0.
Now I know that I have a connection to the database (also called ODI)
because when i prepare the storedProc, i get a login dialog box and it
connects fine with the username and password i provide it.
I have two components (TStoredProc, and TDatabase) with the following
settings:
TDatabase:
AliasName: ODI
Connected: False
DatabaseName: ODI
Exclusive: false
HandleShared: false
KeepConnection: false
loginPrompt: True
Name: SDatabase
Params: (TStrings) -- No params are set
ReadOnly: false
SessionName: Default
Tag: 0
TransIsolation: tiReadCommitted
TStoredProc:
Active:false
AutoCalcFields:True
AutoRefresh:false
CachedUpdate:flase
DatabaseName:
Filter:
Filtered:false
filterOptions: None
Name: SQueryProc
ObjectView:flase
OverLoad:0
ParamBindMode:pbByNumber
Params:(TParams) -- No params are set
SesionName:
StoredProcName: hit
Tag: 0
The only values that i change from these in runtime are AliasName to macth
what the user enters in a textbox, and storedProcName to macth the name of
the stored procedure in the db. Heres the code that does the connection
stuff:
M_SQueryProc[DB]->DatabaseName = M_SDSN[DB]->Text; //m_sdsn[db] is the
textbox that contains the databaseName/AliasName
M_SDatabase[DB]->AliasName = M_SDSN[DB]->Text; //m_sdsn[db] is the textbox
that contains the databaseName/AliasName
M_SDatabase[DB]->DatabaseName = M_SDSN[DB]->Text; //m_sdsn[db] is the
textbox that contains the databaseName/AliasName
// Prepare the Query
try {
// Prepare the SQL statement to optimize
// the code and improve performance.
M_SQueryProc[DB]->Prepare();
M_SQueryProc[DB]->Open();
} catch(const EDatabaseError &E){
// now uprepare the query and set it to inactive
M_SQueryProc[DB]->Close();
M_SQueryProc[DB]->UnPrepare();
// tell the user
String ErrMsg = "There was an error in the " +
GetPage(DB)->Caption + " SQL Query. Error:" + E.Message;
if (bTimerEvent == false) {
ShowMessage(ErrMsg, mtError);
if (bGlobalInStartup == true)
LogMsg(ErrMsg, true);
} else
LogMsg(ErrMsg, true);
// retrrun control to the main app
return(false);
}
When i prepare it, im presented with a logon box and i authenticate fine.
When i try the M_SQueryProc[DB] (which btw is the TStoredProc) .open() or
..ExecProc method, I get the following error:
Error:Key violation.
[Oracle][ODBC][Ora]ORA-06550: line1, column7:
PLS-00201: identifier 'hitNone' must be declared.
ORA-06550: line1, column7:
General SQL error.
PL/SQL: Statement ignored.
By the way, in design-time, when i setup the aliasName of the Sdatabase, and
the databaseName of the tStoredProc and SDatabase, and go to select the
storedProcName, i get presented with a logon dialog box where i can logon,
and after i put in my logon info, the drop-down listbox for the
storedProcName contains the procedure name im trying to access. Im just
having trouble accessing it through code. PLEASE HELLLP@@!!!!
-=xZx=-
|
|