Huge memory leaks in using PL/SQL tables and collections

I have faced a very interesting problem recently.
I use PL/SQL tables ( Type TTab is table of ... index by binary_integer; ) and collections ( Type TTab is table of ...; ) in my packages very widely. And have noticed avery strange thing Oracle does. It seems to me that there are memory leaks in PGA when I use PL/SQL tables or collections. Let me a little example.
CREATE OR REPLACE PACKAGE rds_mdt_test IS
TYPE TNumberList IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
PROCEDURE test_plsql_table(cnt INTEGER);
END rds_mdt_test;
CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
PROCEDURE test_plsql_table(cnt INTEGER) IS
x TNumberList;
BEGIN
FOR indx IN 1 .. cnt LOOP
x(indx) := indx;
END LOOP;
END;
END rds_mdt_test;
I run the following test code:
BEGIN
rds_mdt_test.test_plsql_table (1000000);
END;
and see that my session uses about 40M in PGA.
If I repeat this example in the same session creating the PL/SQL table of smaller size, for instance:
BEGIN
rds_mdt_test.test_plsql_table (1);
END;
I see again that the size of used memory in PGA by my session was not decreased and still be the same.
The same result I get if I use not PL/SQL tables, but collections or varrays.
I have tried some techniques to make Oracle to free the memory, for instance to rewrite my procedure in the following ways:
PROCEDURE test_plsql_table(cnt INTEGER) IS
x TNumberList;
BEGIN
FOR indx IN 1 .. cnt LOOP
x(indx) := indx;
END LOOP;
x.DELETE;
END;
or
PROCEDURE test_plsql_table(cnt INTEGER) IS
x TNumberList;
BEGIN
FOR indx IN 1 .. cnt LOOP
x(indx) := indx;
END LOOP;
FOR indx in 1 .. cnt LOOP
x.DELETE(indx);
END LOOP;
END;
or
PROCEDURE test_plsql_table(cnt INTEGER) IS
x TNumberList;
empty TNumberList;
BEGIN
FOR indx IN 1 .. cnt LOOP
x(indx) := indx;
END LOOP;
x := empty;
END;
and so on, but result was the same.
This is a huge problem for me as I have to manipulate collections and PL/SQL tables of very big size (from dozens of thousand of rows to millions or rows) and just a few sessions running my procedure may cause server's fall due to memory lack.
I can not understand what Oracle reseveres such much memory for (I use local variables) -- is it a bug or a feature?
I will be appreciated for any help.
I use Oracle9.2.0.1.0 server under Windows2000.
Thank you in advance.
Dmitriy.

Thank you, William!
Your advice about using DBMS_SESSION.FREE_UNUSED_USER_MEMORY was very useful. Indeed it is the tool I was looking for.
Now I write my code like this
declare
type TTab is table of ... index binary_integer;
res TTab;
empty_tab TTab;
begin
res(1) := ...;
res := empty_tab;
DBMS_SESSION.FREE_UNUSED_USER_MEMORY;
end;
I use construction "res := empty_tab;" to mark all memory allocated to PL/SQL table as unused according to Tom Kyte's advices. And I could live a hapy life if everything were so easy. Unfortunately, some tests I have done showed that there are some troubles in cleaning complex nested PL/SQL tables indexed by VARCHAR2 which I use in my current project.
Let me another example.
CREATE OR REPLACE PACKAGE rds_mdt_test IS
TYPE TTab0 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
TYPE TRec1 IS RECORD(
NAME VARCHAR2(4000),
rows TTab0);
TYPE TTab1 IS TABLE OF TRec1 INDEX BY BINARY_INTEGER;
TYPE TRec2 IS RECORD(
NAME VARCHAR2(4000),
rows TTab1);
TYPE TTab2 IS TABLE OF TRec2 INDEX BY BINARY_INTEGER;
TYPE TStrTab IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
PROCEDURE test_plsql_table(cnt INTEGER);
PROCEDURE test_str_tab(cnt INTEGER);
x TTab2;
empty_tab2 TTab2;
empty_tab1 TTab1;
empty_tab0 TTab0;
str_tab TStrTab;
empty_str_tab TStrTab;
END rds_mdt_test;
CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
PROCEDURE test_plsql_table(cnt INTEGER) IS
BEGIN
FOR indx1 IN 1 .. cnt LOOP
FOR indx2 IN 1 .. cnt LOOP
FOR indx3 IN 1 .. cnt LOOP
x(indx1) .rows(indx2) .rows(indx3) := indx1;
END LOOP;
END LOOP;
END LOOP;
x := empty_tab2;
dbms_session.free_unused_user_memory;
END;
PROCEDURE test_str_tab(cnt INTEGER) IS
BEGIN
FOR indx IN 1 .. cnt LOOP
str_tab(indx) := indx;
END LOOP;
str_tab := empty_str_tab;
dbms_session.free_unused_user_memory;
END;
END rds_mdt_test;
1. Running the script
BEGIN
rds_mdt_test.test_plsql_table ( 100 );
END;
I see that usage of PGA memory in my session is close to zero. So, I can judge that nested PL/SQL table indexed by BINARY_INTEGER and the memory allocated to it were cleaned successfully.
2. Running the script
BEGIN
rds_mdt_test.test_str_tab ( 1000000 );
END;
I can see that plain PL/SQL table indexed by VARCHAR2 and memory allocated to it were cleaned also.
3. Changing the package's type
TYPE TTab2 IS TABLE OF TRec2 INDEX BY VARCHAR2(256);
and running the script
BEGIN
rds_mdt_test.test_plsql_table ( 100 );
END;
I see that my session uses about 62M in PGA. If I run this script twice, the memory usage is doubled and so on.
The same result I get if I rewrite not highest, but middle PL/SQL type:
TYPE TTab1 IS TABLE OF TRec1 INDEX BY VARCHAR2(256);
And only if I change the third, most nested type:
TYPE TTab0 IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
I get the desired result -- all memory was returned to OS.
So, as far as I can judge, in some cases Oracle does not clean complex PL/SQL tables indexed by VARCHAR2.
Is it true or not? Perhaps there are some features in using such way indexed tables?

Similar Messages

  • HUGE memory leak when using MP3

    I downloaded a new FME 2.0 and noticed they added an option
    to stream in MP3 format. DO NOT USE that mode (!). If you start
    streaming in MP3 format you will get a huge memory leak on the
    client side. Your browser starts eating memory like crazy and it
    will bury your machine withing an hour or two by taking all the
    memory available. I have proved it on several machines, notifed
    Adobe. They confirmed it as a bug and promised to fix in the future
    releases. Nice, huh? and what people are supposed to do with the
    current build?

    A new build 2.0.1.1114 has been posted . Please try and let
    us know if you face this issue with this build.

  • Memory leak when using database connectivity toolset and ODBC driver for MySQL

    The "DB Tools Close Connection VI" does not free all the memory used when "DB Tools Open Connection VI" connects to "MySQL ODBC Driver 3.51".
    I have made a small program that only opens and close the connection that I run continously and it's slowly eating all my memory. No error is given from any of the VI's. (I'm using the "Simple Error Handler VI" to check for errors.)
    I've also tried different options in the DSN configuration without any results.
    Attachments:
    TestProgram.vi ‏16 KB
    DSNconfig1.jpg ‏36 KB
    DSNconfig2.jpg ‏49 KB

    Also,
    I've duplicated the OPs example: a simple VI that opens and closes a connection. I can say this definately causes a memory leak.
    Watching the memory:
    10:17AM - 19308K
    10:19AM - 19432K
    10:22AM - 19764K
    10:58AM - 22124K
    Regards,
    Ken
    Attachments:
    OpenCloseConnection.vi ‏13 KB

  • How to use PL/SQL table

    Hi all,
    can you guys suggest me how can I use pl/sql tables for the below query to incresing the performance.
    DECLARE
        TYPE cur_typ IS REF CURSOR;
        c           cur_typ;
        total_val varchar2(1000);
        sql_stmt varchar2(1000);
        freeform_name NUMBER;
        freeform_id NUMBER;
        imgname_rec EMC_FTW_PREVA.EMC_Image_C_Mungo%rowtype;
        imgval_rec  EMC_FTW_PREVA.EMC_Content_C_Mungo%rowtype;
        CURSOR imgname_cur IS
            select * from EMC_FTW_PREVA.EMC_Image_C_Mungo
            where cs_ownerid in (
                        select id from EMC_FTW_PREVA.EMC_Image_C
                        where updateddate > '01-JUN-13'
                        and path is not null
                        and createddate != updateddate)
            and cs_attrid = (select id from EMC_FTW_PREVA.EMC_ATTRIBUTE where name = 'Image_Upload');
    BEGIN
        OPEN imgname_cur;
        LOOP
          FETCH imgname_cur INTO imgname_rec;
          EXIT WHEN imgname_cur%NOTFOUND;
          total_val := 'EMC_Image_C_' || imgname_rec.cs_ownerid;
          sql_stmt := 'SELECT instr(textvalue,''' || total_val || '''), cs_ownerid FROM EMC_FTW_PREVA.EMC_Content_C_Mungo a Where cs_attrid = (select id from EMC_FTW_PREVA.EMC_ATTRIBUTE where name = ' || '''' || 'Body_freeform' || '''' || ')';
            OPEN c FOR sql_stmt;
            LOOP
              FETCH c INTO freeform_id,freeform_name;
              EXIT WHEN c%NOTFOUND;
                                      IF freeform_id > 0 THEN
                dbms_output.put_line (imgname_rec.cs_ownerid || ',' || total_val || ',' || freeform_id || ',' || freeform_name);
                                      END IF;
            END LOOP;
            CLOSE c;     
       END LOOP;
       CLOSE imgname_cur;
    END;
    Thanks in Advance.

    can you guys suggest me how can I use pl/sql tables for the below query to incresing the performance.
    There would be absolutely no point at all in improving the performance of code that has NO benefit.
    The only result of executing that code is to possibly produce some lines of output AFTER the entire procedure if finished:
    dbms_output.put_line (imgname_rec.cs_ownerid || ',' || total_val || ',' || freeform_id || ',' || freeform_name);
    So first you need to explain:
    1. what PROBLEM you are trying to solve?
    2. why you are trying to use PL/SQL code to solve it.
    3. why are you using 'slow by slow' (row by row) processing and then, for each row, opening a new cursor to query more data?
    You should be using a single query rather than two nested cursors. But that begs the question of what the code is even supposed to be doing since the only output is going to a memory buffer.

  • Huge Memory Leak - Need help.

    Hi,
    There is a huge memory leak in our application. Because of this there are frequent session timeout. When we analysed the heap dump using Memory Analyser Tool, we got the leak suspects and the problem suspects are as below:
    One instance of "org.apache.jasper.compiler.JspRuntimeContext" loaded by "org.apache.catalina.loader.StandardClassLoader @ 0x87ff8098" occupies 161,832,200 (23.30%) bytes. The memory is accumulated in one instance of "java.util.concurrent.ConcurrentHashMap$Segment[]" loaded by "<system class loader>".
    One instance of "org.apache.catalina.tribes.tipis.LazyReplicatedMap" loaded by "org.apache.catalina.loader.StandardClassLoader @ 0x87ff8098" occupies 133,578,920 (19.23%) bytes. The memory is accumulated in one instance of "java.util.concurrent.ConcurrentHashMap$Segment[]" loaded by "<system class loader>".
    185 instances of "org.apache.jasper.runtime.BodyContentImpl", loaded by "org.apache.catalina.loader.StandardClassLoader @ 0x87ff8098" occupy 133,502,776 (19.22%) bytes.
    What could be the root cause for this error and how to resolve this?

    First, in general you not provided enough details to get any help. OS? OS version? Hardware specifics?
    Second, are you running custom code? If so, post it so you can get help.
    Third, if you're not running custom code, the odds of you having a "huge memory leak" are pretty small.

  • Firefox 17 huge memory leak

    Since the last update today, Firefox seems to got a huge memory leak. After one hour idle on some pages it was up to 750MB memory usage, and constant 100% load of one CPU core.
    Looks like something is not going well with the garbage collection, if I visit http://www.robertsspaceindustries.com/forums/forum/forum-category-2/ for example.
    Had to disable the graphic hardware acceleration, because of the newly introduced "clear type" font bug.
    Edit: May also be related to mail.google.com, which I have running in an app tab.

    For what it's worth, I had exactly the same problem (except that it's on Linux) since the upgrade to 17.0. When I disabled greasemonkey, the problem instantly disappeared, so it looks like the compatibility with greasemonkey got broken.
    Likewise, I'm very disappointed with the frequent bugs/annoyances that come with the rolling upgrade system; I find myself more and more using Chromium because of it. Mozilla really needs to give people the option to run a stable branch that receives security updates only.

  • List of SQL tables and attributes used in SSRS reports

    Hi,
    I have around 450-500 reports deployed in SSRS reporting server.
    All these reports are built on SQL from multiple databases, and these databases are having unnecessary tables and attributes.
    My requirement is to clean the unused tables and attributes from the databases. For this, I need the list of SQL tables and attributes used in these 450-500 SSRS reports.
    Is there any way to get this data?
    Regards,
    RK

    Hi RK,
    According to your description, you want to get a list of the tables and attributes used in all reports.
    In your scenario, you can query the ReportServer.dbo.Catalog table to get Report name, data source name, dataset name, and query used in the dataset with query below:
    WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition', 'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd )
    SELECT ReportName = name
    ,DataSetName = x.value('(@Name)[1]', 'VARCHAR(250)')
    ,DataSourceName = x.value('(Query/DataSourceName)[1]','VARCHAR(250)')
    ,CommandText = x.value('(Query/CommandText)[1]','VARCHAR(250)')
    ,Fields = df.value('(@Name)[1]','VARCHAR(250)')
    ,DataField = df.value('(DataField)[1]','VARCHAR(250)')
    ,DataType = df.value('(rd:TypeName)[1]','VARCHAR(250)')
    --,ConnectionString = x.value('(ConnectionProperties/ConnectString)[1]','VARCHAR(250)')
    FROM ( SELECT C.Name,CONVERT(XML,CONVERT(VARBINARY(MAX),C.Content)) AS reportXML
    FROM ReportServer.dbo.Catalog C
    WHERE C.Content is not null
    AND C.Type = 2
    ) a
    CROSS APPLY reportXML.nodes('/Report/DataSets/DataSet') r ( x )
    CROSS APPLY x.nodes('Fields/Field') f(df)
    ORDER BY name
    For more information, please refer to this similar thread:
    Extract metadata from report server database
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Design question on using PL/SQL table

    Hi I am doing some data extract and write it to a file. The main table is over 100 million rows. It is is partition by ID. So I am thinking of paralleling it.
    We are on 10g so we can not use the dbms_parallel.
    I would like to use dbms_scheduler or the table function like the Oracle MapReduce example
    However, I am not quite sure how to control the degree of parallism using the Oracle MapReduce
    Moreover the company has the own unix scheduler and I am 90% sure the old-timer would shoot down my idea and urge to use the in-house built scheduler to this kind of parallel job.
    So I would create a procedure that takes a list of ID and then run the extract, write out the file
    and this procedure will call by sqlplus on unix.
    Once all the threads are done, then the unix script will combine all the files produced into one file.
    So my question is how to go about passing IN/OUT of the PL/SQL table and how I can put that PL/SQL table inside of a cursor
    Can someone kind enough to give me some example/sample
    -Thanks so much

    Handle:      vxwo0owxv
    Status Level:      Newbie
    Registered:      Mar 14, 2011
    Total Posts:      88
    Total Questions:      54 (39 unresolved)
    Long on buzz words & short on knowledge to implement ideas!
    vxwo0owxv wrote:
    Hi I am doing some data extract and write it to a file. The main table is over 100 million rows. What % of rows need to be extracted?
    Exactly how do plan on "write it to a file"?
    It is is partition by ID. So I am thinking of paralleling it.Exactly what type of partitioning exists?
    We are on 10g so we can not use the dbms_parallel.
    I would like to use dbms_scheduler or the table function like the Oracle MapReduce examplepost URL to this MapReduce example
    However, I am not quite sure how to control the degree of parallism using the Oracle MapReduce
    Moreover the company has the own unix scheduler and I am 90% sure the old-timer would shoot down my idea and urge to use the in-house built scheduler to this kind of parallel job.
    So I would create a procedure that takes a list of ID and then run the extract, write out the file
    and this procedure will call by sqlplus on unix.Going back out to the OS just to access the DB induces overhead
    >
    Once all the threads are done, then the unix script will combine all the files produced into one file.
    Does order of records in resultant file matter?
    So my question is how to go about passing IN/OUT of the PL/SQL table and how I can put that PL/SQL table inside of a cursor
    Pass from where to where?
    Why PL/SQL table?
    Realize that SQLPLUS knows nothing about PL/SQL table
    Can someone kind enough to give me some example/sampleI could but then we'd both look unprofessional.

  • Dimension build using SQL table and process to fill the SQL table

    I have a dimension in a cube that is manually* built by one of our power users. Now I have to get all the member information of that dimension into a SQL table(example : with columns...level0,level0property,level1,level1property etc....) to use that table in STUDIO for member load.
    Is there any easy process to do this? Currently I am building each and every row manually in that SQL table and there are 1100+ members in that manually built dimension. Please advice.

    Thank you so much Glenn!! That worked!! You make our lives so much easier!!

  • Makequeues memory leak when using Lexmark Z53

    Behavior with printer switched off while connected to built-in USB port:
    Problem 1: makequeues has a memory leak, starting up with between 3 and 5 MB of RAM. This is done by connecting the printer when logged in and watching via Activity Monitor.
    Initially makequeues has sent 255 Mach messages. Every ~10.5 seconds, makequeues sends 59 more messages and gets 53 in reply. With each send/receive cycle, its RAM usage grows by 8 KB, a rate of 780 kiB/min.
    Problem 2: The process is started each time the same printer is reconnected.
    Symptoms: Disconnecting the printer doesn't let the process exit (any instance). If left alone, the memory usage cycle continues.
    The memory leak caught my attention after taking up over a half-gigabyte of RAM when I left the Mac running over night.
    Resolution:
    (1) Disconnect USB cable
    (2) Kill each instance of the process
    Results:
    (1) The process launches after reconnection of the printer with 996 KB of RAM, immediately having sent 60 Mach messages and received 56.
    (2) During this run time, the process may use less and less RAM, down to a minimum of 912.
    (3) After sending 64 more messages without replies, one every 4 seconds, the process exits after having sent a total of 120 messages.
    (4) This behavior (1 through 3) is the same for each process launched as a result of printer reconnection.
    This behavior isn't shown during Safe Mode boot - makequeues never starts up as a result of printer connection.
    PowerMac G4 QuickSilver 2001 733Mhz

    If this is meant to be a bug report, please file a bug report in the proper place. This is a user to user discussion forum.
    As to the source of running 'makequeues' (/System/Library/SystemConfiguration/PrinterNotifications.bundle/Contents/MacOS /makequeues), I would look at the Lexmark software. I currently have two Epson printers connected via USB with CUPS running. I see no process 'makequeues' appearing.
    Matt

  • Firefox 4.0 RC has huge memory leak + slow down problem

    Firefox 4.0 RC Seems to have a huge memory leak issue. After leaving the program open for around half an hour the RAM usage climbs to over 1 gb.
    However, I have 12 gb of physical ram, so firefox staking 1 gb for itself is not too big of a problem (and is probably a blessing as it means it's caching more data), but the problem is that the UI begins to slow down and become clunky after about 30 minutes.
    Browsing, switching tabs, even typing becomes jittery and not very responsive.
    This happens regardless of how many tabs I have open.
    Now it's also crashing every once in a while.

    Even with Firefox 4.0 (Release) running in Safe Mode, with all add-ons and themes disabled, I'm still inclined to think there's something screwy going on here.
    I was watching Page Faults/sec, Page File Bytes and Working Set in Performance Monitor and tailing the Privoxy log for requests. Even with Firefox minimized and "doing nothing" (making no requests, anyway), over the space of a 10 minute period the Working Set grew from 244,375,552 bytes to 274,939,004 bytes (averaging 50,939 bytes/second). This behaviour doesn't seem consistent though - sometimes it doesn't seem to grow at all.
    Additionally the Page Faults/Sec went nuts, accompanied by a step in Page File Bytes and Working Set, whenever a request got made to http://safebrowsing.clients.google.com/safebrowsing/downloads which seems to happens on a regular basis (approximately every 30 minutes).

  • How to fetch the data from a pl/sql table and varray, with some example

    I want to fetch the data using a cursor from Pl/sql table and varry and I want to update the data.
    Please provide me some example.

    PL/SQL Table  - please note that, right term is Associative Array.
    Presumably you are referring to the 'often heated' back-and-forth that sometimes goes on in the forums when people refer to ANY PL/SQL type using a term with the word 'table' in it?
    Curious that you then show an example of a nested table!
    type emp_tab is table of employees%rowtype;
    The 'right term' for that is 'nested table'. The following would be an 'associative array' or 'index-by table'
    type emp_tab is table of employees%rowtype INDEX BY PLS_INTEGER;
    Those used to be called 'PL/SQL tables' or 'index-by tables' but 'associative array' is the current term used.
    Associative Arrays
    An associative array (formerly called PL/SQL table or index-by table) is a set of key-value pairs. Each key is a unique index, used to locate the associated value with the syntax variable_name(index).
    The data type of index can be either a string type or PLS_INTEGER.
    Since the Oracle docs often use 'PL/SQL table' or 'index-by table' it isn't unusual for someone asking a question to use those terms also. Technically the types may not be 'tables' but it's clear what they mean when they use the term.
    In PL/SQL the term 'nested table' is still used even though the PL/SQL collection is not really a table. SQL does have nested tables where the data is actually stored in a table. The PL/SQL  'nested table' type can be used as the source/destination of the SQL data from a nested table so that may be why Oracle uses that term for the PL/SQL type.
    The doc that SKP referenced refers to this use:
    Nested Tables
    In the database, a nested table is a column type that stores an unspecified number of rows in no particular order. When you retrieve a nested table value from the database into a PL/SQL nested table variable, PL/SQL gives the rows consecutive indexes, starting at 1.

  • Memory Leak Issue With Win7 64 bit and Youtube.

    I have a Win7 64 bit using IE9 with version 11.4.402.265 installed. 4 MB installed.
    Whenever I go to Youtube or Liveleak, and watch videos, over time it uses up to 4gigs of my memory! Even if I close the window, it does not free up the memory until I Ctrl/Alt/Delete and shut down the window(s).
    I normally only keep open 1-2 windows. Google toolbar is about the only thing installed. I can open 5 and more tabs, but as long as the site does not use flash, I don't have issues and each window usually uses under 200k memory watching them in task manager.
    When I go to open and watch a youtube video, it slowly climbs to 200k and within an hour, I can be at 2 gigs or more memory and up to 4 gigs within 2 hours (or sometimes much sooner). Closing the window does not release the memory until I end task on it and then after a minute or so, the memory seems to clear and everything is back to normal.
    I searched the forums and seems lots of users, report memory leaks, some using yahoo toolbar installed, which is not my case. I do use yahoo as my e-mail address, no idea if that is related or not. I had the same issue when I had the prior Flash version installed, this has been going on for months. Right now having only this window open, using 129, 192 memory. If I open one more window (using the 64 or 32 bit browser) and start youtube, the memory in that window keeps climbing about 50-100kb a second, so it adds up quickly. I have kaspersky running in the background and that is about it other then my nvida driver setup.
    Really frustrating that so many people here and across the internet have reported this. I did have IE8 a few weeks ago and still had the same issue, upgraded to IE9 to see if that helped.
    Interesting side note, if I pause a video, it slows way down on the memory leak, but still rises at a slower pace. I don't know if this is an IE thing or Flash. I have had this setup since 2009 and don't recall having issues with IE7. I use Youtube so much as a teaching instrument as a music teacher, so constantly have lessons going on it.
    Thanks and hope someone has come up with something. I also build computers and have done some programming, so I could modify a file if needed with clear instructions.

    This could be similar to bug https://bugbase.adobe.com/index.cfm?event=bug&id=3334814

  • Pull data from SQL Table and display it in mail

    I have a requirement to pull the data from SQL table and send it in email.  Currently I am sending the hard coded info in email but is it possible to pull some data from SQL Table and than format it and send it across in the same email? 
    Can you guide me with steps on this.
    Neil

    There are several ways to do this.  First is to populate a file in a data flow and then send that as an attachment in the send mail task. 
    As far as including the results in the email body this becomes a bit trickier.  To use a variable you would need to use an SSIS variable type of
    Object, this is similar to a collection in .NET.  The problem once the object is populated is that it isn't like a readable result set, but again more like an array or a collection.  There is no native method to take the object variable and
    specify .ToString() or cast its results as text.  You would need to iterate through each row and append it to another variable of type string, this could be done with a script task or ForEach container.
    Also you mentioned formatting the results.  What type of formatting were you looking for.  A limitation of the SMTP send mail task is that the message body doesn't support HTML so if you were looking at creating a table within the mail body you
    would have to use a script task or a custom component
    David Dye My Blog

  • SSRS/Powerview to compare SQL table and excel sheet

    I have a SQL table and an excel sheet with some data...
    I want to be able to compare the two and find out which Excel rows are missing in the SQL table...
    Would it be easier to do this report in SSRS or would it be better to do it in Excel PowerView?
    If so how do I go about it?
    Thanks in advance for your help...
    Dhananjay Rele

    Hi Dhananjay,
    According to your description, you want to compare the data of a SQL table and an excel sheet. To achieve this goal, we can create two tables in Reporting Services report, one for SQL table with SQL Server connection type, another for excel sheet with ODBC
    connection type.
    For more details about how to create the report, please see the following steps:
    Create a report server project with SQL Server Data Tools (SSDT) Business Intelligence Templates list.
    Create a new report definition file in Solution Explorer.
    Create a Data Source named DataSource1 with Microsoft SQL Server Type, then select the SQL table database from the corresponding server.
    Create a Data Source named DataSource2 with ODBC Type, then select the excel file.
    Create two datasets which returns the SQL data and Excel sheet data based on the two data source, one for DataSource1, another for DataSource2.
    Create two table next to each other based on the datasets on the design surface.
    References:
    Create a Basic Table Report (SSRS Tutorial)
    Create SSRS report using Excel Data Source Step by Step
    If there are any other questions, please feel free to ask.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • My nano no longer works right.

    I have an iPod Nano first generation and I dropped it and it diplayed the message,"Use iTunes to restore." When I got home and plugged it in , the computer recognised it and said "iTunes has detected an iPod in restore mode, click restore or else iTu

  • Some JPG images, stored in DB, do not display on screen/image item.

    Hi friends, I have a form to save and retrieve images (JPG, GIF, TIF) to and from DB, using WEBUTIL_FILE_TRANSFER.CLIENT_TO_DB and CLIENT_IMAGE.WRITE_IMAGE_FILE respectively. It's working fine, but with few JPG images, it stores in DB but do not disp

  • Items open at login without being listed in login pane under users

    Okay Mail 7.3 and word 2011 are opening at login. Nothing is selected under user preferences. UI know there's a way to stop it

  • T60p AHCI mode is not working

    hi all: my t60p with xp getting slower and slower. so i decided to reinstall os and other software. the problem is: the system would not be able to recognize anything from that "Intel Matrix Storage Manager Driver", even with this newest chipset soft

  • Why you sent very little q'ty iPad mini to Thailand market.?

    Why you sent very little q'ty iPad mini to Thailand market.? It have many people in Thailand interested iPad mini in Thailand but Can't buy it for reseller or operators .  Are you know have many people angry when went to the reseller to buy iPad mini