i want to combine multiple rows into a single row using **DB2**. I have found this code, but I do not know how can i edit it>? CREATE FUNCTION MySchema/MyUDF ( PARCol2 CHAR(5) ) RETURNS VARCHAR(1024) LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA CALLED ON NULL INPUT DISALLOW PARALLEL BEGIN DECLARE ReturnVal VARCHAR(1024) NOT NULL DEFAULT ''; FOR CsrC1 AS C1 CURSOR FOR SELECT MyCol1 FROM MyTable WHERE MyCol2 = ParCol2 DO SET ReturnVal = ReturnVal Concat CsrC1.MyCol1; END FOR; RETURN LTRIM(ReturnVal); END ; and call it here Select id, MyUDF(Name) as FruitsAvailable From TableFoo where id = 1 Thanks!

Member Avatar
Member Avatar
+1 forum 1

The issue I am having has to do with not being able to show different OrderDate for the same Unit Unit OrderDate ShipDate ReceiptDate Robot 20160101 20160102 20160103 Robot 20160102 20160103 20160104 Robot 20160103 20160104 20160105 What is happening instead is that it is showing the same OrderDate for all three records. Unit OrderDate ShipDate ReceiptDate Robot 20160101 20160102 20160103 Robot 20160101 20160103 20160104 Robot 20160101 20160104 20160105 select salesorder.unitid "Unit",max(salesorder.eventdate) "OrderDate",max(salesdelivery.eventdate) "ShipDate",max(salesreceipt.eventdate) "ReceiptDate" from (select eventdate,unitid from sales where event='ORDER' and eventdate>'2015-12-31' and eventdate<'2016-02-01') salesorder left outer join (select eventdate,unitid from sales where event='SHIP' and eventdate>'2015-12-31' and eventdate<'2016-02-01') salesdelivery …

Member Avatar
+0 forum 0

Hi guys, I need to put data that i get it from db2 and display it into each text boxes (Name, Address and Postcode). What i got now, its displayed Name's data that i got from db2 into all text boxes (Name, Address and Postcode) . All i want is each data for each text box. Here is my code : //html <tr> <td height="25" align="right">Id Num <font color="#FF0000">*</font></td> <td height="25" align="center">:</td> <td height="25"><input name="id_num" type="text" id="id_num" size="12" maxlength="12" onKeyUp="checkInput(this.value, 'ajaxChecker-name.php');" value="<?php echo $selected_id_Num; ?>"/> </td> </tr> <tr> <td height="25" align="right">Name </td> <td height="25" align="center">:</td> <td height="25"><input type="text" name="name" id="name" …

Member Avatar
Member Avatar
+0 forum 2

Hello, What seems so trivial, has been bugging me. I have a table with duplicate values on one column, while non-duplicate (date) values on the other. If I am to use DISTINCT it will only eliminate the row with the same date. But how do I use DISTINCT and only keep the ones with the oldest date? I hope this does not come out as a dumb question. I have tried reviewing other posts to see if I could find my answer there but had no luck. Any help would be greatly appreciated! Example: Student ModifiedDate John 06222015 John 06212015 …

Member Avatar
Member Avatar
+0 forum 3

Hi! Could you help me initialize or load the data into a Data Grid View Control using iDB2 Connection? I've tried this code I've seen from the net but it does not seem to work :( I am initializing the connection using form_load and not in the Properties Window. Imports IBM.Data.DB2 Imports IBM.Data.DB2.iSeries Dim cmdGet As New iDB2Command Dim daGet As New iDB2DataAdapter Dim dsGet As New DataSet Dim sqlGet As String conn.ConnectionString = str conn.Open() '****Display all the records in dgTranslog sqlGet = "SELECT * FROM exptranslog" cmdGet.CommandText = sqlGet cmdGet.Connection = conn daGet.SelectCommand = cmdGet daGet.Fill(dsGet) dgTranslog.DataSource = …

Member Avatar
Member Avatar
+0 forum 2

Hi! My database is in AS/400 DB2 hence, I am using SQL. Here's my line of code for opening a connection. Dim str As String = "User ID=EDITH;Password=EDITH;Data Source=10.0.1.11;Initial Catalog=ictms;Integrated Security=True" Dim conn As SqlConnection = New SqlConnection(str) conn.Open() Now, I wanted to execute a delete query, however, I already get errors in the `conn.Open()` area. Please check the attached file for the error.

Member Avatar
Member Avatar
+0 forum 29

Hello guys, I created two database in derby: DB1 with one table Customers and its columns id,name,last And DB2 with one table Purchases anf its colums CustID, total I would like to makes queries from data in both of these database. I tried SELECT C.name, C.last, U.Total FROM DB1.Customers C INNER JOIN DB2.Purchases U ON C.id=U.CustID; Can anybody help me...

Member Avatar
Member Avatar
+0 forum 1

Good day, Just want to ask some help, Please! I always encounter "Cannot find Table 0" when i call Stored Procedure in DB2 using VB .Net with Ole DBConnection Provider. Here is my code: Private Sub cmdPost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPost.Click rsSearch = clsDAOMngr.getConfigParam(2) For i = 0 To rsSearch.Tables.Count Step 1 With rsSearch.Tables(0) MsgBox(.Rows(i)(0).ToString()) End With Next End Sub '------------------------------------------------------- Public Function getConfigParam(ByVal strParameter As String) As DataSet getConfigParam = Nothing Dim sProcedure As String = "" sProcedure = "EDMS.SAMPLE_SELECT2" getConfigParam = clsDBMngr.executeStoredProcedure_split(sProcedure, strParameter, 1) End Function '------------------------------------------------------- Public Function executeStoredProcedure_split(ByVal spname As String, …

Member Avatar
Member Avatar
+0 forum 1

What is the Diffrence between Db2 and Oracle databse please explain

Member Avatar
Member Avatar
+0 forum 1

hi i am entirely new to eclipse, db2 and wasce. but for a certain project i need to make a project using the above tools in java. so i did the following 1. Installed db2 v 9.7 with username & password both admin 2. Installed wasce 3. Installed Eclipse my jsp pages are working fine means my eclipse and wasce have been successfully connected. but i am unable to access my db2 database. i added the db2 drivers into my project. and this is a code i got from documentation book of ibm. i modified it a little. [CODE] import …

Member Avatar
+0 forum 0

Hello, I have installed DB2 Everyplace, it installed successfully but not able to configure. Getting Error while try to configure it. The error is like this : [CODE] [exec] UPDATE DATABASE CONFIGURATION FOR DSYMSGDB USING MAXLOCKS 50 [exec] SQL1032N No start database manager command was issued. SQLSTATE=57019 [exec] SQL1032N No start database manager command was issued. SQLSTATE=57019 [exec] db2empfa failed. [exec] SQLCODE -1032 [exec] Result: 1 [validate-db-exists] Connection to jdbc:db2:DSYCTLDB failed. [trycatch] Caught exception: ERROR - dbtype = db2, errorcode = -1032 [logmsg] 2011.02.07 11:59:10.688 create-db [logmsg] DB2eC1002E The DB2 Everyplace Sync Server control database could not be created. Refer …

Member Avatar
+0 forum 0

The End.