From: Hauser, K. <Kar...@ib...> - 2009-01-20 17:15:10
|
I've tried to create the same scenario with a connection from oracle to mysql. By applying the statement: ------------ DECLARE l_nNR NUMBER := 1; l_strPuffer VARCHAR2(2000); begin SELECT "first_name" INTO l_strPuffer FROM EMPLOYEE@myodbc WHERE "employee_id" = l_nNR; end; ---------- which forces the ODBC-Driver (or Oracle.. I don't know) to use bindings I got the following trace-part: ---------- dg4odbcMYODBC ( 12ac-f20 EXIT SQLPrepare with return code 0 (SQL_SUCCESS) HSTMT 01B51960 UCHAR * 0x01E169F4 [ 66] "SELECT A1.`first_name` FROM `EMPLOYEE` A1 WHERE A1.`employee_id`=?" SDWORD 66 dg4odbcMYODBC ( 12ac-f20 ENTER SQLNumResultCols HSTMT 01B51960 SWORD * 0x01E002E8 dg4odbcMYODBC ( 12ac-f20 EXIT SQLNumResultCols with return code 0 (SQL_SUCCESS) HSTMT 01B51960 SWORD * 0x01E002E8 (1) dg4odbcMYODBC ( 12ac-f20 ENTER SQLBindParameter HSTMT 01B51960 UWORD 1 SWORD 1 <SQL_PARAM_INPUT> SWORD 1 <SQL_C_CHAR> SWORD 3 <SQL_DECIMAL> SQLULEN 1 SWORD 0 PTR 0x01E16830 SQLLEN 65 SQLLEN * 0x01E0F2E8 ---------- You see, that oracle here also detects the col-type SQL_C_CHAR, whereas the original type of the column is numeric. The statement delivers the correct solution.. I've tried several things with the sources of the ODBC Driver (static replacing SQL_C_CHAR with SQL_C_DOUBLE as a simple test-> not working.. firebird says: no data found). Is there any documentation over the code of the ODBC Driver? I would know where Oracle jumps into the code.. SQLColAttribute? I found that other functions like this are traced, so I think that Oracle use another function. -----Ursprüngliche Nachricht----- Von: Alexander Potapchenko [mailto:ale...@re...] Gesendet: Donnerstag, 15. Januar 2009 01:12 An: fir...@li... Betreff: Re: [Firebird-odbc-devel] selecting from Oracle 11g to firebird Nikolay Samofatov wrote: > Alexander, > > Oracle is not quite easy when it comes to numeric data types. Native > numeric in Oracle has 38 decimal digits, and as such can not always be > represented as SQL_INTEGER. > Can you take an Oracle instance, and see what is going on when using > Firebird ODBC driver in the way described? This way we may let the users > from bank's IT department use our Firebird data warehousing databases > from their Oracle environment. > Yes, SQL_DOUBLE is a correctly data type in a general case for numeric. The main question is how Oracle detects parameters type for ODBC functions such as SQLBindParameter, SQLBindCol... I think it must call SQLColAttribute for this. I did not try to use Firebird ODBC driver in Oracle as yet. Alexander -- Alexander Potapchenko Senior developer ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Firebird-odbc-devel mailing list Fir...@li... https://lists.sourceforge.net/lists/listinfo/firebird-odbc-devel ------------------------------------------------------------------------------------------------------------ IBYKUS AG für Informationstechnologie, Erfurt / HRB 108616 - D-Jena / Vorstand: Helmut C. Henkel, Dr. Lutz Richter / Vorsitzender des Aufsichtsrates: Dr. Frieder Schäuble |