SQL query to populate the records, the maximum processed should be less than 10 records per week.

Dear All,
I have a requirement, to write a SQL query to populate the records which are inserted less than 10 no of records.
The tables has the cretaed_date column and along with other key column which will have unique values.
Ex1:  The user might have inserted records from application, per week basis, between the date range '01-jun-2013' - 08-jun-2013  , the no of records created by the user during this week may be less than 10 records or more.
But I want to populate the records by giving date range that too, it should pick the records the count which fall with in 10 records.
I dont want the query to populate the records if the user has inserted more than 10 records in a week.
Ex2:
User 1 has created 15 records during the week 1 ( the query should not populate this ).
User 2: has cretaed less than 10 records from the UI during the week 2. ( This details should get populated ).
Thanks

Use COUNT to find how many rows where inserted in a week.
If this does not answer your question then please read Re: 2. How do I ask a question on the forums? And provide necessary details.

Similar Messages

  • Can we implement the custom sql query in CR for joining the two tables

    Hi All,
    Is there anyway to implement the custom sql query in CR for joining the two tables?
    My requirement here is I need to write sql logics for joining the two tables...
    Thanks,
    Gana

    In the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
    Log on to your data source if necessary.
    Under your data source, double-click the Add Command node.
    In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.
    For example:
    SELECT
        Customer.`Customer ID`,
        Customer.`Customer Name`,
        Customer.`Last Year's Sales`,
        Customer.`Region`,
        Customer.`Country`,
        Orders.`Order Amount`,
        Orders.`Customer ID`,
        Orders.`Order Date`
    FROM
        Customer Customer INNER JOIN Orders Orders ON
            Customer.`Customer ID` = Orders.`Customer ID`
    WHERE
        (Customer.`Country` = 'USA' OR
        Customer.`Country` = 'Canada') AND
        Customer.`Last Year's Sales` < 10000.
    ORDER BY
        Customer.`Country` ASC,
        Customer.`Region` ASC
    Note: The use of double or single quotes (and other SQL syntax) is determined by the database driver used by your report. You must, however, manually add the quotes and other elements of the syntax as you create the command.
    Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.
    For more information about creating parameters, see To create a parameter for a command object.
    Click OK.
    You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.
    Note:
    To construct the virtual table from your Command, the command must be executed once. If the command has parameters, you will be prompted to enter values for each one.
    By default, your command is called Command. You can change its alias by selecting it and pressing F2.

  • SQL query to populate JTable

    I'm trying to create a simple SQL query to populate a JTable. I don't seem to be able to get the syntax correct in order pull the info from an Access database when using a WHERE clause.
    Here is what query looks like.
    "SELECT * FROM Table1 [WHERE Tape  = " + localTape + "]";.
    Any help would be greatly appreciated.

    try using single quotes beforeand after this "+localTape+" as '"+localTape+"' Instead of worry about whether you have used the quotes correctly or not, use a PreparedStatement:
    String sql = "INSERT INTO Page (Name, Title) VALUES (?, ?)";
    PreparedStatement stmt = connection.prepareStatement(sql);
    stmt.setString( 1, "Name1" );
    stmt.setString( 2, "Title1" );
    stmt.executeUpdate();
    the PreparedStatement will worry about the proper formatting of the request.

  • Can I change the size of a photo image to less than 6KB?

    I am trying to reduce the image size on i photo to less than 6KB or to less than 80x80pixels,
    on a photo that was imported from photo booth, is that possible?

    You can certianly get the 80 x 80. Crop the image to square, then File -> Export and you can set the maximum dimension in the Size field in the Export dialogue.
    Regards
    TD

  • SharePoint 2010, Visual Studio 2010, Packaging a solution - The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Hi,
    I have a solution that used to contain one SharePoint 2010 project. The project is named along the following lines:
    <Company>.<Product>.SharePoint - let's call it Project1 for future reference. It contains a number of features which have been named according
    to their purpose, some are reasonably long and the paths fairly deep. As far as I am concerned we are using sensible namespaces and these reflect our company policy of "doing things properly".
    I first encountered the following error message when packaging the aforementioned SharePoint project into a wsp:
    "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."
    I went through a great deal of pain in trying to rename the project, shorten feature names and namespaces etc... until I got it working. I then went about gradually
    renaming everything until eventually I had what I started with, and it all worked. So I was none the wiser...not ideal, but I needed to get on and had tight delivery timelines.
    Recently we wanted to add another SharePoint project so that we could move some of our core functinality out into a separate SharePoint solution - e.g. custom workflow
    error logging. So we created another project in Visual Studio called:
    <Company>.<Product>.SharePoint.<Subsystem> - let's call it Project2 for future reference
    And this is when the error has come back and bitten me! The scenario is now as follows:
    1. project1 packages and deploys successfully with long feature names and deep paths.
    2. project2 does not package and has no features in it at all. The project2 name is 13 characters longer than project1
    I am convinced this is a bug with Visual Studio and/or the Package MSBuild target. Why? Let me explain my findings so far:
    1. By doing the following I can get project2 to package
    In Visual Studio 2010 show all files of project2, delete the obj, bin, pkg, pkgobj folders.
    Clean the solution
    Shut down Visual Studio 2010
    Open Visual Studio 2010
    Rebuild the solution
    Package the project2
    et voila the package is generated!
    This demonstrates that the package error message is in fact inaccurate and that it can create the package, it just needs a little help, since Visual Studio seems to
    no longer be hanging onto something.
    Clearly this is fine for a small time project, but try doing this in an environment where we use Continuous Integration, Unit Testing and automatic deployment of SharePoint
    solutions on a Build Server using automated builds.
    2. I have created another project3 which has a ludicrously long name, this packages fine and also has no features contained within it.
    3. I have looked at the length of the path under the pkg folder for project1 and it is large in comparison to the one that is generated for project2, that is when it
    does successfully package using the method outlined in 1. above. This is strange since project1 packages and project2 does not.
    4. If I attempt to add project2 to my command line build using MSBuild then it fails to package and when I then open up Visual Studio and attempt to package project2
    from the Visual Studio UI then it fails with the path too long error message, until I go through the steps outlined in 1. above to get it to package.
    5. DebugView shows nothing useful during the build and packaging of the project.
    6. The error seems to occur in
    CreateSharePointProjectService target called at line 365 of
    Microsoft.VisualStudio.SharePoint.targetsCurrently I am at a loss to work out why this is happening? My next task is to delete
    project2 completely and recreate it and introduce it into my Visual Studio solution.
    Microsoft, can you confirm whether this is a known issue and whether others have encountered this issue? Is it resolved in a hotfix?
    Anybody else, can you confirm whether you have come up with a solution to this issue? When I mean a solution I mean one that does not mean that I have to rename my namespaces,
    project etc... and is actually workable in a meaningful Visual Studio solution.

    Hi
    Yes, I thought I had fixed this my moving my solution from the usual documents  to
    c:\v2010\projectsOverflow\DetailedProjectTimeline
    This builds ok, but when I come to package I get the lovely error:
    Error 2 The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. C:\VS2010\ProjectsOverflow\DetailedProjectTimeline\VisualDetailedProjectTimelineWebPart\Features\Feature1\Feature1.feature VisualDetailedProjectTimeline
    Now, the error seems to be related to 
    Can anyone suggest what might be causing this. Probably some path in an XML file somewhere. Here is my prime suspect!
    <metaData>
    <type name="VisualDetailedProjectTimelineWebPart.VisualProjectTimelineWebPart.VisualProjectTimeline, $SharePoint.Project.AssemblyFullName$" />
    <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
    </metaData>
    <data>
    <properties>
    <property name="Title" type="string">VisualProjectTimelineWebPart</property>
    <property name="Description" type="string">My Visual WebPart</property>
    </properties>
    </data>
    </webPart>
    </webParts>
    .... Unless I can solve this I will have to remove the project and recreate but with simple paths. Tho I will be none the wiser if I come across this again.
    Daniel

  • TFS Build Error - Exception Message: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters

    I am trying to set-up CI of Orchard CMS and deploy it on Azure using TF service. I am stuck at following error for path being
    longer than 260 characters. However, when counted the total characters in path are 235. Please see the below error :
    Other Errors and Warnings
    1 error(s), 1 warning(s)
    Exception Message: TF400889: The following path contains more than the allowed 259 characters: drop/_PublishedWebsites/Orchard.Web_Package/Archive/Content/C_C/a/src/projects/Orchard/dev/DevAltaf/Orchard/src/Orchard.Web/obj/Debug/Package/PackageTmp/Modules/BrentApart.BannerManager/Scripts/controllers/bannerAssignmentController.js. Specify a shorter path. (type VssServiceException)
    Exception Stack Trace: at Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.EndCopyDirectory(IAsyncResult result)
    at Microsoft.TeamFoundation.Build.Workflow.Activities.CopyDirectory.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
    at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
    Inner Exception Details:
    Exception Message: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. (type PathTooLongException)
    Did anyone came across such issue while deploying Orchard on Azure with TF service? If yes, how did you sort this freaking error?
    Thanks,
    Altaf B.

    Hi AltafB,
    For your situation, you can short the path for the source code. Or use a short path for build agent folder in your build definition. You can refer to the links below to solve your problem:
    http://blogs.msdn.com/b/aaronhallberg/archive/2007/06/20/team-build-and-260-character-paths.aspx
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/1638a5f0-9321-4ff9-9ee7-6d347badb972/please-some-solution-to-the-specified-path-file-name-or-both-are-too-long?forum=tfsbuild
    Besides, since you deploy Orchard to Azure, you can also publish it directly using publish profile in Visual Stduio or WebMatrix directly.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The amount of down payment must be less than the invoice amount

    Hi all,
    Our customers are using SAP 2007-PL15 and SAP 2007-PL41.
    When we want to create a down payment for a sales order, and we want to pay the entire amount of the sales order, including tax, we have to put an amount inthe TOTAL field of the Down Payment window since by default, the down payment amount is the total of the invoice before applying tax.  The DPM is
    higher than 100% (strange but I think it's normal since the down payment is not planned to take the tax in consideration).
    Then, we create an incoming payment for this down payment. It's ok.
    Then, we create an invoice based on the sales order we have paid with the down payment. It's impossible to use the down payment for the invoice... why that ? We receive the error 'The amount of down payment must be less than the invoice amount'. This causes big headaches to our customers !!
    Could you explain us what to do please ?
    thanks,
    Luce

    I'm very sorry, I have a similar question in dealing with AP Down Payment Request Linked to AP Invoice,  my case like this:
    1. I created 3 AP DPRs,their amount are each 100,000 RMB(for example, their document number are 10,11,12). then do the outgoing payment fully paided.
    2. I created a AP Invoice with the amount 150,000 RMB(for example, this AR Invoice document number is 5). I use the buttom"Total Down Payment",and selecet AP DRP No.10 and 11. When I click the buttom"Add",an error shows:
    The amount of down payment must be less than the invoice amount
    and I don't know how to continue.....
    Many Thanks
    Kam
    (PS:My English is poor,forgive me please. Shall I Speak in Chinese? then I can describe this question more clearly.)

  • Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Hi, Im trying to get the whole path in my server, so i tried that with this following code
    Get-ChildItem $sourceFolder  -Recurse | ?{$_.PsIsContainer} |Get-Acl
    But then, it showed me somtehing like this :
    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
     I tried to find the solver everywhere and mostly they propose to change the path name, which is impossible, since I am working with my company server, and those folder have already there before i start to work here, then the other ask me to use robocopy,
    but all of the trick just dont work
    is there any way to solve this problem? thanks

    There is no simple solution to this. And it is not a limitation of powershell itself, but of the underlying NTFS file system.
    If the problem is that a folder with a name longer than 248 exists anywhere within your directory structure, you are hooped.
    If the problem is that some fully qualified path names exceed 260 characters, then, in those cases, the solution already given is to create a psdrive partway up the path from the drive letter or server/share root of the path. Unfortunately, the output produced
    will be relative to that psdrive and not to what is specified as the $sourcefolder.
    unless you already know where those problematic paths are, you might consider trying to trap those errors and have your script figure out where it needs to create psdrives. You might then be able to calculate the equivalent path for each file or folder and
    output that. the programming effort would be simpler to just created a psdrive for each folder encountered, however I expect that would be very inefficient.
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • How do i deauthorize one computer in itunes when the limit of 5 authorizations was reached less than one year ago?

    How do I deauthorize just one PC in itunes when the limit of 5 authorizations was met less than one year ago?

    the authorized 5 are one computer

  • Rogers is saying that IOS4 won't allow use of the personal hotspot with a plan of less than 1GB data.  I say it's a policy of theirs, not an iOS restriction.  Anyone know the truth?

    Rogers is saying that IOS4 won't allow use of the personal hotspot with a plan of less than 1GB data.  I say it's a policy of theirs, not an iOS restriction. Anyone know the truth?
    I call BS but the tech guy was insistent that the iPhone can detect what plan I have and won't enable the feature and there's nothing they can do about it, short of selling me a larger data plan...

    robfromkelowna wrote:
    Actually it does.  It's wrong to lie to a customer.  By blaming Apple, they shift the blame and make it seem like there is nothing they can do about it.  If they admitted it was their policy, I could complain and try to get it changed or I could move to another carrier.
    If a person killed someone and blamed it on a heart attack, the person is stil dead, does it matter? Either way they're dead, right...  (extreme, I know, but illustrating a point)
    Wow.
    It is certainly Rogers policy and is not unusual at all among carriers.
    Seems like a non-issue to me, but apparently being "lied to" ( perhaps the employee was simply mistaken, it happens) is a major deal to you.

  • Should i wait for the iPad 3 or get the iPad 2. my birthday is only less than a month away but rumours are that it will be released around my birthday

    should i wait for the iPad 3 or get the iPad 2. my birthday is only less than a month away but rumours are that it will be released around my birthday

    Check with sites like MacWorld, engadget, iLounge, MacRumors, CNET. Latest talk is an early March announcement.

  • OracleBulkCopy have memory leak  if BatchSize is less than record's count.

    OracleBulkCopy::WriteToServer(IDataReader reader) have memory leak if BatchSize property is less than amount of record which were retrieved from IDataReader.
    We know workaround for that, but when this problem will be fixed?
    Code source at the bottom:
    *****************File::Program.cs*****************
    using System;
    using System.Configuration;
    using System.Data;
    using System.Diagnostics;
    using Oracle.DataAccess.Client;
    namespace WindowsApplication
    static class Program
    private static DataTable _testTable = new DataTable("TestData");
    private static int _batchSize = 10000;
    private static int _totalRecordForTest = 100000;
    private static int _bulkTimeOut = 600;
    private static string _targetConnectionString;
    private static string _targetTableName;
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    _testTable.ReadXmlSchema("tmp.data.schema");
    _testTable.ReadXml("tmp.data");
    _targetConnectionString = ConfigurationManager.AppSettings["targetConnectionString"];
    _targetTableName = ConfigurationManager.AppSettings["targetTableName"];
    _batchSize = int.Parse(ConfigurationManager.AppSettings["batchSize"]);
    _totalRecordForTest = int.Parse(ConfigurationManager.AppSettings["totalRecordForTest"]);
    _bulkTimeOut = int.Parse(ConfigurationManager.AppSettings["bulkTimeOut"]);
    PerformCorrectTest();
    Console.WriteLine("Do you want to perform memory leak test?(If no then click cancel key)");
    if (Console.ReadKey().Key != ConsoleKey.Escape)
    PerformMemoryLeakTest();
    Console.ReadKey();
    _testTable =null;
    public static void PerformCorrectTest()
    Console.WriteLine("Managed memory usage: {0}, unmanaged: {1}", GC.GetTotalMemory(false),
    Process.GetCurrentProcess().WorkingSet64);
    using (VirtualSourceReader wrapper = new VirtualSourceReader(new DataTableReader(_testTable), batchSize, totalRecordForTest))
    wrapper.RowsCopied += RowsCopied;
    using (OracleConnection targetConnection = new OracleConnection(_targetConnectionString))
    targetConnection.Open();
    Console.WriteLine("Bulk insert started at {0}", DateTime.Now);
    OracleBulkCopy bc = null;
    try
    bc = new OracleBulkCopy(targetConnection)
    DestinationTableName = _targetTableName,
    BulkCopyTimeout = _bulkTimeOut,
    BatchSize = _batchSize
    do
    bc.WriteToServer(wrapper);
    } while (wrapper.ResetState());
    finally
    if (null != bc)
    bc.Close();
    bc.Dispose();
    targetConnection.Clone();
    Console.WriteLine("Bulk insert completed at {0}", DateTime.Now);
    wrapper.Close();
    Console.WriteLine("Managed memory usage: {0}, unmanaged: {1}", GC.GetTotalMemory(false),
    Process.GetCurrentProcess().WorkingSet64);
    public static void PerformMemoryLeakTest()
    Console.WriteLine("Managed memory usage: {0}, unmanaged: {1}", GC.GetTotalMemory(false),
    Process.GetCurrentProcess().WorkingSet64);
    using (VirtualSourceReader wrapper = new VirtualSourceReader(new DataTableReader(_testTable), totalRecordForTest, totalRecordForTest))
    using (OracleConnection targetConnection = new OracleConnection(_targetConnectionString))
    targetConnection.Open();
    Console.WriteLine("Bulk insert started at {0}", DateTime.Now);
    OracleBulkCopy bc = null;
    try
    bc = new OracleBulkCopy(targetConnection)
    DestinationTableName = _targetTableName,
    BulkCopyTimeout = _bulkTimeOut,
    BatchSize = _batchSize,
    NotifyAfter = _batchSize,
    bc.OracleRowsCopied += OracleRowsCopied;
    bc.WriteToServer(wrapper);
    finally
    if (null != bc)
    bc.Close();
    bc.Dispose();
    targetConnection.Clone();
    Console.WriteLine("Bulk insert completed at {0}", DateTime.Now);
    wrapper.Close();
    Console.WriteLine("Managed memory usage: {0}, unmanaged: {1}", GC.GetTotalMemory(false),
    Process.GetCurrentProcess().WorkingSet64);
    private static void RowsCopied(object sender, long eventArgs)
    Console.WriteLine("Row Processed {0}. Current time is {1}", eventArgs, DateTime.Now);
    private static void OracleRowsCopied(object sender, OracleRowsCopiedEventArgs eventArgs)
    RowsCopied(sender, eventArgs.RowsCopied);
    *****************File::SourceDataReaderWrap.cs*****************
    using System;
    using System.Collections.Generic;
    using System.Data;
    using Oracle.DataAccess.Client;
    namespace WindowsFormsApplication1
    public delegate void OnRowProcessed(object sender, long rowCount);
    public class SourceDataReaderWrap:IDataReader
    protected IDataReader _originalReader;
    protected readonly int _batchSize;
    protected int _currentSessionRows;
    protected long _rowCount;
    public event OnRowProcessed RowsCopied;
    public SourceDataReaderWrap(IDataReader originalReader, int batchSize)
    _originalReader = originalReader;
    _batchSize = batchSize;
    _rowCount = 0;
    #region Implementation of IDisposable
    /// <summary>
    /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
    /// </summary>
    /// <filterpriority>2</filterpriority>
    public void Dispose()
    _originalReader.Dispose();
    _originalReader = null;
    if (RowsCopied != null)
    foreach (OnRowProcessed @delegate in new List<Delegate>(RowsCopied.GetInvocationList()))
    RowsCopied -= @delegate;
    #endregion
    #region Implementation of IDataRecord
    /// <summary>
    /// Gets the name for the field to find.
    /// </summary>
    /// <returns>
    /// The name of the field or the empty string (""), if there is no value to return.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public string GetName(int i)
    return _originalReader.GetName(i);
    /// <summary>
    /// Gets the data type information for the specified field.
    /// </summary>
    /// <returns>
    /// The data type information for the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public string GetDataTypeName(int i)
    return _originalReader.GetDataTypeName(i);
    /// <summary>
    /// Gets the <see cref="T:System.Type"/> information corresponding to the type of <see cref="T:System.Object"/> that would be returned from <see cref="M:System.Data.IDataRecord.GetValue(System.Int32)"/>.
    /// </summary>
    /// <returns>
    /// The <see cref="T:System.Type"/> information corresponding to the type of <see cref="T:System.Object"/> that would be returned from <see cref="M:System.Data.IDataRecord.GetValue(System.Int32)"/>.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public Type GetFieldType(int i)
    return _originalReader.GetFieldType(i);
    /// <summary>
    /// Return the value of the specified field.
    /// </summary>
    /// <returns>
    /// The <see cref="T:System.Object"/> which will contain the field value upon return.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public object GetValue(int i)
    return _originalReader.GetValue(i);
    /// <summary>
    /// Gets all the attribute fields in the collection for the current record.
    /// </summary>
    /// <returns>
    /// The number of instances of <see cref="T:System.Object"/> in the array.
    /// </returns>
    /// <param name="values">An array of <see cref="T:System.Object"/> to copy the attribute fields into.
    /// </param><filterpriority>2</filterpriority>
    public int GetValues(object[] values)
    return _originalReader.GetValues(values);
    /// <summary>
    /// Return the index of the named field.
    /// </summary>
    /// <returns>
    /// The index of the named field.
    /// </returns>
    /// <param name="name">The name of the field to find.
    /// </param><filterpriority>2</filterpriority>
    public int GetOrdinal(string name)
    return _originalReader.GetOrdinal(name);
    /// <summary>
    /// Gets the value of the specified column as a Boolean.
    /// </summary>
    /// <returns>
    /// The value of the column.
    /// </returns>
    /// <param name="i">The zero-based column ordinal.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public bool GetBoolean(int i)
    return _originalReader.GetBoolean(i);
    /// <summary>
    /// Gets the 8-bit unsigned integer value of the specified column.
    /// </summary>
    /// <returns>
    /// The 8-bit unsigned integer value of the specified column.
    /// </returns>
    /// <param name="i">The zero-based column ordinal.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public byte GetByte(int i)
    return _originalReader.GetByte(i);
    /// <summary>
    /// Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.
    /// </summary>
    /// <returns>
    /// The actual number of bytes read.
    /// </returns>
    /// <param name="i">The zero-based column ordinal.
    /// </param><param name="fieldOffset">The index within the field from which to start the read operation.
    /// </param><param name="buffer">The buffer into which to read the stream of bytes.
    /// </param><param name="bufferoffset">The index for <paramref name="buffer"/> to start the read operation.
    /// </param><param name="length">The number of bytes to read.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
    return _originalReader.GetBytes(i, fieldOffset, buffer, bufferoffset, length);
    /// <summary>
    /// Gets the character value of the specified column.
    /// </summary>
    /// <returns>
    /// The character value of the specified column.
    /// </returns>
    /// <param name="i">The zero-based column ordinal.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public char GetChar(int i)
    return _originalReader.GetChar(i);
    /// <summary>
    /// Reads a stream of characters from the specified column offset into the buffer as an array, starting at the given buffer offset.
    /// </summary>
    /// <returns>
    /// The actual number of characters read.
    /// </returns>
    /// <param name="i">The zero-based column ordinal.
    /// </param><param name="fieldoffset">The index within the row from which to start the read operation.
    /// </param><param name="buffer">The buffer into which to read the stream of bytes.
    /// </param><param name="bufferoffset">The index for <paramref name="buffer"/> to start the read operation.
    /// </param><param name="length">The number of bytes to read.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
    return _originalReader.GetChars(i, fieldoffset, buffer, bufferoffset, length);
    /// <summary>
    /// Returns the GUID value of the specified field.
    /// </summary>
    /// <returns>
    /// The GUID value of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public Guid GetGuid(int i)
    return _originalReader.GetGuid(i);
    /// <summary>
    /// Gets the 16-bit signed integer value of the specified field.
    /// </summary>
    /// <returns>
    /// The 16-bit signed integer value of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public short GetInt16(int i)
    return _originalReader.GetInt16(i);
    /// <summary>
    /// Gets the 32-bit signed integer value of the specified field.
    /// </summary>
    /// <returns>
    /// The 32-bit signed integer value of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public int GetInt32(int i)
    return _originalReader.GetInt32(i);
    /// <summary>
    /// Gets the 64-bit signed integer value of the specified field.
    /// </summary>
    /// <returns>
    /// The 64-bit signed integer value of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public long GetInt64(int i)
    return _originalReader.GetInt64(i);
    /// <summary>
    /// Gets the single-precision floating point number of the specified field.
    /// </summary>
    /// <returns>
    /// The single-precision floating point number of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public float GetFloat(int i)
    return _originalReader.GetFloat(i);
    /// <summary>
    /// Gets the double-precision floating point number of the specified field.
    /// </summary>
    /// <returns>
    /// The double-precision floating point number of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public double GetDouble(int i)
    return _originalReader.GetDouble(i);
    /// <summary>
    /// Gets the string value of the specified field.
    /// </summary>
    /// <returns>
    /// The string value of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public string GetString(int i)
    return _originalReader.GetString(i);
    /// <summary>
    /// Gets the fixed-position numeric value of the specified field.
    /// </summary>
    /// <returns>
    /// The fixed-position numeric value of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public decimal GetDecimal(int i)
    return _originalReader.GetDecimal(i);
    /// <summary>
    /// Gets the date and time data value of the specified field.
    /// </summary>
    /// <returns>
    /// The date and time data value of the specified field.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public DateTime GetDateTime(int i)
    return _originalReader.GetDateTime(i);
    /// <summary>
    /// Returns an <see cref="T:System.Data.IDataReader"/> for the specified column ordinal.
    /// </summary>
    /// <returns>
    /// An <see cref="T:System.Data.IDataReader"/>.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public IDataReader GetData(int i)
    return _originalReader.GetData(i);
    /// <summary>
    /// Return whether the specified field is set to null.
    /// </summary>
    /// <returns>
    /// true if the specified field is set to null; otherwise, false.
    /// </returns>
    /// <param name="i">The index of the field to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    public bool IsDBNull(int i)
    return _originalReader.IsDBNull(i);
    /// <summary>
    /// Gets the number of columns in the current row.
    /// </summary>
    /// <returns>
    /// When not positioned in a valid recordset, 0; otherwise, the number of columns in the current record. The default is -1.
    /// </returns>
    /// <filterpriority>2</filterpriority>
    public int FieldCount
    get { return _originalReader.FieldCount; }
    /// <summary>
    /// Gets the column located at the specified index.
    /// </summary>
    /// <returns>
    /// The column located at the specified index as an <see cref="T:System.Object"/>.
    /// </returns>
    /// <param name="i">The zero-based index of the column to get.
    /// </param><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount"/>.
    /// </exception><filterpriority>2</filterpriority>
    object IDataRecord.this[int i]
    get { return _originalReader[i]; }
    /// <summary>
    /// Gets the column with the specified name.
    /// </summary>
    /// <returns>
    /// The column with the specified name as an <see cref="T:System.Object"/>.
    /// </returns>
    /// <param name="name">The name of the column to find.
    /// </param><exception cref="T:System.IndexOutOfRangeException">No column with the specified name was found.
    /// </exception><filterpriority>2</filterpriority>
    object IDataRecord.this[string name]
    get { return _originalReader[name]; }
    #endregion
    #region Implementation of IDataReader
    /// <summary>
    /// Closes the <see cref="T:System.Data.IDataReader"/> Object.
    /// </summary>
    /// <filterpriority>2</filterpriority>
    public void Close()
    _originalReader.Close();
    /// <summary>
    /// Returns a <see cref="T:System.Data.DataTable"/> that describes the column metadata of the <see cref="T:System.Data.IDataReader"/>.
    /// </summary>
    /// <returns>
    /// A <see cref="T:System.Data.DataTable"/> that describes the column metadata.
    /// </returns>
    /// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Data.IDataReader"/> is closed.
    /// </exception><filterpriority>2</filterpriority>
    public DataTable GetSchemaTable()
    return _originalReader.GetSchemaTable();
    /// <summary>
    /// Gets a value indicating the depth of nesting for the current row.
    /// </summary>
    /// <returns>
    /// The level of nesting.
    /// </returns>
    /// <filterpriority>2</filterpriority>
    public int Depth
    get { return _originalReader.Depth; }
    /// <summary>
    /// Gets a value indicating whether the data reader is closed.
    /// </summary>
    /// <returns>
    /// true if the data reader is closed; otherwise, false.
    /// </returns>
    /// <filterpriority>2</filterpriority>
    public bool IsClosed
    get { return _originalReader.IsClosed; }
    #endregion
    /// <summary>
    /// Advances the data reader to the next result, when reading the results of batch SQL statements.
    /// </summary>
    /// <returns>
    /// true if there are more rows; otherwise, false.
    /// </returns>
    /// <filterpriority>2</filterpriority>
    public bool NextResult()
    throw new NotImplementedException();
    /// <summary>
    /// Advances the <see cref="T:System.Data.IDataReader"/> to the next record.
    /// </summary>
    /// <returns>
    /// true if there are more rows; otherwise, false.
    /// </returns>
    /// <filterpriority>2</filterpriority>
    public virtual bool Read()
    if (_batchSize == (_currentSessionRows))
    return false;
    if(_originalReader.Read())
    _currentSessionRows++;
    _rowCount++;
    return true;
    return false;
    /// <summary>
    /// Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
    /// </summary>
    /// <returns>
    /// The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements.
    /// </returns>
    /// <filterpriority>2</filterpriority>
    public int RecordsAffected
    get { throw new NotImplementedException(); }
    public virtual bool ResetState()
    bool result = _currentSessionRows != 0;
    if (result && RowsCopied != null)
    RowsCopied(this, _rowCount);
    _currentSessionRows = 0;
    return result;
    public class VirtualSourceReader:SourceDataReaderWrap
    private readonly int _totalRecordCount;
    public VirtualSourceReader(IDataReader reader, int batchSize, int totalRecordCount)
    :base(reader, batchSize)
    _totalRecordCount = totalRecordCount;
    public override bool Read()
    if (_rowCount >= totalRecordCount || totalRecordCount <= 0)
    return false;
    if (_rowCount == 0)
    return base.Read();
    if (_batchSize == _currentSessionRows)
    return false;
    _currentSessionRows++;
    _rowCount++;
    return true;
    *****************File::tmp.data**********

    You have problem because the batch size property has value *10000* and amount of records(*50000*) bigger than this value.
    You can retrieve workaround from my post (OracleBulkCopy have memory leak  if BatchSize is less than record's count.

  • Report from SQL Query -Excel format only show the first page

    Hi,
    I have some Reports from SQL Query. In the display options, I choose Excel as default format. The Excel documents only show the first page. If I choose HTML as default format, it shows every rows.
    Please advise on how to have a complete Excel document as HTML format does.
    Thanks a lot.
    Lina Han

    I beleive when you export Oracle reports to Excel it is the Data that is transferred along with Column Names.
    You cannot export the variables defined on the report.
    Hence you will not be able to export the Footer to excel. (Still looking into it will let you know if i find anything interesting)
    Regards,
    Bhushan Salgar

  • SQL QUERY TO REMOVE ONE OF THE THE RESULT SET

    Hello Everyone,
    I need some advise on how to achieve the subject. My query is as follows:
    select t2.post_date a, trunc(sysdate - (&num + 1))
    from trans_hist t2
    where t2.post_date >= trunc(sysdate - (&num + 1))
    and 'xxxxxxxxxxxxxxx' in
    (t2.reference_from_account_id, t2.reference_to_account_id)
    and decode(t2.reference_from_account_id,
    'xxxxxxxxxxxxxxx',
    t2.from_account_balance,
    t2.to_account_balance) = 150
    order by t2.post_date
    It will give me the following result:
    4-JUN-2007
    5-JUN-2007
    6-JUN-2007
    I will would to build my query so that it excludes the last row. My aim is to come up with something like the below:
    select max(t2.post_date)
    from trans_hist t2
    where t2.post_date >= trunc(sysdate - (&num + 1))
    and 'xxxxxxxxxxxxxxx' in
    (t2.reference_from_account_id, t2.reference_to_account_id)
    and decode(t2.reference_from_account_id,
    'xxxxxxxxxxxxxxx',
    t2.from_account_balance,
    t2.to_account_balance) = 150
    order by t2.post_date
    Thank you for your help.
    Randy

    maybe something like:
    SQL> with trans_hist as
      2  (select to_date('4-JUN-2007','DD-MON-YYYY') post_date from dual union all
      3   select to_date('5-JUN-2007','DD-MON-YYYY') post_date from dual union all
      4   select to_date('6-JUN-2007','DD-MON-YYYY') post_date from dual)
      5  select * from trans_hist;
    POST_DATE
    04-JUN-07
    05-JUN-07
    06-JUN-07
    SQL> with trans_hist as
      2  (select to_date('4-JUN-2007','DD-MON-YYYY') post_date from dual union all
      3   select to_date('5-JUN-2007','DD-MON-YYYY') post_date from dual union all
      4   select to_date('6-JUN-2007','DD-MON-YYYY') post_date from dual)
      5  select transaction_history.post_date
      6    from (select post_date,
      7                 row_number() over (order by post_date desc) rn
      8            from trans_hist) transaction_history
      9   where transaction_history.rn > 1;
    POST_DATE
    05-JUN-07
    04-JUN-07
    SQL> in your code it will be something like:
    select t3.a, t3.b
      from (select t2.post_date a, trunc(sysdate - (&num + 1)) b,
                   row_number() over (order by t2.post_date desc) rn
              from trans_hist t2
             where t2.post_date >= trunc(sysdate - (&num + 1))
               and 'xxxxxxxxxxxxxxx' in (t2.reference_from_account_id, t2.reference_to_account_id)
               and decode(t2.reference_from_account_id,'xxxxxxxxxxxxxxx',t2.from_account_balance,t2.to_account_balance) = 150) t3
    where t3.rn > 1
    order by t3.a

  • SQL Query report - how to evaluate the current sort column?

    Hi,
    I have a need to determine which column has been selected to sort the current report by. I need to pull this column name and pass it when a button is pressed so that the ensuing PDF report generated using PLPDF will be able to sort the data the same way.
    thanks in advance.

    Hi,
    As i think, you need to create report manually using SQL query and for sorting you can put a drop down box and user can select a field name and shorting type that is ASC or DESC from another drop down and than generate a report, additionally you can have another button for exporting to PDF that you can now manage through PLPDF and you can get the shorting column.
    hope this can help you.
    Thanks,
    Jaydip

Maybe you are looking for

  • Connecting iPOD classic to TV using Apple Component cable

    I have a 80g ipod classic and an apple component AV cable. I am trying to connect this to an TV with component video inputs. This TV is not an HDTV. I have attached the bl gr r cables in the correct position. I am getting a scrambled picture for NTSC

  • Error in configuring JDBC Adapter

    Hi All, I have configured a sender JDBC Adapter with the following parameters. JDBC Drivers: com.microsoft.jdbc.sqlserver.SQLServerDriver Connection: jdbc:microsoft:sqlserver://MIS-SERVER\MIS_DEV_SVR;DatabaseName=SEPG_NEWDB But in Runtime, I am getti

  • SQL Developer does not attach the selected glossary

    I am trying to use a glossary to control abbreviations when generating the Relational Model from the LDM. I go to Tools > Preferences, then select Naming Standards, click on the + to add the glossary, select my glossary, then OK. When I follow that s

  • Problems running bam-config.bat

    hello everybody I m havin a trouble running bam-config.bat this is the problem that I copy from the command prompt, anyone knows what can be doing this problem? This the second machine I m trying to install the TP4 and the first one was Ok and now I

  • VPN Questions

    Hello, I am looking to use the Cisco 3925 to establish site to site VPNs using traditional IPSEC tunneling. One site is using ASA 5510 and I would like to use my existing Cisco 3925 at my site. I have a 100mb pipe between the sites although its not t