muliple steps oledb operation generated using sql server compact edition - c++

I am using SQL Server Compact Edition.
One of the column size of my table is more than 500.
When I am Selecting from this table I am getting this error in visual studio:
multiple steps oledb operation generated
How can I avoid this error?

This may happen when you pass an unexpected value in one of your DB operation (say you pass NULL to a non-NULL field for example).
I would expect the error message to be longer and more informative (did you truncate it ?). In the current situation, that's pretty much all we can say about it.
A quick google search gave me that link which may help.

Related

Power Bi Desktop Error Message: Each original name must belong to the set of all names

I have a query that imports two sheets from an xlsx file, combines the data, unpivots it, and does other cleanup steps. For the resulting fact table I also defined relations to 3 further dim tables.
Then I decided to refactor the query in the PowerQuery editor, including splitting the query up into 3 steps and disabling load of the the first two. (To play it safe I also stored my pbix w/o applying the steps.)
But then after a Close & Apply I got the following cryptic error message:
Something went wrong.
Each original name must belong to the set of all names.
PBIDesktop version is 2.96.701.0 64-bit (August 2021)
Searching the web I found people suggesting that the error might be related to specific PBIDesktop versions and that moving back to a previous version would solve the issue.
For me it was easier than that, though a bit mysterious:
In PowerQuery I enabled load for all sub-queries,
let it apply all my steps and the error message was gone.
Then back in PowerQuery I could disable load for the sub-queries w/o triggering the error again!
I hope that this might help someone somewhen.

Incremental refresh in Power BI

When I watch my query it shows "View native query" is enabled:
But when I try to add incremental loading it still gives me a warning:
Should I just ignore it? Every single guide I've watched and read always tell that if you can open "View native query" it means it can be folded and incremental refresh will work.
You can check whether query folding is actually happens when you refresh the report. Depending on the data source you have you can use couple of methods described here: https://youtu.be/QEFze-LdLqo.
If you use Google BigQuery (possible in other databases as well) you should also be able to see queries that were actually performed in your database.
If you have proper query folding you shouldn't have any problem with using incremental refresh. View Native Query can even be disabled, but query folding might still happen under the hood. So it always better to check what's the query in your database in any case, just to be sure.

c++ mysql_query update returns error if content is similar to existing (but no way to differentiate from normal error)

I'm trying to set up an error detection system in c++ when doing a mysql_query, to check whether the query failed and if so try again (I'm using the mysql libray for Linux). The function mysql_query returns an int which is set to zero for success, and non-zero if failed (the error numbers are available at https://dev.mysql.com/doc/refman/5.0/en/mysql-query.html).
My first problem is that mysql_query only returns 0 or 1 for me, and this would be fine until I try to update a database entry with a similar content to what's already in the database. It also returns an error for that, which is fine on the principle, but as I can't differentiate it from an normal error, my current error detection system would try to repeat the query until it stops returning an error, which never happens. You'll tell me I could check what's in the DB first and then compare it to what I try to update before doing the query, and you would be right, but the code is already very complex and adding this level of complexity on the top would take quite some time.
So I'm wondering if there is a simpler answer to that? Thanks
Like #Mat wrote just use mysql_errno() (see Mysql Docs)
It returns 0 for success or an error code for errors.
Just so you guys know where this error actually came from, if you ever have the same.
I repetitively had mysql errors 2013 and 2006 when performing queries from different threads at the same time, but only after running a certain number of requests. I tried pretty much everything explained here.
Apparently for some reason the connection crashes and I can't do much to avoid it. The only thing that worked for me is to enable automatic reconnect using mysql_options and the option MYSQL_OPT_RECONNECT. It seems like a work around, more than a real fix, but at least my program doesn't crash now!

How can an application determine a rollback?

I'm trying to determine if a transaction fails from the application. How can this be done?
Further, is it possible to determine where a transaction failed, such as particular write that violates a constraint?
In regular libpq, you would:
Test the result of a query with PQresultStatus
PQresultErrorField(thePgResult, PG_DIAG_SQLSTATE) to get the SQLSTATE
Use PQerrorMessage to get the error message for display to the user. do not rely on parsing this in your application, instead use the SQLSTATE, and the other fields in the result struct.
See connection status functions, libpq exec functions and the rest of the libpq documentation.
Related: How to get the sql state from libpq?
I have no experience with libpqxx, but I would expect it to wrap SQL errors into C++ exceptions with fields for the SQLState etc. See the getting started guide for libpqxx and the libpqxx exception classes reference.
This mailing list post and the replies in the thread will also be of interest, but be aware it's from 2007, and since then PostgreSQL has been extended to report more information in PQresult, like PG_DIAG_CONSTRAINT_NAME. No idea if libpqxx has been extended to take advantage of that, but you might be able to unwrap the exception to get an underlying PQresult if not.
There is, AFAIK, no way to get the actual value causing the issue except by showing the user the full error message. It'd be nice to change that.

Which oracle jdbc driver is my coldfusion 8 install using

I'm trying to debug a curious problem where by one coldfusion 8 instance is giving me an error (numeric or value error: character to number conversion error ORA-06512: at line 1) but with exactly the same code another coldfusion 8 instance isn't throwing the same error.
They are both on 8,0,1,195765 Enterprise, both running on Windows 2003.
I can't imagine why they might be using different drivers unfortunately I can't (without a huge faf) have them point to the same database.
I can (and have) modified the code so the error is no longer occurring, but I'm now trying to figure out what was going on.
So how do I find out what oracle jdbc driver ColdFusion is using, I found this blog post:
http://rahulnarula.blogspot.co.uk/2009/04/getting-oracle-jdbc-driver-version-info.html
But that's only returning me no driver found.
If it helps both databases are using oracle 10g and both databases appear to be set up the same way (though I haven't ruled out that there maybe something there)
You could try looking inside macromedia_drivers.jar for this file:
\macromedia\jdbc\oracle\oracle.properties
It looks like it contains the build ID for the Oracle driver.
Another approach would just be to diff macromedia-drivers.jar using beyond-compare or similar. It may not tell you what version the drivers are, but it will tell you whether they are the same.
Also, does the short, initial code block in the linked article not work? That ought to return something for the Macromedia drivers.
Barny