Quantcast
Channel: VBForums - Database Development
Viewing all 2918 articles
Browse latest View live

Unicode text in sms

$
0
0
I have written the follwoing sp for sending sms
i wanted send sms in other language how to pas the text in other language
to a declared variable @smstext

for example i have like set @smstext =N'मेरा नाम Pinal है'
1. this other language text i am not able type ineditor i have pasted it
2. this other language text is displaying like this after delivery ??? ??? Pinal ??'



Code:

ALTER procedure [dbo].[SendSmsSQL]
    @MobileNo varchar(12),
    @smstext as nvarchar(300)
    --@sResponse varchar(1000) OUT
as
BEGIN
  Declare @iReq int,@hr int
  Declare @sUrl as varchar(500)
  DECLARE @errorSource VARCHAR(8000)
  DECLARE @errorDescription VARCHAR(8000)
-- yse inserted
       
        --set @smstext =N'मेरा नाम Pinal है'

  -- Create Object for XMLHTTP
  EXEC @hr = sp_OACreate 'Microsoft.XMLHTTP',@iReq OUT

  -- print @hr

  if @hr <> 0
      Raiserror('sp_OACreate Microsoft.XMLHTTP FAILED!', 16, 1)
 
        set @sUrl ='http://bulksms.vrudheesolutions.com/api/mt/SendSMS?APIKey=5487-25487-8a93-a1a8a6f8eb61&senderid=mydid&channel=1&DCS=0&flashsms=0&number=#MobNo#&text=#Msg#&route=1'
  set @sUrl=REPLACE(@sUrl,'#MobNo#',@MobileNo)
  set @sUrl=REPLACE(@sUrl,'#Msg#',@smstext)

  --print @sUrl

  -- sms code start
  EXEC @hr = sp_OAMethod @iReq, 'Open', NULL, 'GET', @sUrl, true


How to exclude additional schema and retrive actual schema of oledb

$
0
0
When iam running this code in visual studio its also retrieving some other fields which are not present in a table.How to overcome this?

Dim conn As New OleDb.OleDbConnection
'Create a connection string for an Access database
Dim strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\check\a.mdb"
'Attach the connection string to the connection object
conn.ConnectionString = strConnectionString
'Open the connection
conn.Open()
Dim Restrictions() As String = {Nothing, Nothing, selected, Nothing} 'Selected contains the table name
Dim CollectionName As String = "Columns"
Dim dt As DataTable = conn.GetSchema(CollectionName, Restrictions)
For Each TableRow As DataRow In dt.Rows
ComboBox1.Items.Add(TableRow.Item("COLUMN_NAME"))



The additional schema which is also retrived are. 1.ID 2.Date create 3.Date update 4.Id 5.Lv 6.Name 7.parent Id 8.Type 9.GUID 10.Id And are 6 more ,orginal schema is of only 5 fields

Pulling text from database

$
0
0
Hi all,

I'm new to the forum and very new to VB. I have a very basic question I was hoping someone on here could help me figure out. (I've searched the help and tried multiple tutorials with no success. I'm using VB 2015 connecting to SQL Server 2014.)

I have a very simple form that gives certain text responses based on options selected from drop down boxes. Below is the code..

Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

If ComboBox1.Text.Contains("Hello") Then
TextBox1.Text = "Hi"
End If

If ComboBox1.Text.Contains("What's Your Name?") Then
TextBox1.Text = "Joe"
End If

End Sub

I'm going to be creating multiple drop down boxes with different text so I need the text box to pull from a database of responses. I have already built the database and entered the text into table (Hi, Joe, etc.).

All I need at this point is the code that will pull the text from the database. For example..

If ComboBox1.Text.Contains("Hello") Then
TextBox1.Text = 'get text from database row 1 column 2
End If

I know there is more to it than this one line, but can anyone send me the code needed to accomplish this?

T-SQL - SQL Server - Pivot table - missing data

$
0
0
I'm working with a query that deals with imported data. As it is imported, it can go through a number of processes along the way. I'm trying to build a query that will show the progress of each of the imported records and the status of the processes. There could be one process, there could be two, or three... Naturally all of the data is scattered across multiple tables... I can get the results in row-fashion, but now I'm trying to flatten it out into columns, so that for one imported record, I get one row, with the process statuses going across...

This illustrates the problem I'm having:
Code:

create table #RECORDSTATUS (
RECORDID uniqueidentifier,
IMPORTPROCESS nvarchar(50),
IMPORTDESCRIPTION nvarchar(200),
[FILENAME] nvarchar(50),
PROCESSNUMBER nvarchar(10),
PROCESSDESCRIPTION nvarchar(200),
PROCESSSTATUSCODE int,
PROCESSSTATUS nvarchar(50),
WORKFLOWSTATE nvarchar(200),
PROCESSCREATEDATE datetime
)

insert into #RECORDSTATUS
select
'DF918365-1026-4B81-987E-FFA4D00C1F92', 'Contact processing', '', 'GBIImportSample005.csv', '25', 'Created by the Contact processing.', 1, 'Committed', 'Open', '2015-12-30'
union all select
'5BCC958C-F153-4D6D-8287-7CF3D7CE19F8', 'Contact processing', '', 'GBIImportSample005.csv', '25', 'Created by the Contact processing.', 1, 'Committed', 'Open', '2015-12-30'
union all select
'8CAE521B-6FD1-48D6-BF3F-34D768158A25', 'Contact processing', '', 'GBIImportSample005.csv', '25', 'Created by the Contact processing.', 1, 'Committed', 'Open', '2015-12-30'
union all select
'5D494BBC-2E03-4CDF-9445-05C4B7DA20E8', 'Contact processing', '', 'GBIImportSample005.csv', '25', 'Created by the Contact processing.', 1, 'Committed', 'Open', '2015-12-30'
union all select
'73D20D31-6BC8-40FB-8657-5EB0FE79E90C', 'Contact processing', '', 'GBIImportSample005.csv', '25', 'Created by the Contact processing.', 1, 'Committed', 'Open', '2015-12-30'
union all select
'DF918365-1026-4B81-987E-FFA4D00C1F92', 'Invoice processing', '', 'GBIImportSample005.csv', '47', 'Created by Invoice processing.', 0, 'Uncommitted', 'Open', '2015-12-30'
union all select
'5BCC958C-F153-4D6D-8287-7CF3D7CE19F8', 'Invoice processing', '', 'GBIImportSample005.csv', '47', 'Created by Invoice processing.', 0, 'Uncommitted', 'Open', '2015-12-30'
union all select
'8CAE521B-6FD1-48D6-BF3F-34D768158A25', 'Invoice processing', '', 'GBIImportSample005.csv', '47', 'Created by Invoice processing.', 0, 'Uncommitted', 'Open', '2015-12-30'
union all select
'5D494BBC-2E03-4CDF-9445-05C4B7DA20E8', 'Invoice processing', '', 'GBIImportSample005.csv', '47', 'Created by Invoice processing.', 0, 'Uncommitted', 'Open', '2015-12-30'
union all select
'73D20D31-6BC8-40FB-8657-5EB0FE79E90C', 'Invoice processing', '', 'GBIImportSample005.csv', '47', 'Created by Invoice processing.', 0, 'Uncommitted', 'Open', '2015-12-30'

; with IMPORTSTATUS as (
select
        row_number() over (partition by RS.RECORDID order by RS.RECORDID, RS.PROCESSCREATEDATE) as ImportPivot,
        row_number() over (partition by RS.RECORDID order by RS.RECORDID, RS.PROCESSCREATEDATE) as ProcessPivot,
        row_number() over (partition by RS.RECORDID order by RS.RECORDID, RS.PROCESSCREATEDATE) as StatusPivot,
        RS.RECORDID,
        RS.IMPORTPROCESS,
        --RS.IMPORTDESCRIPTION,
        --RS.[FILENAME],
        RS.PROCESSNUMBER,
        --RS.PROCESSDESCRPTION,
        RS.PROCESSSTATUS
        --RS.PROCESSWORKFLOWSTATE
from #RECORDSTATUS RS
)
select RECORDID,
        IMPORT1 = ([1]),
        PROCESSNUMBER1 = ([2]),
        PROCESSSTATUS1 = ([3]),

        IMPORT2 = ([4]),
        PROCESSNUMBER2 = ([5]),
        PROCESSSTATUS2 = ([6]) --,

        --IMPORT3 = max([7]),
        --PROCESSNUMBER3 = max([8]),
        --PROCESSSTATUS3 = max([9]),

        --IMPORT4 = max([10]),
        --PROCESSNUMBER4 = max([11]),
        --PROCESSSTATUS4 = max([12]),

        --IMPORT5 = max([13]),
        --PROCESSNUMBER5 = max([14]),
        --PROCESSSTATUS5 = max([15])
from IMPORTSTATUS I
pivot (max(IMPORTPROCESS) for ImportPivot in ([1], [4])) as pvt1 --, [7], [10], [13])) as pvt1
pivot (max(PROCESSNUMBER) for ProcessPivot in ([2], [5])) as pvt2 -- , [8], [11], [14])) as pvt2
pivot (max(PROCESSSTATUS) for StatusPivot in ([3], [6])) as pvt3 -- , [9], [12], [15])) as pvt3

drop table #RECORDSTATUS

Right now that gives me the following results:

RECORDID IMPORT1 PROCESSNUMBER1 PROCESSSTATUS1 IMPORT2 PROCESSNUMBER2 PROCESSSTATUS2
5D494BBC-2E03-4CDF-9445-05C4B7DA20E8 NULL 47 NULL NULL NULL NULL
5D494BBC-2E03-4CDF-9445-05C4B7DA20E8 Contact processing NULL NULL NULL NULL NULL
8CAE521B-6FD1-48D6-BF3F-34D768158A25 NULL 47 NULL NULL NULL NULL
8CAE521B-6FD1-48D6-BF3F-34D768158A25 Contact processing NULL NULL NULL NULL NULL
73D20D31-6BC8-40FB-8657-5EB0FE79E90C NULL 25 NULL NULL NULL NULL
73D20D31-6BC8-40FB-8657-5EB0FE79E90C Invoice processing NULL NULL NULL NULL NULL
5BCC958C-F153-4D6D-8287-7CF3D7CE19F8 NULL 47 NULL NULL NULL NULL
5BCC958C-F153-4D6D-8287-7CF3D7CE19F8 Contact processing NULL NULL NULL NULL NULL
DF918365-1026-4B81-987E-FFA4D00C1F92 NULL 47 NULL NULL NULL NULL
DF918365-1026-4B81-987E-FFA4D00C1F92 Contact processing NULL NULL NULL NULL NULL

(ungh - I tried to get the output to display somewhat nicely but the forum doesn't want to play.)

There's two issues right out of the gate here... Import 2 isn't filling in with the correct process - it should have "Invoice processing" in it... and the status doesn't come over at all....

What I'm looking for is to have all of the data flattened out into one row... so that the *1 fields show the import, process, and status for "Contact processing" and the *2 fields show the import, process, & status for "Invoice processing" ... eventually I'd like to be able to show up to 5 groupings

The temp table in the above example is actually a CTE ... I'm using the temp table here for simplicity of the example ... but the fields and types of the #table are exactly what the CTE produces.


Import1 should have "Contact processing", ProcessNumber1 should be "47" and ProcessStatus1 should be "Committed"
Import2 should have "Invoice processing", ProcessNumber2 should be "25" and ProcessStatus1 should be "Uncommitted"


I know that I'll need to do another aggregate on the fields and group by the RecordID... but before I can even do that, I need to get the pivot working correctly.


What.
Am.
I.
Missing?

-tg

How do I copy 1 row from table A to same schema table b

$
0
0
Hello,

Here's what I've been trying. The problem seems to be in committing the dataset to the database because I can see the data table in the console.

Here's the code:

Private Sub btnConsole_Click(sender As Object, e As EventArgs) Handles btnConsole.Click
Dim ds As DataSet = New DataSet()
Dim tblPicture As DataTable
Dim tblNewPics As DataTable
Dim tblPictureCount As Integer
Dim i As Integer

Dim conn As SqlConnection = New SqlConnection("Server=R850-PC\SQLEXPRESS2012;database=NewParts;Integrated Security=True;Persist Security Info=False")
Dim da As SqlDataAdapter = New SqlDataAdapter("Select * from Picture Where IsNew = 1", conn)
da.Fill(ds, "Picture")
tblPicture = ds.Tables("Picture")
tblPictureCount = tblPicture.Rows.Count
tblPictureCount = tblPictureCount - 1

'SOURCE Picture table to the screen.
Console.WriteLine("Source Table tblPicture has " & tblPictureCount.ToString & " Rows")

For i = 0 To tblPictureCount
Console.WriteLine("Row(" & i.ToString & ") = " & tblPicture.Rows(i)(3))
Next

'********************* ADD TO NEW TABLE DATA **************************************************************************************

Dim da2 As SqlDataAdapter = New SqlDataAdapter("Select * from Picture_Temp", conn)
da2.Fill(ds, "Picture_Temp")
tblNewPics = ds.Tables("Picture_Temp")
tblNewPics = tblPicture.Clone

For i = 0 To tblPictureCount
tblNewPics.ImportRow(tblPicture.Rows(i))
Dim dr2 As DataRow = tblNewPics.Rows(i)
dr2.SetAdded()
Next
da2.Update(ds.Tables("Picture_Temp"))
tblNewPics.AcceptChanges()

'******************* DEBUG ... check new database table
Console.WriteLine()
Console.WriteLine("Destination TABLE has " & tblNewPics.ToString & " Rows")
For i = 0 To tblPictureCount
Console.WriteLine("Row(" & i.ToString & ") = " & tblNewPics.Rows(i)(3))
Next
Console.WriteLine("RowState = " & tblNewPics.Rows(i - 1).RowState.ToString)
Console.ReadLine()

txtMessages.Text = "Done"

End Sub

Any ideas??

Why does SQL Management Studio 2014 not show any Databases?

$
0
0
I have installed SQL server 2014, which I upgraded from SQL Server 2012.
I have a database created in Visual Studio 2013 as a LocalDB, but I can't see it in Management Studio?
In fact I can't detect any servers in MS!
How do I get MS to see this database?

I am a novice and need some help.
Any help would be appreciated!

Office 365 database hosting

$
0
0
Hi all, I am starting development of an internal application. Traditionally I would place an access database on our file server and internally easy to connect from desktop applications. Remote users can hook up via vpn although that is not as reliable.

We have office 365. Is there a way to connect to an access database there? That would simplify users access tremendously.

Minor help required for MS Access database

$
0
0
Hello everyone,
I am in little trouble which i dont know how do i resolve it. The problem is i have 2 databases which have same tables (Duplicate Database) in first database firstly removed all the records and then I made minor changes in tables ( like i have added some new columns) now i want to important only records from second database but keep the newer table structure of first database. So if any one can update me with the quick simple tutorial or help me in the steps thanks

Can't use Data Import/Export Wizard with flat file with large text field?

$
0
0
I am trying to import a text file which has a text field with a large amount of text.
When I try to import I get the following error:
Quote:

- Executing (Error)
Messages
* Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Column 3" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
(SQL Server Import and Export Wizard)

* Error 0xc020902a: Data Flow Task 1: The "Source - Verses3_txt.Outputs[Flat File Source Output].Columns[Column 3]" failed because truncation occurred, and the truncation row disposition on "Source - Verses3_txt.Outputs[Flat File Source Output].Columns[Column 3]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
(SQL Server Import and Export Wizard)

* Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "D:\My Files\1066Cards4U\Database backup\Verses3.txt" on data row 1.
(SQL Server Import and Export Wizard)

* Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Source - Verses3_txt returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
The target database dbo.Verses has the first 3 fields set as int and the last field is set as varchar(max).
Am I using the correct field type for the conversion?
As an example here is the first line of the text file:
1;1;27;"Today's a very special day A day to celebrate For today is your birthday You've reached the grand old age of "

Backgound: This is a database which contains verses that may be printed and inserted into homemade greetings cards. I have an webpaged version, which I want to design a VB version.

I am new to VB so could do with some help.

[RESOLVED] Sql select command

$
0
0
Hello dear friends,
i need to replace the 1 in this command with datagridview1.currentrow.index but i dont know how

Code:

Dim dtadapter As New SqlDataAdapter("SELECT Zutaten.Zutatname From Zutaten INNER JOIN Combine ON Zutaten.Id = Combine.ZutatenFK Where Combine.ArtikelFK = 1", sqlconn)
:wave:

Access Export to Excel VBA Code - Error

$
0
0
I've been working with an Access 2000 database using the Office 2010 Suite.
I am using VBA 7.0 (Version 1637).

There is a search menu in the main form, with the results being filtered into a datasheet in a subform.

Once the data is filtered I wish to export that into an Excel sheet.

I have been using the code below to achieve this:

Code:

Private Sub Command13_Click()
On Error GoTo Command13_Click_Err
Me.frm_RR_Data.SetFocus
DoCmd.GoToControl "Date Full"
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdCopy
Dim xlapp As Excel.Application
Set xlapp = CreateObject("Excel.Application")
With xlapp
.Workbooks.Add
.ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:=False
.Cells.Select
.Cells.EntireColumn.AutoFit
.Visible = True
.Range("B:B").Select
.Columns("B:B").NumberFormat = "000000000000"
.Range("C:C").Select
.Columns("C:C").NumberFormat = "00000000000000"
.Range("J:J").Select
.Columns("J:J").NumberFormat = "000"
.Range("M:M").Select
.Columns("M:M").NumberFormat = "0000"
.Range("A:A").Select
.Columns("A:A").NumberFormat = "dd/mm/yyyy  hh:mm:ss"
Call SubReplace
End With

Command13_Click_Exit:
Exit Sub
Command13_Click_Err:
MsgBox Error$
Resume Command13_Click_Exit

End Sub

This piece of code works *almost* perfectly :mad: - exporting the filtered data into a new Excel sheet - the error occurs when running Call SubReplace

The issue is that in the exported sheet some cells aren't correctly formatted - this is sorted however using F2+ENTER...

The code below *should* do this...
Code:

Private Sub SubReplace()
Dim r As Range
Dim n As Integer
Dim AssDateLastRow As Long

AssDateLastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row

Set r = Range("A2:A" & AssDateLastRow)
r.Select
r.NumberFormat = "dd/mm/yyyy hh:mm:ss"
r.Select
For n = 1 To r.Rows.Count
    SendKeys "{F2}", True
    SendKeys "{ENTER}", True
Next
    SendKeys "{F2}", True
    SendKeys "{ENTER}", True
End Sub

However; its doesn't always work perfectly for data exported into the excel the sheet - sometimes it runs on all of the cells, sometimes it runs on some of the cells (sometimes more or less cells than there is data) and sometimes it doesn't run at all and produces the following error message... Method 'Rows' of object '_ Global' failed.

I've looked around the web and it's stumped me... :( :confused:

Any help on solving this is greatly appreciated... :)

Requirements for running a VB application with database interaction

$
0
0
We are trying to install a Visual Basic application on several computers around our clinic. This program interacts with a database file on a network drive (the connection string is Y:\[file path]). When running the application on certain computers, we run into an error:
Code:

System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Here is an example of the SQL Server Configuration Manager display on one of the computers running into this error (sorry for the quality):
Name:  unnamed.jpg
Views: 33
Size:  5.7 KB
As you can (maybe) see, there's nothing under the "SQL Server Network Configuration" dropdown. Is this the issue? Does every computer running the application need to have something like SQL Server 2008 R2 installed (I use this example because it's what was installed on the computer used to develop the application), or is there an easier way to get things working? I know this is probably a ridiculous question, so apologies in advance. Thank you!
Attached Images
 

Insert to tabel adapter

$
0
0
Hello dear friends,
i really hope someone can help me, because i have been working on this for a long time now.
I have a sql database and a table called Person. I added a Dataset to this database in the designer (Datasource window)

Now i drag the table from the Dataset on my form.

I have got 2 textboxes and a button.

in the button click i got this code:
Code:


 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        PersonTableAdapter.Insert(TextBox1.Text, TextBox2.Text)
        PersonTableAdapter.Update(Database1DataSet)
    End Sub

But the Datagridview is not updated and the table is still empty when i look into the DATABASE.
Why is the update method of the adapter not giving the database the changes? what am i doing wrong.

Can IBM Data Studio do a syntax check?

$
0
0
I am trying to insert a value into a date column in an informix database and I don't know the correct format to use so I am trying to get it right using brute force. This is taking a long time because I don't have insert privilege to the database. I have to create a script and copy it to a folder where there's a job that runs and then emails me whether it succeeded or failed.

In my dreams, I'd like to be able to highlight the query in Data Studio and r-click and do a syntax check.

Am I dreaming?

odbc connection on a network server

$
0
0
Hi Guys
Just wondering if it is possible to reference a DSN on a remote server and use is as the DB connection. I am trying to connect to a sage DB which was ok when they both lived on the same server but sage was moved to another server. The main thing I am looking for is the connection string to the DSN or a non-dns connection. Any help would be appreciated.

Multi User Database Application (Service Based Database)

$
0
0
Hi Guys and Gals,

I have searched everywhere for the right answer but cant seem to stumble upon it...

I have basically created a simple project management system in VS2010 using VB and Windows Forms, pretty much exactly like this:

https://www.youtube.com/watch?v=CzBPaM098GQ

Now i'm wondering if you tell me whether there is a way to publish the application and place it on a network drive so that multiple users can access it and update the same database? When I have published it myself and accessed it on the network drive, using the same setup file in same location to install on different computers, it creates separate applications... Is there a way for these computers to access the same application, in turn updating the same database? It shouldn't matter about people editing data at the same time as all they can do is create table entries and not edit...

Any help will be greatly appreciated!!

Many thanks,

Adam

delete recrds in database from listview

$
0
0
Hello everyone
I am using this code to delete from listview
Code:

Dim i As Long
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database password=123; Data Source=" & App.Path & "\database.mdb"

If rs.State = adStateOpen Then rs.Close
      Set rs = New ADODB.Recordset
If ListView1.ListItems.Item(i).Checked = True Then
db.Execute "Delete from t1 where rendez like '" & ListView1.ListItems.Item(i) & "' "
ListView1.ListItems.Remove (i)
End If

But I get this message:
Index out of bounds
thanks

tableadapter default insercommand, selectcommand

$
0
0
Hello dear friends,

when i click on the tableadapter ( in dataset designer) there are 4 properties:
Selectcommand, Insertcommand, Deletecommand, Updatecommand.

I wanted to call this methods from my form1 to use the Insertcommand.
I dont know for what they are good and how to use them.

i tried tableadapter.adapter.insertcommand but it always underlines insertcommand . the 4 properties are shown after the dot (tableadapter.adapter. ) but i really dont know how to use them. thanks

Can't get the MAX function to work right?

$
0
0
I have a SQL query in which I need to return a single row that contains multiple columns with a specific column containing a MAX value out of several rows. I have attached a screenshot of the query as well as the results. My query code is below.

In the example shown, the last row is the only row that needs to be returned.

Code:

        SELECT        G.[serialNO]
                        ,A.[main_ID]                       
                        ,A.[channel_ID]
                        ,D.[direction_ID]
                        ,D.[direction]
                        ,E.[Rin]
                        ,E.[Rout]
                        ,F.[zeroBalance]
                        ,MAX(C.[output]) AS fsOutput
                        ,J.[channel]
                        ,H.[unit]
          FROM        [Test].[HEADER_Load] A INNER JOIN [Test].[DETAILS_LoadLink] B ON B.[load_ID] = A.[load_ID]
                        INNER JOIN [Test].[DETAILS_Load] C ON C.[loadLink_ID] = B.[loadLink_ID]
                        INNER JOIN [Lookup].[Direction] D ON D.[direction_ID] = B.[direction_ID]
                        INNER JOIN [Test].[HEADER_Resistance] E ON E.[main_ID] = A.[main_ID] AND E.[channel_ID] = A.[channel_ID]
                        INNER JOIN [Test].[HEADER_FirstFinalZero] F ON F.[main_ID] = A.[main_ID] AND F.[channel_ID] = A.[channel_ID]
                        INNER JOIN [Test].[HEADER_Item] G ON G.[main_ID] = A.[main_ID]
                        LEFT JOIN [Lookup].[Units] H ON H.[unit_ID] = A.[outputUnit_ID]
                        LEFT JOIN [Lookup].[Channel] J ON J.[channel_ID] = A.[channel_ID]
        WHERE        A.[main_ID] = 129527        AND
                        F.[testOrder] = 1
  GROUP BY        A.[main_ID],G.[serialNO],A.[channel_ID],D.[direction_ID],D.[direction],C.[output],J.[channel],A.[load],
                        E.[Rin],E.[Rout],F.[zeroBalance],H.[unit]
        HAVING  MAX(C.[output]) > 0
  ORDER BY        A.[channel_ID],G.[serialNO],D.[direction_ID]

Attached Images
 

DB2 Email Generation with Excel attachment

$
0
0
Hi All,

I have COBOL program which generates 3 output Data Sets.

Output1
Output2
Output3

I have requirement to attach all 3 Data sets as excel send it to distribution group.

When i am using the IBM ZADPR01 utility, i am able to generate the excels separately(3 Different excels attached in email).

Is it possible to generate single excel with multiple sheets(1 Excel - 3 different sheets) through JCL/UTILITY?

Please advise. Thanks.
Viewing all 2918 articles
Browse latest View live