StackOverflow is a collaborative programming Q&A community venture
Note: The content of this blog is the opinion and thoughts of the blogger and does not necessarily represent the opinions of IDUG.
DB2 decimal fields come back as negative DBTYPE_NUMERIC from OLEDB
Using OLEDB from C++ I get DBTYPE_NUMERIC from DB2 for decimal fields and convert to DECIMAL like so (error checking omitted):
What I don't understand is why DB_NUMERIC::sign coming back as 1 for positive decimal fields in DB2 and 0 for negative. Is this correct behavior? By definition here it's the opposite for DECIMAL - 0 should be for positive.Is it a db/field setting? In database everything looks positive. And if I set a value in db as negative it comes back positive. So the sign is turned on in the returning DB_NUMERIC structure for positives and turned off for negative. It's a reverse/inverse of what seems to be expected. What's wrong?BTW: I can't find any docs on DB_NUMERIC that is in oledb.h anywhere.Please help. Thanks a lot in advance!
How to check all user abends with single if condition in JCL
How to check all user abend codes using single if condition in JCL?
Explanation: My job is abending with different user abends
Currently I am checking like this
It is checking for only return code, but I need to check user abends also.
Why does my query generate an "undefined name" error with SQLCODE -204?
This is a SQL Server query
but it would not run in DB2, giving an error message:
How can I inserting a string with a single quote in it into a DB2 table?
I'm using a DB2 database.
How to insert
where the name has a
DB2 cannot delete or update rows after insert
i am facing the following issue:
I have some n:m entities in my spring application with DB2 behind. Lets say they are mapped via the tables APPLE, WORM and APPLE_WORMS.
I ran a generic SQL script to insert some worms, like that:
Back to the application everything seems to be at its place. All the apples got their worms, but:
Now when i try to update or delete those DB entries, the queries will run forever and never succeed.
I am far from being an expert, even worse i might be dumb to ask, but why is it like this?
reproduction on other environment:
i can rerun this, i can update those entries.
So i think, the reason why i cannot change them on the other environment might be that the application blocks those entries from being accessed?
Export CSV from Mainframe DB2 in batch mode
how can I export in a CSV file the result of a SELECT query from Mainframe DB2 in Batch mode?I have tried the FILE MANAGER online mode and it works but I need to use the batch mode for a better performance. I can also use ISQL but I don't know which parameters I have to use to create a CSV file.Thanks
Having trouble writing output of a rexx program running from a batch file to an output file
I am running a REXX program containing DB2 commands. To run this REXX program I created the .bat file as shown above. But my output never gets written to the output(log) file. The file gets created but is blank. The REXX file contains no errors and if I run it through a cmd window the the output shows on the cmd window. Can you see what is my mistake here?
DataStage DB2 Runtime Column Propagation with Unicode Data
I'm trying to read some data from DB2 9.7 using DataStage 9.1 using the Runtime Column Propagation (RCP) feature. The general approach is to set the DB2 Connector Stage to generate the query SQL by specifying only the connection details and table name. This approach works in most cases but I'm running into a problem with multibyte characters.
When I have this setup and the data being read is from one of the CJK (Chinese, Japanese, or Korean) languages, I see
When I generate a Table Definition for the table I can see that it's generated the columns with the
With all of the above information it seems like DataStage is capable of generating
In short: is there any way to convince DataStage to generate ustring columns when using RCP? Is there a setting on the DB2 Connector stage? Is there a setting at the project level? Is there an environment variable that controls this? If not, do I then need to build table definitions for every table and write a custom job to extract that data solely because of the problem I'm seeing?
DB2 python insert list of dictionaries
I have a list of dictionaries that I'd like to insert into a DB2 table. How can I do that? I'm using the
The problem is that the table as well as the dictionaries have more than a hundred columns/keys, so I prefer not to list all column names in my SQL query.
IBM.Data.DB2.iSeries SQL0180 error
I'm attempting to connect to IBM.Data.DB2.iSeries database via a .NET application and am receiving the following error when executing a DB2 stored procedure: "SQL0180 Syntax of date, time, or timestamp value not valid."
However, when i run the same stored procedure in the IBM Data Studio i get no error and it successfully returns a from the execution of the stored procedure. This leads me to believe it may be a driver issue and i'll need to update it. Has anyone ran into this issue before and was it a driver update that fixed it?