Multiple table format through email using powershell

Hi All,
I have a powershell script which executes a SQL Query on three SQL instances and provides the result in table format through email. The output email contains all the result of the query in a single output itself. Please help me, I have provided the code
which I am using
Sample output format which I am getting: 
ServerInstance
Databasename EnabledStatus
Instance1 Database1
Enable
Instance1 Database2
Enable
Instance1 Database3
Enable
Instance2 Database1
Enable
Instance2 Database2
Enable
My requirement is I should get two table formatted email like below:
Database status of Instance 1
ServerInstance
Databasename EnabledStatus
Instance1 Database1
Enable
Instance1 Database2
Enable
Instance1 Database3
Enable
Database status of Instance 2
ServerInstance
Databasename EnabledStatus
Instance2 Database1
Enable
Instance2 Database2 Enable
#This PowerShell Scrip is well-suited with PowerShell V3.0
#import SQL Server module
#Import-Module SQLPS -DisableNameChecking
#get all the instances and temporarily store them in a variable
$ServerInstances = Get-Content "C:\SQL_Servers.txt"
$scriptFile = "C:\restoredetails_mountdrive.sql"
$a = "Hi All, <BR> <BR>"
$a = $a + "Below is the TESTING Environment. This is an auto-generated mail.<BR><BR>"
$a = $a + "<style>"
$a = $a + "BODY{background-color:white;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 0px;width:150%;cellspacing=0 ;padding: 10px;border-style: solid;border-color: black;background-color:#43B2B2;font-family: Verdana;font-size:13 }"
$a = $a + "TD{border-width: 0px;width:150%;cellspacing=3 ;padding: 10px;border-style: solid;border-color: black;text-align: left;background-color:white;font-family: Verdana;font-size:11}"
$a = $a + "</style>"
#he database we want to execute it against, regardless of the instance
$DBName = "master"
#iterating through all instances.
$ServerInstances |
ForEach-Object {
#For each instance, we create a new SMO server object
$ServerObject = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $_
#use the Invoke-Sqlcmd cmdlet to execute the query
#we are passing in the pipeline is the instance name, which is $_
$refresh_output1 = $refresh_output1 + (Invoke-Sqlcmd `
-ServerInstance $_ `
-Database $DBName `
-InputFile $scriptFile
#-Query $SQLQuery
[string]$tst = $refresh_output1 |convertTo-Html -Head $a -property InstanceName, DatabaseName,OverallStatus | Out-String
write-output " "
[System.Net.Mail.MailMessage]$message = New-Object System.Net.Mail.MailMessage("emailid.com", "toemailid.com", "Subject", $tst )
[System.Net.Mail.SmtpClient]$client = New-Object System.Net.Mail.SmtpClient("smtpserver",25)
$Message.IsBodyHtml = $true
$client.Timeout = 100
$client.Send($message)

Generally it's best to post in the Hey Scripting Guy forum, they are scarily good in there. Someday i hope to give an answer so perfect that not even jrv can improve on it.
Your approach might be possible but it's not the way i'd do it. The ConvertTo-HTML is pretty clever, it works well with arrays of objects. If you were to load each result into a custom PSObject then add that to an array of them for later processing you can
get the table formatting almost for free.
I haven't worked with SQL queries in a bit but this might work, it seems ok when i put token results in for the SQL result.
#This PowerShell Scrip is well-suited with PowerShell V3.0
#import SQL Server module
#Import-Module SQLPS -DisableNameChecking
#get all the instances and temporarily store them in a variable
$ServerInstances = Get-Content "C:\SQL_Servers.txt"
$scriptFile = "C:\restoredetails_mountdrive.sql"
$a = "Hi All, <BR> <BR>"
$a = $a + "Below is the TESTING Environment. This is an auto-generated mail.<BR><BR>"
$a = $a + "<style>"
$a = $a + "BODY{background-color:white;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 0px;width:150%;cellspacing=0 ;padding: 10px;border-style: solid;border-color: black;background-color:#43B2B2;font-family: Verdana;font-size:13 }"
$a = $a + "TD{border-width: 0px;width:150%;cellspacing=3 ;padding: 10px;border-style: solid;border-color: black;text-align: left;background-color:white;font-family: Verdana;font-size:11}"
$a = $a + "</style>"
#he database we want to execute it against, regardless of the instance
$DBName = "master"
#Create an empty object collection
$objectCollection = @()
#iterating through all instances.
$ServerInstances |
ForEach-Object {
#For each instance, we create a new SMO server object
$ServerObject = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $_
#use the Invoke-Sqlcmd cmdlet to execute the query
#we are passing in the pipeline is the instance name, which is $_
$SQLResult = (Invoke-Sqlcmd `
-ServerInstance $_ `
-Database $DBName `
-InputFile $scriptFile
#-Query $SQLQuery
$objectCollection += New-Object -TypeName PSObject -Property @{
"InstanceName" = $_ ;
"DatabaseName" = $DBName ;
"OverallStatus" = $SQLResult["OverallStatus"];
$objectCollection | ConvertTo-Html -Fragment
[System.Net.Mail.MailMessage]$message = New-Object System.Net.Mail.MailMessage("emailid.com", "toemailid.com", "Subject", $objectCollection)
[System.Net.Mail.SmtpClient]$client = New-Object System.Net.Mail.SmtpClient("smtpserver",25)
$Message.IsBodyHtml = $true
$client.Timeout = 100
$client.Send($message)

Similar Messages

  • Anyone know how to show table format in email using php?

    I created a form using tables in dreamweaver.. and my email works and I used php.
    My issue is I want my submitted form to look like the form I built in dreamweaverwith the tables and spaces etc. Is there a way to do this?

    The PHP mail() function uses plain text. To format the output of the user input as a table, you would need to create an HTML email, wrapping the user input in table tags. Example #4 in the PHP mail() manual page shows how to create HTML email: http://docs.php.net/manual/en/function.mail.php.

  • How to send multiple customer statements by email using RFKORD11 program.

    Hi All,
    How to send multiple customer statements by email using RFKORD11 program. Is it possible?
    As of now we copied the stanadard program and sending the customer statements by email, one by one.
    if i execute the z program it will show the customer statement and send mail option.
    if i click send mail it will send that customer statement to the corresponding customer.
    then again i need to click back, it will show next customer statement and click on send mail.
    Pl guide me, if any one worked on this program.
    thanks in advance.
    Regards,
    Mahesh

    Try execute the program in the background to see if that helps.

  • How to send multiple customer statements by email using RFKORD11

    Hi All,
    How to send multiple customer statements by email using RFKORD11 program.
    As of now we copied the stanadard program and sending the customer statements by email, one by one.
    if  i execute the z program it will show the customer statement and send mail option.
    if i click send mail it will send that customer statement to the corresponding customer.
    then again i need to click back, it will show next customer statement and click on send mail.
    Pl guide me, if any one worked on this program.
    Regards,
    Mahesh

    Hi .
    You first need to copy that program to Z and make the changes in it. Can you convert sapscript to smartform?
    then you can write a logic to send mail in the loop.
    to send the pdf file
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/mailsendthroughoutputcontrols
    Regards,
    Madhuri
    Edited by: madhuri sonawane on Jun 10, 2009 4:20 PM

  • Alerts through Email Using BPM

    Hi Friends,
                    can anybody help me on BPM as i am new to BPM.I need a help from you , i want to send an alert through Email using BPM can any body send me a sample scenario related to this one.

    In BPM you create the Alerts. In Alert Configuration (in RWB) you can define for each Alter Category whether it is to be forwarded via Email.Prerequisites for that:
    1. XI/PI must have been configured to send Mails (SMTP)
    2. All receivers must have maintained an Email Adress in SU01
    3. Only users defined in XI/PI can get the mails.
    4. Schedule the regular sending of Emails out of the XI/PI system using transaction SCOT
    5. The Mail Server (Lotus Domino or Exchange Server) must accept Mails from XI/PI system (Server and Port). Ask your Mail Guys.
    6. If you do not define the Mail Server as IP address in SMTP configuration take care that the XI/PI is able to resolve Server Name to IP Address (e.g. by maintaining local hosts ob XI/PI).
    Hope this helps!
    Regards,
    Volker

  • Unable to send photo through email using iphoto theme (designs)

    Unable to send photo through email using iPhoto theme (designs) using the SHARE button.
    Error message:
    Your email did not go through because the server did not reply.
    Check your Internet connection.
    If the connection is working properly, the email server may be down.
    Try sending your email again later.

    Your email did not go through because the server did not reply.
    Check your Internet connection.
    If the connection is working properly, the email server may be down.
    Try sending your email again later.
    Are you using Yosemite and not apple's Mail app? Then you may need to set up an app-specific password: See the post below:
    Re: I am using iPhoto version 9.6 and I can no longer get an email sent with a photo attached. I get an error message saying the email did not go through because the server did not reply. I can send the photo with Mail. Help!in response to Gary Kissler
    This solution is for those of you using 2-step verification for your Apple ID and are using iCloud as the mail server that you are trying to mail photos with.
    I too had this issue. The problem in my case occurred because I had setup 2-step authentication for my Apple ID. If you have done this then you will get the error message "the mail server did not recognize your email/password...". To solve the problem go to:
    https://appleid.apple.com
    Click "Manage Your Apple ID"
    Verify your identity with the device you selected (if this step does not show up then you have not likely set up 2-step authentication and this is not your solution)
    Click Password and Security in the left column
    Click Generate an app-specific password
    Enter iPhoto as the name of the app
    Copy the password and paste this into the password box in iPhoto where you would normally enter your apple ID (in the mail account section in iPhoto preferences).
    And...voila' (I hope)

  • Report In Table Format in Email

    Dear sir,
    i want to send mail to user in format of report of issues in table Format in Body of mail.
    Actully i want to send mail daily to user with Pending Issues of user.
    HOD allote issue to user with Close target Date .Mail would be fire till tagget date >sysdate .
    There can be Multiple issue with user.
    so i want to create a list of All pending issue in report in table which are not Closed .
    Report should be display with that column
    eg. User 0010 has 3 Pending Issue
    Issue No-----subject-----Create On-----Target Date
    001---------ABC-------27-Mar-2011-------30-Jnn-2011
    002--------BHN-------23-Jun-2011---------06-July-2011
    003--------JHN--------05-Jun-2011---------02-July-2011
    That Report Should be sent to User in mail.
    My Code is
    DECLARE
    l_id number;
    to_add varchar2(1000);
    to_sub_by varchar2(1000);
    from_add varchar2(1000);
    l_body varchar2(4000):=:P33_DESCRIPTION;
    l_sub varchar2(1000):=:P33_SUBJECT;
    I_case varchar2(10):=:P33_CASE_ID;
    I_isue_dte date:=:P33_SUBMITTED_ON;
    l_regd    varchar(100);
    CURSOR C1 IS SELECT EMAIL_ID,(SELECT EMAIL_ID FROM USER_MAS WHERE USER_ID =:P33_SUBMITTED_BY_ID) AS D FROM USER_MAS WHERE USER_GR_ID=:P33_ASSIGNED_TO_GROUP_ID AND USER_ID NOT IN(:APP_USER);
    BEGIN
    if :P33_ASSIGNED_TO_GROUP_ID is not null then
    open C1;
    LOOP
    FETCH C1 INTO to_add,to_sub_by;
    EXIT WHEN C1%NOTFOUND;
    select email_id,user_name into from_add,l_regd from user_mas where user_id=:app_user;
    l_id:=APEX_MAIL.SEND(
            p_to        => to_add, -- change to your email address
            P_cc        => to_sub_by,
            p_from      => from_add,
            p_body      => 'Issue Information'||''||chr(13)||chr(10)||chr(13)||chr(10)||
                           'www.farhorizonindia.net:7777/crm'||''||chr(13)||
                           'Issue Title'||':'||l_sub||CHR(13)||chr(10)||
                           'Issue Number'||':'||I_case||CHR(13)||
                           'Issue Open Date'||':'||I_isue_dte||''||chr(13)||chr(10)||CHR(13)||chr(10)||
                           'Most Recent Comment'||':'||''||chr(13)||chr(10)||
                           l_body||chr(13)||chr(10)||''||CHR(13)||chr(10)||'Regards'||chr(13)||chr(10)||''||l_regd||CHR(13)||chr(10)||CHR(13)||chr(10)||'Please do not reply to this email.If you wish to update the call.please login to the issue Management.',
      P_subj      => I_case ||' Issue '||l_sub);
    end loop;
    close C1;
    end if;
    COMMIT;
    apex_mail.push_queue(
    P_SMTP_HOSTNAME => '102.111.0.9',
    P_SMTP_PORTNO => 25);
    commit;
    END;How can i create that format in Body Of sending Email.
    Thanks
    Vedant
    Edited by: Vedant on Jun 30, 2011 3:44 AM
    Edited by: Vedant on Jul 5, 2011 9:17 PM

    Look at using an interactive reports and subscription routine..: http://st-curriculum.oracle.com/obe/db/apex/r40/apexirr/apexirrdev/apexirrdev_ll.htm
    Death called while you were out, so I gave him your cell number.
    Thank you,
    Tony Miller
    Webster, TX

  • Iam unable to attach multiple files to a email using javamail?

    Hai to all,
    Sorry that snipnet is for only one attachment ,
    iam sending my topic again,plese go through it.
    Iam unable to send multiple attachments with a email,see
    iam have succeeded in sending one attachment with a email.
    when iam tring to add two or more attachments to a mail,
    it is giving a Exception like this:
    javax.mail.MessagingException: IOException while sending message;
    nested exception is:
    java.io.IOException: No content
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:577)
    at javax.mail.Transport.send0(Transport.java:151)
    at javax.mail.Transport.send(Transport.java:80)
    at AttachFilesModified.sendMail(AttachFilesModified.java:185)
    at AttachFilesModified.main(AttachFilesModified.java:43)
    this is my code snipnet:
    BodyPart messageBodyPart = new MimeBodyPart();
    Multipart multipart = new MimeMultipart();
    if(body != null)
    messageBodyPart.setText(body);
    multipart.addBodyPart(messageBodyPart);
    /*if(attachments != null)
    for(int i = 0; i < attachments.length; i++)
    String filename="D:\\nagaraju\\apachi\\axis-bin-1_3.zip";
    //String s[]=filename.split("\\");
    //System.out.println(s);
    //String s1=s[1];
    //String filename1=s[s.length-1];
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(filename);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(filename);
    multipart.addBodyPart(messageBodyPart);
    //second file attaching
    String filename1="C:\\nagadoc.txt";
    BodyPart messageBodyPart1=new MimeBodyPart();
    DataSource source1=new FileDataSource(filename1);
    messageBodyPart.setDataHandler(new DataHandler(source1));
    messageBodyPart.setFileName(filename1);
    multipart.addBodyPart(messageBodyPart1);
    mess.setContent(multipart);
    Address[] allRecips = mess.getAllRecipients();
    if(toStdOut)
    System.out.println("done.");
    //System.out.println("Sending message (\"" + mess.getSubject().substring(0,10) + "...\") to :");
    System.out.println("Sending message................");
    for(int i = 0; i < allRecips.length; i++)
    System.out.print(allRecips + ";");
    System.out.println("...");
    Transport.send(mess);
    if(toStdOut)
    System.out.println("done.");
    return 0;
    What's wrng with that code snipnet?
    Nagaraju G.

    This works fine with me, try it or compare it if you want.
    public void sendEmail( String from, String to,
    String subject, String body) {
    fMailServerConfig.put("mail.smtp.host", " <<mail server>>");
    Session session = Session.getDefaultInstance( fMailServerConfig, null );
    MimeMessage message = new MimeMessage( session );
    try {
    message.setFrom(new InternetAddress(from));
    message.setRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    message.setSubject( subject);
    message.setText( body);
    //Adds Attechment:
    Multipart multipart = new MimeMultipart();
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText("Here are my attachments");
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    //first attachment
    DataSource source = new FileDataSource("C:\\img1.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("C:\\Telnor1.jpg");
    multipart.addBodyPart(messageBodyPart);
    //Second attachment
    DataSource source2 = new FileDataSource("C:\\img2.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source2));
    messageBodyPart.setFileName("C:\\Telnor2.jpg");
    multipart.addBodyPart(messageBodyPart);
    //etc...
    message.setContent(multipart);
    Transport.send( message );
    }catch (MessagingException e){
    System.err.println("Cant send mail. " + e);
    The error on your code might be:
    BodyPart messageBodyPart1=new MimeBodyPart();
    DataSource source1=new FileDataSource(filename1);
    messageBodyPart.setDataHandler(new DataHandler(source1));
    messageBodyPart.setFileName(filename1);
    multipart.addBodyPart(messageBodyPart1);
    You don't need to create a new BodyPart, and apart from that you'r seting values on "messageBodyPart" but adding "messageBodyPart1" to your multipart :P
    Well see u and have a good one!
    p.s. i know it's a little late from the day you posted, but at least it might help somebody else :D .

  • Inserting into multiple tables on one form using UIX

    We are developing an application using struts and UIX. We would like to be able to insert into three tables on one form(view). How can we accomplish this?

    This is more of an ADF question, you'll need to set up view object, than just drag it from the data control palette like normal.
    If it's not already set up as a view in the db (split into multiple tables), you'll need to create a view object that includes all the fields you want, based on multiple entity objects.

  • T-SQL - Using Column Name in where condition without any references when having multiple tables that are engaged using multiple joins.

    Hi All,
    I am a newbie for T-Sql, I came across a SP where multiple tables are engaged using multiple joins but the where clause contain  a column field without any table reference  and assigned  for an incoming variable,like 
    where 'UserId = @UserId'
    instead -  no table reference like 'a.UserId = @Userid'   ............ Can any please do refer to me any material that clears my mind regarding such issue................... help is appreciated.
    Thank You.

    As suggested above, use table alias with columns for unique referencing and to make the code easier to read.
    BOL example for table aliasing:
    USE AdventureWorks;
    GO
    SELECT S.CustomerID, S.Name AS Store, A.City, SP.Name AS State, CR.Name
    AS CountryRegion
    FROM Sales.Store AS S
    JOIN Sales.CustomerAddress AS CA ON CA.CustomerID = S.CustomerID
    JOIN Person.Address AS A ON A.AddressID = CA.AddressID
    JOIN Person.StateProvince SP ON
    SP.StateProvinceID = A.StateProvinceID
    JOIN Person.CountryRegion CR ON
    CR.CountryRegionCode = SP.CountryRegionCode
    ORDER BY S.CustomerID ;
    GO
    GO
    LINK:
    http://technet.microsoft.com/en-us/library/ms124824(v=sql.100).aspx
    Check the use of TABLE ALIASes and COLUMN ALIASes in the following blog:
    http://www.sqlusa.com/bestpractices2005/organizationtree/
    Without the use of aliases the code would become unreadable.
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Connecting a cisco firewall through putty using powershell

    Hi,
    I have to write a powershell script to connect to a cisco firewall and execute network commands.
    my code is written as mentioned below-
    function plink
      [CmdletBinding()]
      PARAM
        [Parameter(Mandatory=$True)]
        [ValidateNotNullOrEmpty()]
        [string] $remoteHost,
        [Parameter(Mandatory=$True)]
        [ValidateNotNullOrEmpty()]
        [string] $login,
        [Parameter(Mandatory=$True)]
        [ValidateNotNullOrEmpty()]
        [string] $passwd,
        [Parameter(Mandatory=$True)]
        [ValidateNotNullOrEmpty()]
        [string] $command)
      & D:\PLINK.EXE -ssh $remoteHost -l $login -pw $passwd $command
      return
    $remoteHost = "*****"
    $login = "****"
    $passwd = "******"
    $command= "enable"
    plink -remoteHost $remoteHost -login $login -passwd $passwd -command $command
    from above script im able to login to a firewall but I am not able to enable the firewall.
    Can anyone help me and provide me ways to enter the command "enable" and its password to enable firewall using powershell.  

    Hi Plas,
    Please try the script below, which add the cmdlet "Invoke-Expression":
    function plink
    [CmdletBinding()]
    PARAM
    [Parameter(Mandatory=$True)]
    [ValidateNotNullOrEmpty()]
    [string] $remoteHost,
    [Parameter(Mandatory=$True)]
    [ValidateNotNullOrEmpty()]
    [string] $login,
    [Parameter(Mandatory=$True)]
    [ValidateNotNullOrEmpty()]
    [string] $passwd,
    [Parameter(Mandatory=$True)]
    [ValidateNotNullOrEmpty()]
    [string] $command)
    $ExePath = "D:\PLINK.EXE"
    $CLine = "-ssh $remoteHost -l $login -pw $passwd $command"
    Invoke-Expression "$ExePath $CLine"
    $remoteHost = "*****"
    $login = "****"
    $passwd = "******"
    $command= "enable"
    plink -remoteHost $remoteHost -login $login -passwd $passwd -command $command
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang

  • Export table format SQL loader using spool

    Hi
    In enviroment I only access for to do SELECT , then I want to export some tables using SELECT using spool of data
    But I wanted export in format Sql Loader for to import other environment
    Is possible to do It ?

    Depends where the NULL is.
    SQL> SELECT * FROM t ORDER BY 1;
            ID DESCR      DT
             1 One
             2            30-MAY-2007
             4 Four       30-MAY-2007
               Three      30-MAY-2007
    SQL> SELECT id||',"'||descr||'",'||TO_CHAR(dt,'dd-mon-yyyy') output
      2  FROM t
      3  ORDER BY 1;
    OUTPUT
    ,"Three",30-may-2007
    1,"One",
    2,"",30-may-2007
    4,"Four",30-may-2007John

  • How to convert document file in PDf format through workflow using sharepoint designer

     Please suggest me solution it's urgent.....please.

    Hi Anil,
    If Word Automation Services is installed in your environment then that may be an option (Providing you are only interested in converting MS-Word documents). However SharePoint does not ship with an out-of-the-box workflow activity that makes use of this.
    You may want to consider some third party software that supports formats other than MS-Word as well and comes with workflow actions for SharePoint Designer (and Nintex Workflow) out of the box. Have a look at the
    Muhimbi PDF Converter for SharePoint.
    Disclaimer, I worked on this product so I am obviously biased. (It works great though :-)

  • Breaking down SQL table into Multiple tables on the web using struts

    I have a SQL table with business names and products. I am trying to display tables on a webpage for each individual business and their products. So one table is for each business and each business table lists all the products for that business. I'm not really sure how to do this. I sorted by the business names so all the related records are next to each other. I did try two nested iterate statements but received an error about missing a getter. Any suggestions would be helpful. I am writing this code in a JSP file and can use most struts commands (bean, html, nested commands). Sorry if this topics isn't very related to JSP but couldn't really find a better spot.Thanks

    You are missing the position parameter:
    set echo on
    drop table t1;
    drop table t2;
    drop table t3;
    create table t1 (fld1 varchar2(5), fld2 varchar2(10), fld3 varchar2(10),
    fld4 varchar2(10) );
    create table t2 (fld1 varchar2(5), fld2 varchar2(10), fld3 varchar2(10),
    fld4 number );
    create table t3 (fld1 varchar2(5), fld2 varchar2(10), fld3 varchar2(10),
    fld4 varchar2(10), fld5 varchar2(10) );
    load data
    infile *
    append
    into table mpowel01.t1
    when (fld1 = 'T1' )
    ( fld1 terminated by ',',
    fld2 terminated by ',',
    fld3 terminated by ',',
    fld4 terminated by whitespace)
    into table mpowel01.t2
    when (fld1 = 'T2' )
    ( fld1 position(1) terminated by ',',
    fld2 terminated by ',',
    fld3 terminated by ',',
    fld4 terminated by whitespace)
    into table mpowel01.t3
    when (fld1 = 'T3' )
    TRAILING NULLCOLS
    ( fld1 position(1) terminated by ',',
    fld2 terminated by ',',
    fld3 terminated by ',',
    fld4 terminated by ',',
    fld5 terminated by whitespace)
    BEGINDATA
    T1,one,one,one
    T2,two,two,2
    T3,three,three,three,three
    UT1 > select * from t3;
    FLD1 FLD2 FLD3 FLD4 FLD5
    T3 three three three three
    UT1 > select * from t2;
    FLD1 FLD2 FLD3 FLD4
    T2 two two 2
    UT1 > select * from t1;
    FLD1 FLD2 FLD3 FLD4
    T1 one one one
    HTH -- Mark D Powell --

  • How can I attach multiple photos to an email using IOS 8.1.1

    I am trying to avoid having to attach one photo at a time when emailing a group.

    One option that you have is to go to the Photos App and go to your Camera Roll or where you have the pictures you want to send, then click on the select option at the top right side and select all the pictures you want to email.
    Once you selected everything then click on the share button at the bottom and do the following depending on the number of photos:
    - If you want to send 5 or less then you can select the mail option and this will create a draft with your pictures and then you can just add the address
    - If you  to send more than 5 then you can select copy, then go to the mail app, create a new email, press and hold on the text section and then select paste, all your pictures will be copied and then just add the address you need.
    Hope this helps.

Maybe you are looking for

  • Cisco E4200 and VPN and Vontage Phone service.

     I have a E4200 Router. I would like to  subscribe to a VPN service and possiby flash the router with DD-WRT so I can take advantge of of the VPN across my network and allow my various clents ( Roku, Boxee Box, etc ) to have access to the VPN.  My qu

  • Changing customer number in alv top of page for every new customer

    hi experts, in alv grid display top-of- page, how to change customer number  customer name for every new customer. please help me. Regards Naveen.

  • Why can't I get a real estimate for outage restoration?

    I'm part of a group outage (12) in the Malvern PA area. We've been down for close to 3 days now. The estimated restoration time keeps getting bumped by 16 hours - I.e. it's not real; it's made up/automatic. I need to be able to plan meetings, etc (I

  • Can't export to Photoshop

    After I hit the "Edit" button in lightroom 2 (I have Windows), the top left corner says "preparing file for editing" puts a new copy in the filmstrip and then just freezes. Any Ideas what I can do? Thanks

  • I have 3 photo albums that I can't remove from my iPod

    I have 3 photo albums on my iPod that I would like to remove, but can't.  Is there any way that I can get rid of the albums and not lose any of my music or other info stored on the iPod?