Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Oracle problems
Hello !!
I have an odbc application.I am connecting to an oracle8 database.
(E.g..
Right now I have a statement :
Insert into Date_tab Values(TO_DATE('1999-10-10 10:10:10',
'yyyy-mm-dd hh24:mi:ss')
if I don't use the TO_DATE fn, and give the statement as :
Insert into Date_tab Values('1999-10-10 10:10:10')
I get an error : [Oracle][ODBC][Ora]ORA-01861: literal does not match
format string.)
Is there any way round where I don't need to use TO_DATE.
I want to insert date in 'yyyy-mm-dd hh24:mi:ss' format.
4. I get an error 22275(invalid lob locator specified) while inserting
into a table having lob datatypes.
What should I do to provide support for LOB structures in my
application.
5. I have defined a Number Datatype in Oracle. When I try to fetch the Length and datatype of the Column using SQLColumn API , it returns Datatype as SQL_DECIMAL and length as 22.This is irrespective of the precision and scale specified.How can I find out the exact attributes(precision and datatype) of the NUMBER column.
I'm using :
ODBC SDK version 3.5
Oracle ODBC Driver 8.0
ODBC DRIVER 3.0
I have included the section of code where I am facing the problem.
Also It would be very helpful if you could recommend a book dealing
with ODBC and Oracle8.
Expecting an early reply,
Thanks,
Sheenu
// code
rc = SQLSetStmtOption(hstmt, SQL_ROWSET_SIZE, g_uiRowsize); if(rc == SQL_ERROR || rc == SQL_INVALID_HANDLE) { SQLFreeStmt(hstmt, SQL_CLOSE); iRetVal = FAIL; goto END; } rc = SQLGetTypeInfo(hstmt,swSQLDataType); if((rc != SQL_SUCCESS) && (rc != SQL_SUCCESS_WITH_INFO)) { switch (swSQLDataType) { case SQL_ORCL_BLOB : _tcscpy (pszTypeName,"BLOB"); iRetVal = SUCCESS; goto FREEHSTMT; break ; case SQL_ORCL_BFILE : _tcscpy (pszTypeName,"BFILE"); iRetVal = SUCCESS; goto FREEHSTMT; break ; case SQL_ORCL_CLOB : _tcscpy (pszTypeName,"CLOB"); iRetVal = SUCCESS; goto FREEHSTMT; break ; } rc = SQLError(henv,hdbc,hstmt,(ODBC_CHAR FAR *)szSqlState, (SDWORD FAR *) &nativeError,(ODBC_CHAR FAR *)szErrorMsg, cbErrorMsgMax,(SWORD FAR *) &cbErrorMsg); AfxMessageBox ((LPCTSTR) szErrorMsg); iRetVal = FAIL; goto FREEHSTMT; } rc = SQLBindCol
rc = SQLFetch(hstmt); if((rc EQ SQL_SUCCESS) || (rc EQ SQL_SUCCESS_WITH_INFO)) { _tcscpy (pszTypeName,pszTempTypeName); iRetVal = SUCCESS; goto FREEHSTMT; } else { if(rc EQ SQL_NO_DATA_FOUND) { iRetVal = SQL_NO_DATA_FOUND; goto FREEHSTMT; } }
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Nov 12 1999 - 23:31:05 CST