|
|
Choosing A Webhost: |
RE: ODBC RPC: msg#00148db.tds.freetds
Actually, I tried with both, SQLGetDiacRec and SQLError, both give nothing. Here is a snippet I use to set datetime param and call to check diagrecs (note that I have tried several variations of C_ types and SQL types, and several handles for getting the diag recs; and have tried index rec of 1 and 0 (1 gives -2, 0 gives -1 rc). DATE_STRUCT dt; SQLINTEGER cbdt; cbdt=sizeof(dt); dt.day=25; dt.year=1966; dt.month=1; Result = SQLPrepare( hStatement, (SQLCHAR*)"{?=call spDateTest(?)}", strlen("{?=call spDateText(?)}") ); SQLBindParameter( hStatement, 1, SQL_PARAM_OUTPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, &ReturnCode, 0, &cbReturnCode ); SQLBindParameter( hStatement, 2, SQL_PARAM_INPUT, SQL_C_TYPE_DATE, SQL_TYPE_DATE, 10, 0, &dt, 0, &cbdt ); Result = SQLExecute( hStatement ); cout << "SpDateTest Output:" << endl; cout << " Result = " << Result << endl; cout << " Return Code = " << ReturnCode << endl; if (ReturnCode!=1) { SQLCHAR SqlState[6]; SQLINTEGER NativeError; SQLCHAR MessageText[1000]; SQLSMALLINT TextLength; Result = SQLGetDiagRec( // SQL_HANDLE_STMT, // hStatement, SQL_HANDLE_DBC, hConnection, // SQL_HANDLE_ENV, // hEnvironment, 0, SqlState, &NativeError, MessageText, 1000, &TextLength); cout << "Result=" << Result << " DIAG REC 1: State=" << SqlState << " Error=" << NativeError << "" << MessageText << endl; } Thomas Rogers System Engineer Concurrent Computer Corporation phone: 215.712.7422 x7261 mailto:tomr@xxxxxxxx -----Original Message----- From: ZIGLIO Frediano [mailto:Frediano.Ziglio@xxxxxxxxxxxx] Sent: Thursday, August 07, 2003 3:59 AM To: Rogers, Tom Cc: freetds@xxxxxxxxxxxxxxxxx Subject: RE: [freetds] ODBC RPC > > Thanks for the help. > > Some status with last nights build regarding RAISERROR: I > seem to get the > errors/diag recs that SQL generates when I do something bad > (say like SELECT > from a table that does not exist) but not those that I > explicitly call in my > Stored Procs. You should see the same thing...just put the stmt: > RAISERROR('HELLO WORLD', 11, 1) > in an SP. You never seem to get it. However, but the > statement: SELECT > foo FROM bar > in and SP and sure enough, you get that error. > > The errors get raised just fine in regular ODBC using MS SQL > driver (I have > some common code that uses UNIXODBC/FreeTDS on Linux, or > builds on WinNT to > use MS OBDC). I get different results...the Linux version > using FreeTDS > loses the RAISERROR, the WinNT ver gets it. > > I have included the dump.txt. I am calling the stored > spTestProc, which > calls RAISERROR returning the text: "An error was > encountered." I see the > error text in the dump, just not available through ODBC API > when I call > SQLError (it gives -2, invalid handle). > Oh... you are using SQLError, I'll try with it (usually I use SQLGetDiagRec). > <<dump.txt>> > Also... how in the heck do I bind and send DATETIME variables > to an SP. > That doesn't seem to work via SQLBindParameter using SQL_C_DATE. Any > advice? > No, can you post a small test ? bye freddy77
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Question about libtds and 'delete from', James Vanns |
|---|---|
| Next by Date: | Re: Does SQLBindParameter work with SQLExecDirect, David Fraser |
| Previous by Thread: | RE: ODBC RPC, ZIGLIO Frediano |
| Next by Thread: | RE: ODBC RPC, ZIGLIO Frediano |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |