Activity for Oracle, ODBC, DB2-CLI Template Library

  • Wojtek123 Wojtek123 posted a comment on discussion OTL

    Hi, I have the same problem with fixed-length field CHAR[x] used in WHERE clause. Unfortunately I cannot modify SQL statement. Would it be possible to fix this in OTL? You mentioned that there is a problem with implementing this. What kind of problem is it? Maybe I could fix it if you would give me some hint how to do this?

  • gregory gregory modified a comment on discussion OTL

    Hi people OTL cuts off strings because datatype_size() returns wrong size for utf-8. 13132|OTL_NODISCARD static int datatype_size(int ftype, int maxsz, int int_type, ... 13173| default: 13174| return maxsz + 1; instead of "maxsz * 4 + 1" where 4 is max octet count per utf-8 symbol. P.S.: Couldn't fix caption.

  • gregory gregory modified a comment on discussion OTL

    Hi people OTL cuts off strings because datatype_size() sets wrong size. 13132|OTL_NODISCARD static int datatype_size(int ftype, int maxsz, int int_type, ... 13173| default: 13174| return maxsz + 1; instead of "maxsz * 4 + 1" where 4 is max octet count per utf-8 symbol.

  • gregory gregory posted a comment on discussion OTL

    Hi people OTL cuts off strings because set_max_long_size() sets wrong size. 5249| void set_max_long_size(const int amax_size) { ... 5255| long_max_size = amax_size; instead of " long_max_size = amax_size * 4;" where 4 is max octet count per utf-8 symbol.

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Jose, You can email me directly. My email address can be found on OTL Web pages. Cheers, Sergei

  • José Luiz José Luiz posted a comment on discussion OTL

    Thanks a lot, Sergei. I'll compare with my code, because is a system a lot more complex, and see if I find anything. If not, I'll try to extract my code and post it here.

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    I put together the following quick test code to test timestamp: include <iostream></iostream> using namespace std; define OTL_ORA18C include "otlv4.h" int main(int argc,char* argv[]) { try{ otl_connect db; db.rlogon("system/oracle@myora_tns"); db.direct_exec("drop table test_tab",0); db<<"create table test_tab(update_flag varchar2(1), ipodate timestamp(6), f1 CLOB, f2 CLOB) "; otl_stream o; o.open(1, "INSERT INTO test_tab VALUES( " " :UPDATEFLAG_<char<span>[3]>, " " to_timestamp(:IPODATE<char<span>[27]>,'yyyy-mm-dd...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Jose, Can you put together a self-contained code example that reproduces the problem and email it to me? I need a code example that creates a similar table and tries to insert a row into it. BTW, did you enable #define OTL_ORA_TIMESTAMP: https://otl.sourceforge.net/otl3_compile.htm#OTL_ORA_TIMESTAMP Sergei

  • José Luiz José Luiz modified a comment on discussion OTL

    I already tried, and had another error: {10}<2>ORA-01830: date format picture ends before converting entire input string Insert into XXXXX values(:UPDATEFLAG_<char<span>[3]>,to_number(:ORGPXX<double>),:ADDRTYPECODE<double>,:ISPUBLIC<double>,to_timestamp(:IPODATE<char<span>[27]>,'yyyy-mm-dd HH24:MI:SS.FF6'),:ISO2CNTRYCODE<char<span>[5]>,:LEGALNAME<varchar_long>,:ADDRLINE1<varchar_long>,:ADDRLINE2<varchar_long>,:CITY<varchar_long>,:STATEPROV<varchar_long>,:POSTALCODE<varchar_long>,to_number(:PRITRBCINDPERMID<double>),to_number(:CNTRYGEOID<double>)))</double></double></varchar_long></varchar_long></varchar_long></varchar_long></varchar_long></varchar_long></char<span></char<span></double></double></double></char<span>...

  • José Luiz José Luiz posted a comment on discussion OTL

    I already tried, and had another error: {10}<2>ORA-01830: date format picture ends before converting entire input string Insert into XXXXX values(:UPDATEFLAG_<char<span>[3]>,to_number(:ORGPXX<double>),:ADDRTYPECODE<double>,:ISPUBLIC<double>,to_timestamp(:IPODATE<char<span>[27]>,'yyyy-mm-dd HH24:MI:SS.FF6'),:ISO2CNTRYCODE<char<span>[5]>,:LEGALNAME<varchar_long>,:ADDRLINE1<varchar_long>,:ADDRLINE2<varchar_long>,:CITY<varchar_long>,:STATEPROV<varchar_long>,:POSTALCODE<varchar_long>,to_number(:PRITRBCINDPERMID<double>),to_number(:CNTRYGEOID<double>)))</double></double></varchar_long></varchar_long></varchar_long></varchar_long></varchar_long></varchar_long></char<span></char<span></double></double></double></char<span>...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Jose, I'm not sure where / what the problem is. You can always use a char[XXX] variable bind variable + a conversion function call to convert strings into timestamps for passing in timestamp values if nothing else works. It may take weeks to track down the actual issue, and it may take hours to implement a char[XXX] workaround. Sergei

  • José Luiz José Luiz posted a comment on discussion OTL

    I have a complex application that needs to insert records with TIMESTAMP(6) columns in Oracle 19c database, using OTL 4. This is an old C++ cross compiled application, on Windows and Linux. The query being executed in OTL is: Insert into XXXXXXXXX values(:UPDATEFLAG_<char<span>[3]>,to_number(:ORGXXX<double>),:ADDRTYPECODE<double>,:ISPUBLIC<double>,:IPODATE<timestamp>,:ISO2CNTRYCODE<char<span>[5]>,:LEGALNAME<varchar_long>,:ADDRLINE1<varchar_long>,:ADDRLINE2<varchar_long>,:CITY<varchar_long>,:STATEPROV<varchar_long>,:POSTALCODE<varchar_long>,to_number(:PRITRBCINDPERMID<double>),to_number(:CNTRYGEOID<double>)))</double></double></varchar_long></varchar_long></varchar_long></varchar_long></varchar_long></varchar_long></char<span></timestamp></double></double></double></char<span>...

  • zhuyu zhuyu posted a comment on discussion OTL

    Hi, I have some questions for use otl and mysql. Mysql odbc support bind params array for select statement. But when I use otl_steam to do multi select . Otl send sql statement when << , how to use flush() send multi select to mysql odbc? Mysql odbc need call SQLSetStmtAttr(SQL_ATTR_PARAMSET_SIZE) to set array_size And SQLBindParameter to bind params array. This is work in INSERT statement. Because INSERT statement execute when flush()。And first param for exec() is Params array_size。 But for SELECT...

  • Natalia Natalia posted a comment on discussion OTL

    Hi Sergei, thanks a lot for the quick response. We are actually using bulk insert now but trying to get away from file based uploads because the data that we generate is in memory and saving it to file is an unnecessary overhead. In the case of bulk insert the problem is complicated by the fact that the fs has to be mounted on both the client generating the file and the sql server, which is hard to achieve in cloud environments, bcp has its drawbacks too. Could you estimate how hard it would be to...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Natalia, I looked at that a long time ago but I found that there wasn't enough demand for it at that point in time. At this point in time I don't have "the bandwidth" (too much stuff to do at work and C++ compiler development being "agile" these days doesn't help) to implement anything as complex as bulk insert. I'd suggest you to take a closer look at bulk copy utility (BCP) or T-SQL bulk insert command. Sorry to disappoint you, Sergei

  • Natalia Natalia posted a comment on discussion OTL

    Hi, we are using OTL library for reading/writing to MSSQL Server from our C++ applications. We are looking for a way to optimize our bulk uploads (loading millions of rows in bulk). Our DBA recommended using native MSSQL bulk copy API . We would really like to use OTL rather than calling ODBC C functions directly, but I don't think OTL currently supports MSSQL bulk copy. Is it possible to add this support or is there anything we can use in OTL that will give comparable performance for bulk inserts....

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Juergen, If it works for you, why not? No actual DB APIs calls are different. I'd run some tests, because my philosophy is that when you change even a comma in the code, you need to re-run your test suites. Sergei

  • Juergen Stiebert Juergen Stiebert posted a comment on discussion OTL

    Hello Sergei, yes, I did. The compilation with the newest otlv4.h works fine in VS2019 without this issue. The problem here is, that the new version differs completely from my old one, so I would have to run excessive testing of all applications using it (we have >10.000 users/day) to avoid any regression. This is possible, but not planned or budgeted currently. Doing test I have seen, that the error can be workarounded simply replacing the line: define OTL_ANSI_CPP_11_NOEXCEPT NOEXCEPT with define...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Juergen, Did you try the latest OTL 4.0.469? OTL 4.0.360 is out of date. Sergei

  • Juergen Stiebert Juergen Stiebert posted a comment on discussion OTL

    screenshot added

  • Juergen Stiebert Juergen Stiebert posted a comment on discussion OTL

    Hello * , We are using otlv4.h version 4.0.360 for many years in C++ applications on Windows 10 and AIX with Visual Studio 2015. Moving forward now to Vs 2019 I get a compilation warning: warning STL4006: std::uncaught_exception() is deprecated in C++17 and a compilation error: error C3646: "_NOEXCEPT": Unbekannter šberschreibungsspezifizierer from the header. Is anybody facing the same issues and is there a workaround/solution available ? I did myself some investigation and found the following section...

  • Brian Smith Brian Smith modified a comment on discussion OTL

    I am not sure if this is a dumb question or not. We use OTL for a C++ application at my work and it is a single threaded application and we use OTL stream pooling with our single otl_connect. I am looking at possible changes to make it multi threaded, which means I've been looking at the OTL connection pooling examples and logic. I am not sure if the OTL stream pooling should be used at the same time as OTL connection pooling though? It seems like if I did, I'd have to set the stream pool flag to...

  • Brian Smith Brian Smith posted a comment on discussion OTL

    I am not sure if this is a dumb question or not. We use OTL for a C++ application at my work and it is a single threaded application and we use OTL stream pooling with our single otl_connect. I am looking at possible changes to make it multi threaded, which means I've been looking at the OTL connection pooling examples and logic. I am not sure if the OTL stream pooling should be used at the same time as OTL connection pooling though? It seems like if I did, I'd have to set the pool to enabled and...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Paul, No, OTL as it stands right now, doesn't support connecting to the database using Oracle Wallets. However, otl_connect class has a constructor / logon function that accept raw OCI resources allocated externally. So, you can implement an Oracle Wallet based connector / extender and use it with OTL without touching the rest of your OTL based code. Sergei

  • Paul Kirkland Paul Kirkland posted a comment on discussion OTL

    We are currently using OTL, and login to our Oracle DB using a DB user/password. We are migrating our DB to Oracle 19c, and will start using Oracle PKI and Wallet for connecting to the DB. Does OTL support this? Regards Paul Kirkland paulkirkland@bluewinc.

  • fengjia0095 fengjia0095 modified a comment on discussion OTL

    Hello, Kuchin. I want to insert some Chinese characters in mysql, I have learned your examples db.rlogon("UID=scott;PWD=tiger;DSN=mysql35;CHARSET=gb18030"); and insert the Chinese characters successful. But I cannot use the 'CHARSET=gb18030' as the login parameter, for some reason.So my login code is db.rlogon("UID=scott;PWD=tiger;DSN=mysql35"); The question is: How can i insert Chinese characters with my login code? Waiting for your reply. My email is fengjia095@163.com. Both comment here or email...

  • fengjia0095 fengjia0095 posted a comment on discussion OTL

    Hello, Kuchin. I want to insert some Chinese characters in mysql, I have learned your examples db.rlogon("UID=scott;PWD=tiger;DSN=mysql35;CHARSET=gb18030"); and insert the Chinese characters successful. But I cannot use the 'CHARSET=gb18030' as the login parameter, for some reason.So my login code is db.rlogon("UID=scott;PWD=tiger;DSN=mysql35"); The question is: How can i insert Chinese characters with my login code? Waiting for your reply.

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Maab, What C++ compiler are you using? Do you share the same connect objects between threads? Is it possible for you to put together a self-contained code example that reproduces the problem and email it to me? I've never seen this problem before, at least not with Visual C++ and MS SQL Server, and nobody else reported it (you're the first). Sergei

  • Maab Saleem Maab Saleem posted a comment on discussion OTL

    @skuchin Your kind input here would be much appreciated.

  • Maab Saleem Maab Saleem modified a comment on discussion OTL

    Hi. I am using OTL to connect with MS SQL Server using the ODBC Driver 17 for SQL Server. My application has multiple worker threads fetching connections from the connection pool, and creating new stream objects to perform select queries on the database. A worker thread has to perform multiple operations (different DBs and lookups) so the taskflow framework is being used (https://github.com/taskflow/taskflow) My problem comes when a database exception is raised. e.g. a table doesn't exist in a database....

  • Maab Saleem Maab Saleem posted a comment on discussion OTL

    Hi. I am using OTL to connect with MS SQL Server using the ODBC Driver 17 for SQL Server. My application has multiple worker threads fetching connections from the connection pool, and creating new stream objects to perform select queries on the database. A worker thread has to perform multiple operations (different DBs and lookups) so the taskflow framework is being used (https://github.com/taskflow/taskflow) My problem comes when a database exception is raised. e.g. a table doesn't exist in a database....

  • Sergei Kuchin Sergei Kuchin modified a comment on discussion OTL

    Natalia, I tried to set SQL_COPT_SS_TXN_ISOLATION connection attribute to SQL_TXN_SS_SNAPSHOT using the actual values that I found in my old sqlncli.h (from MS SQL v11). That worked. I also tried to run "SET TRANSACTION ISOLATION LEVEL SNAPSHOT" command using otl_connect::direct_exec(). That worked as well. It just seems that executing "SET TRANSACTION ISOLATION LEVEL SNAPSHOT" is the cleanest solution, and it doesn't require anything dubious (speaking of long term solutions and dependencies on old...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Natalia, I tried to set SQL_COPT_SS_TXN_ISOLATION connection attribute to SQL_TXN_SS_SNAPSHOT using the actual values that I found in my old sqlncli.h (from MS SQL v11). That worked. I also tried to run "SET TRANSACTION ISOLATION LEVEL SNAPSHOT" command using otl_connect::direct_exec(). That worked as well. It just seems that executing "SET TRANSACTION ISOLATION LEVEL SNAPSHOT" is the cleanest solution, and it doesn't require any dubious (speaking of long term solutions and dependencies on old header...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Natalia, I can see sqlncli.h file only in the SDK for SQL Server version 11, which is pretty old (MS SQL 2012, maybe?). I'll try to use the same values as the corresponding #define have to see what happens. Sergei

  • Natalia Natalia posted a comment on discussion OTL

    Hi Sergei, Thank you so much for looking into that. I did some digging in Microsoft docs. According to it "SQLSetConnectAttr function now supports the use of the SQL_COPT_SS_TXN_ISOLATION attribute. Setting SQL_COPT_SS_TXN_ISOLATION to SQL_TXN_SS_SNAPSHOT indicates that the transaction will take place under the snapshot isolation level ". Those definitions seem to be driver specific. "The SQL Server Native Client ODBC driver supports a number of driver-specific extensions to ODBC connection attributes...

  • Natalia Natalia posted a comment on discussion OTL

    Hi Sergei, Thank you so much for looking into that. I did some digging in Microsoft docs. According to it "SQLSetConnectAttr function now supports the use of the SQL_COPT_SS_TXN_ISOLATION attribute. Setting SQL_COPT_SS_TXN_ISOLATION to SQL_TXN_SS_SNAPSHOT indicates that the transaction will take place under the snapshot isolation level ". Those definitions seem to be driver specific. "The SQL Server Native Client ODBC driver supports a number of driver-specific extensions to ODBC connection attributes...

  • Michael Michael modified a comment on discussion OTL

    Hi Sergei, today I had time to return to the issue (after working around it in the projec) and stepped through OTL to get an idea what is going wrong. I then stumbled over the #define OTL_ODBC_STRING_TO_TIMESTAMP and voila, this does the trick for me for selecting an MS SQL datetime2 into an otl_datime. I am not sure why it worked before, since the only thing I did (to best of my knowledge) is updating Windows 10, SQL Server, OTL drivers and so on. But maybe this might also happen to other, so I...

  • Michael Michael posted a comment on discussion OTL

    Hi Sergei, today I had time to return to the project (after working around it in the projec) and stepped through OTL to get an idea what is going wrong. I then stumbled over the #define OTL_ODBC_STRING_TO_TIMESTAMP and voila, this does the trick for me for selecting an MS SQL datetime2 into an otl_datime. I am not sure why it worked before, since the only thing I did (to best of my knowledge) is updating Windows 10, SQL Server, OTL drivers and so on. But maybe this might also happen to other, so...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    There are also table hints: https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver15 Sergei

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Natalia, It doesn't look like ODBC supports it. Take a look at your sql.h. I don't see a #define that points to "SNAPSHOT". Here's #defines in my sql.h in Visual Studio 2019: SQL_TXN_READ_UNCOMMITTED (1), SQL_TXN_READ_COMMITTED (2), SQL_TXN_REPEATABLE_READ (4), SQL_TXN_SERIALIZABLE (8), SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_READ_COMMITTED, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_SERIALIZABLE. According to this, "snapshot" isolation level may be 32: SQL_TXN_READ_UNCOMMITTED 1...

  • Natalia Natalia posted a comment on discussion OTL

    Hi, we use OTL with SQL Server and it has isolation type called "snapshot" https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-ver15 Looks like OTL doesn't support this level, is it easy to add? Thanks, Natalia

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Mike, It would useful if you can put together a self-conatained code example that reproduces the problem and email it to me (skuchin@gmail.com). It's hard to say what's wrong. If I can reproduces on my system, I should be able to say what's wrong and how to fix it. Sergei

  • Michael Michael modified a comment on discussion OTL

    Hi Sergei, you are right, ODBC driver versions (accordng to the Data Sources dialogue) are 11/13/17, not sure where I found the 10.x last time. (I tried to #define OTL_ODBC instead anyway, without success.) I am running SQL Server 13.0.5102. The screenshot ist from SQL Mngmt Studio 18.5.1. Thank you, Michael

  • Michael Michael posted a comment on discussion OTL

    Hi Sergei, you are right, ODBC driver version (accordng to the Data Sources dialogue) are 11/13/17, not sure where I found the 10.x last time. (I tried #define OTL_ODBC instead anyway, without success.) I am running SQL Server 13.0.5102. The screenshot ist from SQL Mngmt Studio 18.5.1. Thank you, Michael

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Michael, What ODBC driver against what version of SQL Server are you using. I expect you'd be using one of these ODBC drivers: ODBC Driver 11/13/17 of SQL Server. If you're supposed to use only he ODBC driver you mentioned in your post, you can try to switch from #define OTL_ODBC_MSSQL_2008 to generic #define OTL_ODBC. Sergei

  • Michael Michael posted a comment on discussion OTL

    Hi, I have a problem reading a timestamp into a otl_datetime variable. Attached my OTL include configuration, a screenshot of the DB table accessed and a screenshot of the code fragment (including the exception). I guess it's something simple, as always, but after spending a day looking at it without success I am ready for asking you for help ;) I think (!) the same code worked about 1-2 years ago but does not work now. (I meanwhile installed "all" Windows, VS, SQL, OTL updates). This is my setup:...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Optimus, You can read the OTL manual in order to learn how to do things: click on "Table of Contents", you'll find code examples there, how to build an executable, etc. I read your second posting. If you want to use "Oracle only", why don't you try what Oracle natively supports. It's called OCCI. It's a "C++ OCI". Cheers, Sergei Kuchin

  • Optimus1 Optimus1 posted a comment on discussion OTL

    Better to use OCILIB for Oracle.

  • Optimus1 Optimus1 posted a comment on discussion OTL

    Hello, I downloaded the header file from otlv4.h and I absolutely do not understand what to do next? Maybe there are at least examples? For example, how do I get connected to Oracle? Honestly, I don’t understand something at all. I did not find examples on the author’s site :(

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    I'll make the change to OTL in the meantime to remove the call to std::uncaught_exception() in flush() when OTL_DESTRUCTORS_DO_NOT_THROW is enabled. I'll publish it as OTl 4.0.456. Check for updates. On Tue, Jun 2, 2020 at 9:04 AM Ahsan Baig mmajbaig@users.sourceforge.net wrote: Hmm. Ok. So we'll try using the OTL_DESTRUCTORS_DO_NOT_THROW flag and remove the call to std::uncaught_exception and will let you know if it does resolve our issue. However, it may take around a week or more for us to know...

  • Ahsan Baig Ahsan Baig posted a comment on discussion OTL

    Hmm. Ok. So we'll try using the OTL_DESTRUCTORS_DO_NOT_THROW flag and remove the call to std::uncaught_exception and will let you know if it does resolve our issue. However, it may take around a week or more for us to know the outcome. Thanks for your time Sergei. Will get back to you. Ahsan

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    But the destructor of otl_tmpl_out_stream also sets the in_destruct_flag to 1 which is checked inside the flush function. So that case is already handled. Correct me if I'm wrong. Thanks. in_destruct_flag is only useful if another otl_exception is in progress. If an exception of another type is in flight then the call to std::uncaught_exception() is the only way to determine stack unwinding. On Tue, Jun 2, 2020 at 8:53 AM Ahsan Baig mmajbaig@users.sourceforge.net wrote: But the destructor of otl_tmpl_out_stream...

  • Ahsan Baig Ahsan Baig posted a comment on discussion OTL

    We can give a go to OTL_DESTRUCTORS_DO_NOT_THROW as well.

  • Ahsan Baig Ahsan Baig posted a comment on discussion OTL

    But the destructor of otl_tmpl_out_stream also sets the in_destruct_flag to 1 which is checked inside the flush function. So that case is already handled. Correct me if I'm wrong. Thanks.

  • Ahsan Baig Ahsan Baig posted a comment on discussion OTL

    But the destructor of otl_tmpl_out_stream also sets the in_destruct_flag to 1 which is checked inside the flush function. So that case is already handled. Correct me if I'm wrong. Thanks.

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    I guess it's safe to remove the call to std::uncaught_exception() in flush() if you use #define OTL_DESTRUCTORS_DO_NOT_THROW. So, question for you: if you can do that in you code base, I can add OTL_DESTRUCTORS_DO_NOT_THROW based conditionally compiled logic to flush(). On Tue, Jun 2, 2020 at 8:41 AM Sergei Kuchin skuchin@users.sourceforge.net wrote: I'll take a closer look at the traces. To answer your why question about the reason of calling std::uncaught_exception the intent was to determine the...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    I'll take a closer look at the traces. To answer your why question about the reason of calling std::uncaught_exception the intent was to determine the stack unwinding situation. flush() may be called from the stream destructor if the stream buffer is not clean, which may throw another exception in case of a database error and trigger a call to std::terminate(). If you have any suggestions on how the stack unwinding can be determined in a safer way I should be able to implement that. Your situation...

  • Ahsan Baig Ahsan Baig posted a comment on discussion OTL

    Hi Sergei, Thanks for getting in touch. Actually our build system is quite old. We are using GCC version 4.7.2 with C++11. We do not have any resource that says particularly about the thread safety of std::uncaught_exception on Solaris OS but there are other resources like this https://cplusplus.github.io/LWG/issue1368 that indicate that this can be an issue. Also why we think that it can be an issue due to an exception in some other thread is because the OTL library doesn't return any exception...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Ahsan, Are you using Sun C++? Do you have a reference to a resource (discussion group, manual, etc.) that says anything about std::uncaught_exception() being thread unsafe on Solaris? OTL has been in existence for a long time and nobody reported this problem before. If your version of C++ supports C++17, you can try to enable OTL_CPP_17_ON and see if it makes any difference. It uses std::uncaught_exceptions(). Sergei On Tue, Jun 2, 2020 at 3:23 AM Ahsan Baig mmajbaig@users.sourceforge.net wrote:...

  • Ahsan Baig Ahsan Baig posted a comment on discussion OTL

    Hi, We are using the latest OTL version (v4.0.455) on a Solaris OS (v10). We are using the OTL library to connect with an Oracle server ORA11GR2 and have been able to perform select and procedure calls. However, on our production machines, the procedure call randomly fails and doesn't send the call to the Oracle server. On enabling logging inside the OTL library and adding more log lines we were able to narrow down the issue and what we observed was that the otl_tmpl_out_stream::flush function was...

  • jayraj dani jayraj dani posted a comment on discussion OTL

    Does OTL 2.0 have the support to connect PosthresSQL database ? if yes then could you give and example and if no then thrigh which OTL version i can connect to PostgresSQL database and how?

  • vijay sarathi vijay sarathi posted a comment on discussion Help

    I am using Oracle 18C( SQL*Plus: Release 18.0.0.0.0 - Production on Tue Jan 28 02:44:17 2020 Version 18.8.0.0.0 ) I found this strange issue when I tried to use OTL in C++ I have a query which uses "with" clause of oracle like below: with FUNCTION SELECT QUERY with one bind variable When I execute this "with cluase" query in plsql developer, it executes smoothly. But when I put the same query in otl_stream and with a bind variable: It throws me an error: ORA-00600: internal error code, arguments:...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Will do.

  • Wolfgang Stöggl Wolfgang Stöggl posted a comment on discussion OTL

    Dear Sergei, could you please also provide the current version of OTL each time with the version in the filename? In addition to the file http://otl.sourceforge.net/otlv4_h2.zip Currently this should be: http://otl.sourceforge.net/otlv4_40451.zip Thanks and best regards Wolfgang

  • Stefano Sinigardi Stefano Sinigardi posted a comment on discussion OTL

    Dear Sergei, thank you very much for the prompt and quick action. Not having the latest release with an unambiguous link means that we will be targeting maximum last version -1, but at least the situation now is much much better than before. In case you want to add also another copy of the 449 release on your server with a specific link, something like http://otl.sourceforge.net/otlv4_40449.zip, then we could also target your latest release. Thank you very much in any case, you really heped us very...

  • Sergei Kuchin Sergei Kuchin modified a comment on discussion OTL

    Stefano, I just uploaded what you need. Check out What's New page. Cheers, Sergei

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Stefano, I just uploaded what you. Check out What's New page. Cheers, Sergei

  • Stefano Sinigardi Stefano Sinigardi posted a comment on discussion OTL

    There is no need to keep a big list of older releases available. vLatest -> vLatest-5 seems very reasonable. I understand your point of view but I want to explain better mine: if the package manager works starting from the sources, like the one i am working on, we keep a reference of the sources to download and a hash of the archive, to verify validity of the download whenever a user requires installation of the package. Then there is a recipe describing how to build sources on the computer and how...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Stefano, Here's an example of fast pace development (https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes): What's New in Visual Studio 2019 Visual Studio 2019 Releases November 12, 2019 — Visual Studio 2019 version 16.3.9New release icon November 5, 2019 — Visual Studio 2019 version 16.3.8 October 29, 2019 — Visual Studio 2019 version 16.3.7 October 22, 2019 — Visual Studio 2019 version 16.3.6 October 15, 2019 — Visual Studio 2019 version 16.3.5 October 10, 2019 — Visual Studio...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Hi Stefano, How many versions back from the latest OTL do you need to go? OTL only changes as fast as C++ compilers release new versions with breaking changes. I can't afford supporting more than one version of OTL these days. Let's say, your package that you're working on has OTL v-5 from the latest. It means that by the time you release your package, there are C++ compilers in the wild that OTL v-5 doesn't cover. I'm not sure sure if it's better if you simply took the latest OTL of the time of...

  • Stefano Sinigardi Stefano Sinigardi posted a comment on discussion OTL

    Dear Sergei, first of all thank you very much for your work on OTL, a great project. I'd also like to ask you if it's possible to add a secondary link to the OTL sources zip, one that is stable and identifies univocally one version. This would be awesome for people like me working on package managers, in order to be able to download exactly one explicit version and that one only, without fearing of having an updated library in the middle of the work. It might strange to you, and i also like updates,...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Stephan, Can you try OTL code example 682 (http://otl.sourceforge.net/otl4_ex682.htm) in your envorrinment to see if you get the following output: f1=1, f2=23:12:12.1234567 f1=2, f2=23:12:12.1234567 f1=3, f2=23:12:12.1234567 f1=4, f2=23:12:12.1234567 f1=5, f2=23:12:12.1234567 f1=6, f2=23:12:12.1234567 f1=7, f2=23:12:12.1234567 f1=8, f2=23:12:12.1234567 f1=9, f2=23:12:12.1234567 f1=10, f2=23:12:12.1234567 If it's not what you expect, feel free to email me at skuchin@gmail.com with more detail. Ideally,...

  • Stephan Schmidt Stephan Schmidt posted a comment on discussion OTL

    Hi folks, I can not find a way to insert a time-value into table (MSSQL) that has a 'time(7)' column. I'm getting a 'Invalid date format'-exception. According to 'Declaration of bind variables' there is on 'timestamp' as a placeholder available (which I'm using). If I take this column out of the insert statement (and the table of course) everything works. I can, however, insert it in a string format ... but I suppose that is not the 'proper' way :) Best regards and thanks for the tremendous work...

  • Joshua Nocturne Joshua Nocturne posted a comment on discussion OTL

    I just realized that I should link unix-odbc library instead of oracle-odbc driver library. The problem has been solved.

  • Joshua Nocturne Joshua Nocturne posted a comment on discussion OTL

    For some reasons i need to use odbc to connect oracle on linux. So i got oracle-odbc driver from oracle official website. Then i compile my otl test code and then i got link error like this: undefined reference to SQLSetConnectAttr undefined reference to SQLConnect ... I use nm to check the driver lib symbols then i find there is only unicode api like 'SQLConnectW' in lib file. So how can i fix this problem cause i couldn't find any odbc lib file that contain odbc api like 'SQLConnect' on oracle...

  • ilanbe ilanbe posted a comment on discussion OTL

    Hi Sergei, Thank you for pointing me in the right direction, this indeed solve the issue. For future reference, this is the odbcinst.ini : [PostgreSQL] Description = ODBC for PostgreSQL Driver = /usr/lib/psqlodbc.so Setup = /usr/lib/libodbcpsqlS.so Driver64 = /usr/pgsql-9.3/lib/psqlodbc.so Setup64 = /usr/lib64/libodbcpsqlS.so FileUsage = 1 MaxVarcharSize = 1024 MaxLongVarcharSize = 8190

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Allen, In Windows, ODBC Driver for PostrgeSQL has "DataSource" / Advanced Options dialog, which has Max Varchar entry field, which is by default 255. Fox Linux, PostgreSQL ODBC driver must have a similar parameter that can be added to one of .ini ODBC files (odbcinst.ini / odbc.ini). I've not looked myself but it should be easy enough to find the manual of PostgreSQL ODBC driver for Linux with examples. I Cheers, Sergei

  • ilanbe ilanbe posted a comment on discussion OTL

    This the table definition I use create table test_tab(f1 int, f2 varchar(250), f3 varchar(512)) and that the results I get from columns description ========== COLUMN #1 =========== name=f1 dbtype=4 otl_var_dbtype=4 dbsize=10 scale=0 prec=10 nullok=1 ========== COLUMN #2 =========== name=f2 dbtype=12 otl_var_dbtype=1 dbsize=250 scale=0 prec=250 nullok=1 ========== COLUMN #3 =========== name=f3 dbtype=-1 otl_var_dbtype=9 dbsize=512 scale=0 prec=512 nullok=1 f1=8, f2=Name8, f3=Incompatible data types...

  • ilanbe ilanbe posted a comment on discussion OTL

    Hi, I working on Linux 64, postgres. OTL_ODBC_UNIX & OTL_ODBC_POSTGRESQL are defined. working with varchar column with size of 256 and larger cause a "Incompatible data types" error. I replicated the error by using example ex140_odbc.cpp and changing the f2 column (and corosponding definitions) to any size above 256. the srelust id the following error : "Incompatible data types in stream operation select * from test_tab where f1>=? and f1<=? *2 Column: 2<VARCHAR LONG>, datatype in operator <</>>:...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Good question. Relational databases are not "sexy" any more, they are legacy things. Everything is moving fast (a.k.a. agile) these days, too much time goes into just keeping up with all of the releases of C++ compilers (GNU C++, CLANG, Visual C++). If somebody contributes good enough quality code like it happened with support for geometry for Oracle, I'd be happy to integrate that to OTL. Cheers, Sergei

  • WILLEE WILLEE posted a comment on discussion OTL

    Hello, Sergey. When connecting via ODBC to MSSQL Server and try to make query for table which contains one of the folowing datatypes: hierarchyid, geography, geometry, sql_variant, OTL throws an exception: Unsupported column data type select * from dbo.test Column: 1 / hierarchyid_colName <unknown> Unsupported column data type select * from dbo.test Column: 1 / geography_colName <unknown> Unsupported column data type select * from dbo.test Column: 1 / geometry_colName <unknown> Unsupported column...

  • park park modified a comment on discussion OTL

  • park park modified a comment on discussion OTL

  • park park posted a comment on discussion OTL

    does OTL support auto binding ref cursor when you exec sp ?

  • park park posted a comment on discussion OTL

    does OTL support auto binding ref cursor when you exec sp ?

  • park park posted a comment on discussion OTL

    I have procedure looks like this proc_name(refcur<out>, char<in>, errocode<out>); It is possible to call just procedure like examples shown in website but I have problem with calling procedure with implicit way.</out></in></out> The procedure that I trying to ues is not made of simple "select" query and I want to call procedure without putting refcur <out> parameter like this (proc_name(char<in>, errocode<out>) because some of my procedures do not take refcur<out> parameter and return values.</out></out></in></out>...

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Zach, Can you put together a self-contained code example of you're trying to do and email it to me at skuchin at gmail dot com? What I need is a stored procedure with th exact same set of parameters as your original SP, no need for the business logic, maybe a few rows in the result set, which you can hard code / insert into your simulated table. I'm not sure how well recent ODBC drivers for MS SQL Server (I assume that's what you're using since Sybase is too far gone) support named parameters for...

  • Name Name modified a comment on discussion OTL

    I've been looking through the forum as well as google and I'm kind of hitting a road block. I have a stored procedure that I'm trying to run via OTL but I want to specify what parameters I'm passing to it. There are more than three parameters in this stored procedure but I only need it to run with these three. MSSQL I have no problem running it with this in management studio: exec dbo.sp_test @testa = 'one', @testb = 'two', @testc = 1 Currently what I'm calling: {call dbo.sp_test (:testA<char[1000],in>,...

  • Name Name modified a comment on discussion OTL

    I've been looking through the forum as well as google and I'm kind of hitting a road block. I have a stored procedure that I'm trying to run via OTL but I want to specify what parameters I'm passing to it. There are more than three parameters in this stored procedure but I only need it to run with these three. I have no problem running it with this: exec dbo.sp_test @testa = 'one', @testb = 'two', @testc = 1 Currently what I'm calling: {call dbo.sp_test (:testA<char[1000],in>, :testb<char[1000],in>,...

  • Name Name modified a comment on discussion OTL

    I've been looking through the forum as well as google and I'm kind of hitting a road block. I have a stored procedure that I'm trying to run via OTL but I want to specify what parameters I'm passing to it. There are more than three parameters in this stored procedure but I only need it to run with these three. I have no problem running it with this: exec dbo.sp_test @testa = 'one', @testb = 'two', @testc = 1 Currently what I'm calling: {call dbo.sp_test (:testA<char[1000],in>, :testb<char[1000],in>,...

  • Name Name posted a comment on discussion OTL

    I've been looking through the forum as well as google and I'm kind of hitting a road block. I have a stored procedure that I'm trying to run via OTL but I want to specify what parameters I'm passing to it. There are more than three parameters in this stored procedure but I only need it to run with these three. I have no problem running it with this: exec dbo.sp_test @testa = 'one', @testb = 'two', @testc = 1 Currently what I'm calling: {call dbo.sp_test (:testA<char<span>[1000],in>, :testb<char<span>[1000],in>,...

  • Michael Lindner Michael Lindner posted a comment on discussion OTL

    It would be nice to have a function that returned whether or not you were at the end of the row. Yes, I know I can call check_end_of_row(), catch the exception and return true/false, but that is pretty heavy for what should be a simple operation...

  • Natalia Natalia posted a comment on discussion OTL

    Good idea. Hopefully it will save hours of debugging to the next person who stumbles upon this issue :)

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Isn't that something? I'll add the reference to the OTL F.A.Q.

  • Natalia Natalia posted a comment on discussion OTL

    Thanks a lot, Sergei. Armed with your explanation, I checked SQLite ODBC documentation and found that there is a flag "BigInt" that can be set on the connection level. Adding this flag resolved the issue. I am adding the reference here in case anyone else has similar issues http://ch-werner.de/sqliteodbc/html/index.html Thanks again for the help!

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    It would be a "compile time patch" enabled by a #define. Not sure if you're talking about dynamically identifying what type of database you're connecting to. If you have "database drivers" that are built with different OTL #defines, in that case you'll have to add the new #define to enable the patch. The patch would literally map "database ints" to C++ "bigints" (8-bytes). Question: do you use #define OTL_ODBC_MSSQL_2008 for SQL Server, or just plain vanilla #define OTL_ODBC for all database typ...

  • Natalia Natalia posted a comment on discussion OTL

    Thank you for offering to provide the patch. I'd like to understand the scope first- will setting this conditional "ODBC int" macro affect the size of integers returned by other DB drivers as well or can it be limited specifically to the SQLite? I use SQL Server, Vertica and SQLite databases in the same code and I don't want to change the way my SQL Server and Vertica integers are processed. If this macro can be limited to SQLite integers specifically, that patch would really solve my problem.

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    The ODBC driver is doing it wrong. It needs to report an 8-byte int as an "ODBC big int", not as an "ODBC int", which is 4-bytes long. It may be similar to the old debate "is ODBC long int 4-bytes or 8-bytes". I can add a conditionally compiled patch (enabled with a #define) to OTL to map "ODBC int" to "ODBC big int", if that helps.

  • Natalia Natalia posted a comment on discussion OTL

    According to the SQLite documentation, "... as soon as INTEGER values are read off of disk and into memory for processing, they are converted to the most general datatype (8-byte signed integer)" http://www.sqlite.org/datatype3.html Just to clarify - you are able to reproduce the issue on your end, correct? I just want to understand if something is wrong with my specific build of odbc driver or sqlite odbc driver in general.

  • Sergei Kuchin Sergei Kuchin posted a comment on discussion OTL

    Something isn't right in the ODBC driver. dbtype of 4 is an int the way the driver reports the column data type and it's a signed 4-byte integer. Yet, when OTL binds an array of ints on the C++ side, the driver returns bad integer values. When the "long" override is used, everything works correctly. "long" is a signed 8-byte whole number in 64-bit Linux. "bigint" is also a signed 8-byte whole number, that's perhaps why it works in 64-bit Windows. I wonder if "int" means an signed 8-byte integer in...

1 >