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 How to use a variable in the select clause
How to use a variable in the select clause ?
I wish I could make the request
but this request fails because of the variable
I tested this:
How to use a variable in the DB2 select
thank you in advance for your help
DB2 ODBC password not used
I have a 32-bit DB2 ODBC DSN created with the user name and password saved. But when I try to connect to the DB I have to enter the user name and password again. Is there any way I can bypass the authentication? I have the user name and password saved in db2cli.ini file.
DB2 ODBC via PowerShell
I am trying to create the ODBC System DSN 32 bit for DB2 ODBC Driver. Executed as Administrator.
Add-OdbcDsn : Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed(Installer error code: 11).At line:1 char:1+ Add-OdbcDsn -Name "PROKEY1" -DriverName "IBM DB2 ODBC DRIVER - DB2COPY1" -DsnTyp + CategoryInfo : NotSpecified: (PROKEY1 (32-bit ODBC System DSN):Root/Microsoft/...SFT_OdbcDsnTask) [Add-OdbcDsn], CimException + FullyQualifiedErrorId : MI RESULT 0,Add-OdbcDsn
I am able to create the DSN via the GUI.
Casting DB2 column to accept multi lingual characters in Open query
I am using open query to retrieve data from IBM db2 to SQL server.
Below is the sample query used
The columnName needs to be converted / cast in Unicode format to accept multi lingual characters. How to use casting in the inner query?
My issue is similar to that of https://www.sqlservercentral.com/forums/997384/linker-server-to-as400-db2-character-translation-problems
I want to retrieve the data in Thai and Chinese characters. I have rows of data which are to be in Thai and Chinese characters. But the data shows as garbled when I use the command which I have provided. The column type in sql server is defined as nvarchar.
Db2 z/OS alternative for ROUTINE_SCHEMA or ROUTINE_SPECIFIC_NAME global variables of Db2 LUW
ROUTINE_SCHEMA or ROUTNE_SPECIFIC_NAME global variables in Db2 LUW can be used to retrieve the schema name or specific name of the currently executing routine.
Is there an alternative for one of them in Db2 z/OS (where both global variables do not seem to exist) ?
DB2 Query to merge 2 decimal column and find max
I am having two columns in DB2 table ExpiryDate
expiry year - Type decimal and length(4,0)
expiry month - Type decimal and length (2,0)
I need to write one DB2 query to get latest expiry date for that i need to combine both filed year and month and find out latest expiry date.
Thanks in advance
SQL syntax explanation (CAST, INSERT, DATE)
This is for educational purposes but could someone please explain what the below syntax is doing?
I have googled the functions and understand most of it but I'm just curious on the process of turning a value of 2017-12-18-13.21.04.442956 into 12/2017
The data type for DB2_RID is a timestamp.
So I understand that CAST is converting the inner value into a character of 10. I guess my confusion is how did it know it was a date and to not include the day of the month such as 12/01/2017.
How to use SQL Conditional statements in SQL
I'm working on a BIRT Reporting. What I need to do is, If the Column1 value is Approved, Copy Column 2 value to Column 3 else null
DB2 Primary-key truncation bug?
So I've searched around quite a bit and cannot seem to find an answer to this. I have two different applications that speak to the same DB2 database; one uses Hibernate, and the other uses just the native ResultSet, PreparedStatement, etc.
Let's say for example I have an object who's primary key is "ABC". The database has this keys length defined as 3. If I use the spring repositories findOne("ABC"), it returns my object. But the strange thing is if I call findOne("ABC123456"), it will still return that same database row, except the key field in the object is "ABC123456".
Now if I run a native query on the other application using a PreparedStatement, the same thing will happen, except in this case the primary key is returned correctly in the ResultSet.
Assuming this is a DB issue, but not sure what to look at. The database column is setup as a CHAR(3).
Accessing external (DSPF) fields using arrays in RPGLE free
In the old
This lead to possibilities like grouping several lines of input (additional order text) into a array. So I didn't have to
I'd only had to rename the LF record and the DSPF record fields to the array-fields, read the record and shift them from the one array to the other and display my
But is this also possible in