How to use row count as the starting point for a sequence

I want to create a sequence, which starts with the row count on a table. I used the following, but it's not correct. Please help.
CREATE SEQUENCE "PARTY_POC_S" MINVALUE 1 MAXVALUE 2000000000 INCREMENT BY 1 START WITH
(select count(*) from "S_PARTY") CACHE 20 NOORDER NOCYCLE ;

may be someting like this
NOT RECOMMENDED
DECLARE
  stCount               NUMBER;
BEGIN
  SELECT COUNT (*)
    INTO stcount
    FROM S_PARTY;
  EXECUTE IMMEDIATE    'CREATE SEQUENCE PARTY_POC_S MINVALUE 1 MAXVALUE 2000000000 INCREMENT BY 1 START WITH '
                    || stcount
                    || ' CACHE 20 NOORDER NOCYCLE';
END;

Similar Messages

  • How to Use Row Count Transformation

    Environment: SQL Server 2008 R2
    Purpose: Track number of records, which were loaded into each destination, entity tables or affected by data transaction. Record each table name and the number of records for each  table. 
    Code:
    CREATE TABLE dbo.PkgAudit
    PkgAuditID INT IDENTITY(1, 1),
    PackageName VARCHAR(100),
    LoadTime DATETIME DEFAULT Getdate(),
    Status1 Varchar(50),
    Status2 varchar(20),
    Status3 Varchar(20)
    ETL process: See the following pictures. I have two DFT. Reference to the code in details.
    Click here
    The first one as below
    The second DFT
    Logic: Load the data from the staging table/ If matched with SSN then status is record exists in the pkgAudit table. If not matched, records the number of records and the status is inserted table in the DFT#1 (Step#1)
    In DFT#2, record the name of the tables and number of records for each table
    Expected Results:
    1, Pakage, 20140304 10:24:12:17, 4 loaded, 3 inserted in individual and SSN table, 1  exists in SSN
    Problem: In DFT #1, I placed RowCount Transformation. It generated a couple errors. I also dont know how to concatenate the name of the table and the number of records and the status of the affected table (inserted or exists or loaded).
    I am here to learn as my level of competency is novice. I appreciate the support to ease my learning process. Screen shots is highly appreciated. 
    ~ I tried to load more than picture but the editor allows only 2 pic per post. hope MSDN peeps improve it

    Hi Sandra,
    Thank you for your reply.
    The expression is used for a variable, then the variable can be used in your INSERT statement. According to your screenshot, the PkgAudit table has five columns that you need to insert into. Please refer to the following steps:
    1. Create three Int32 type Package scope variables @TotalCount, @InsertCount, and @MatchCount, and specify their initial value to 4, 3, 1 respectively.
    2. Create three String type variables @NumberofRecords, @Status1, and @Status2. Then, set the ValidateAsExpression property of each variable to True, and set the expression for the three variables as follows:
    NumberofRecords:  (DT_STR,10,1252)@[User::TotalCount] + " loaded"
    Status1:  (DT_STR,10,1252) @[User::InsertCount] + " inserted in individual and SSN table"
    Status2:  (DT_STR,10,1252) @[User::MatchCount] + " in SSN"
    Please refer to the following screenshot:
    3. In the Execute SQL Task, modify your SQLStatement to:
    INSERT INTO dbo.PkgAudit(PackageName
    ,LoadTime
    ,NumberofRecords
    ,Status1
    ,Status2
    ) VALUES(?,?,?,?,?)
    4. Click the Parameter Mapping tab of the Execute SQL Task, and set the parameter mapping as follows (supposing all the columns in the PkgAudit table use varchar data type):
    Regards,
    Mike Yin
    TechNet Community Support

  • How to use row values in Presentation or Administration for calculation

    Hi All,
    I am working on OBIEE, I want to calculate / or % on two rows.
    e.g. In my report row 3 is value 20 and row 5 is value 200.
    In same column row 6 I want to display *(row 5 / row 3 )* 200/ 20 i.e. output should be 10.
    Else can I use variable to and assign value to variable.
    I tried but giving error :
    CASE
    WHEN "Report Structure".Seq = 101 and Currency.Code = 'SAR' THEN
    "Fact Report"."Actual PTD" ,
    VALUEOF("col10") = "Fact Report"."Actual PTD"
    ELSE "Fact Report"."Actual PTD"
    END
    I am trying to store row value to repository variable to solve above problem.
    My question is how to assign value to variable.
    Please guide me to solve this problem.
    Thanks In advance
    Regards
    Dixit

    When you want to compare two row values, you can use the lag and lead analytical function of oracle.
    lag and lead are analytical functions that can be used to get the value of a column in a previous/next row.
    I have made just an example on my blog for a period to period comparison on OBIEE
    http://gerardnico.com/weblog/2009/04/17/obiee-period-to-period-comparison-with-the-analytical-function-laglead/
    And if you want an example on Oracle :
    http://gerardnico.com/wiki/dw/analytic_function/analytic_function_lag
    But I don't understand completely your problem. What about the row 1, 2, 4 ? I don't really see you report.
    What I see, is that you have a problem with the currency.
    You say :
    I am trying to store row value to repository variable to solve above problem.For me, it's not possible...
    Success
    Nico

  • How to use multiple languages at the same time for spell checking?

    I use two different languages all the time and words are mostly so different (English and Finnish) that I could have spell checking on for both languages at the same time.
    Now it seem to allow to select only one language at the time and I have to switch back and fort zillion of times per day.

    Thanks for the quick answer.
    The Dictionary Switcher doesn't seem to work with Finnish language, it doesn't detect it at all to be one of the choices although in the Firefox context menu Languages -> Finnish/Finland is shown.
    Also, if it would work, I would need to get rid of multiple EN_* langauges. I just need EN_UK or EN_US, not all 22 different EN_*.
    One option would be to create a custom dictionary, which would have words from both languages. The next task is then to find out how to make this kind of custom ENFI-dictionary, which would have words from both English and Finnish languages.
    Finnish may be a some kind of special case for spell checking anyway, because the support is in its separate plugin:
    http://voikko.sourceforge.net/

  • Use SLES collector as a starting point for another distro?

    Hello,
    I have a Linux based router/firewall that I want to connect to Sentinel.
    I started writing a custom collector but after seeing the events I can
    see that they are we much like the events that SLES produces.
    So I don't want to start from scratch.
    Can I use the SLES collector as a base and "trick" it into collecting
    events from my router/firewall instead of the events going to the NetIQ
    Universal Collector?
    Thanks.
    -alekz

    alekz;243043 Wrote:
    > Hello,
    > I have a Linux based router/firewall that I want to connect to
    > Sentinel.
    > I started writing a custom collector but after seeing the events I can
    > see that they are we much like the events that SLES produces.
    >
    > So I don't want to start from scratch.
    >
    > Can I use the SLES collector as a base and "trick" it into collecting
    > events from my router/firewall instead of the events going to the NetIQ
    > Universal Collector?
    >
    > Thanks.
    >
    > -alekz
    First thing to check is 'do you need a new collector just for this OS'?
    The NetIQ Universal Collector parses most unix events that we
    currently support across the collectors; in many cases unless you need a
    full dedicated collector for other reasons, it's better to just tack on
    some custom parsing (though custom.js, see 'Collector Customization',
    http://tinyurl.com/loec9qm). If you create a new collector, you have
    to deal with some special problems like device discovery or the manual
    effort of assigning event sources to that collector; so if you're just
    trying to catch something small, extending the Universal collector is a
    good first step to try.
    brandon.langley
    brandon.langley's Profile: https://forums.netiq.com/member.php?userid=350
    View this thread: https://forums.netiq.com/showthread.php?t=50461

  • Default starting point for a search? Stopping a Finder Search?

    "Command F" brings up a search window, defaulted to "This Mac". All too often, I forget to switch the search to my intended target before entering the search criteria. I've got several TB of storage on line, so a "This Mac" Search can take a l-o-n-g time. I can't find a way to stop this search once it's started. Is there a way to set a preference for Find to default to the selected item (disk, folder, or whatever) rather than the whole computer? Am I missing a "cancel" button somewhere?
    Peri

    Backspacing or deleting the search criteria does not work. Once the beach-ball cursor starts spinning, nothing I do has any effect until the search is complete - which may be several minutes.
    On 10.4, there was is an "x" at the lower righthand corner of the search window (next to the search indicator), which would cancel the search. There is no "x" on 10.5.
    Saving a search might be an answer if I repeated the same search frequently, but I don't. Also, I'd have to remember to use the sidebar. If I could remember that, I'd probably could also remember to change the starting point for the search.

  • How to use SQL functions in the queries

    hey guys i wanna know how to use SQL functions in the queries is it possible or not .

    Hi,
    Wat exactly that set values are?
    those from sql query?
    How to use count():
    The COUNT() function returns the number of rows that matches a specified criteria.
    SQL COUNT(column_name) Syntax
    The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
    SELECT COUNT(column_name) FROM table_name
    SQL COUNT(*) Syntax
    The COUNT(*) function returns the number of records in a table:
    SELECT COUNT(*) FROM table_name
    SQL COUNT(DISTINCT column_name) Syntax
    The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
    SELECT COUNT(DISTINCT column_name) FROM table_name
    The IN function helps reduce the need to use multiple OR conditions.
    The syntax for the IN function is:
    SELECT columns
    FROM tables
    WHERE column1 in (value1, value2, .... value_n);

  • Report.Services 2008 - get page-count or row-count in the c#-code

    hello
    is it possible to get from the ReportViewer-control / ServerReport the page-count or row-count after the
    reportViewerCheck.ServerReport.Refresh();
    statement ??
    many thanks in advance for any clue & regards
    Michael

    Hi Michael,
    Yes, you can get them. For row count, you can add a parameter to store the row count of your dataset in your report.
    Here are the steps:
    1.     Add 2 datasets in your report, one for report use and the other on is to row count use. For instance:
    DataSet1: SELECT     HumanResources.vEmployee.* FROM         HumanResources.vEmployee
    DataSet2: SELECT     COUNT(*) FROM         HumanResources.vEmployee
    2.     Add a parameter, set the parameter’s default value set to Get Values from a query and select DataSet2.
    Then, in your ASP.NET web application code you can use the following function to get the row count of the report:
    private int GetReportRowCount(ReportViewer report)
                return Convert.ToInt32(report.ServerReport.GetParameters()[0].Values[0].ToString());
    For page count, you can refer to the following code:
    private int GetReportPageCount(ReportViewer report)
                return report.ServerReport.GetTotalPages();
    You may not get the correct row count and page count in after executing Refresh () method, that’s because when you run this method, it will start another thread to refresh the report and the code below Refresh () method will not wait refreshing complete but run it. For instance, you may get the page count as o if you run the following code in the Button event:
    // Click this Button to refresh the ReportViewer1
            protected void btnGetPageCount_Click(object sender, EventArgs e)
                // Refresh the ReportViewer1
                this.ReportViewer1.ServerReport.Refresh();
                // Get ReportViewer1's page count and display in the txtPageCount TextBox
                this.txtPageCount.Text = this.ReportViewer1.ServerReport.GetTotalPages().ToString();
    You can run the refresh in separate events and get page count in another event, such as below code:
            // Click this Button to refresh the ReportViewer1
            protected void btnGetPageCount_Click(object sender, EventArgs e)
                // Refresh the ReportViewer1
                this.ReportViewer1.ServerReport.Refresh();
            // Display the txtPageCount's text to ReportViewer's page count
            protected void btnGetPageCount2_Click(object sender, EventArgs e)
                // Get ReportViewer1's page count and display in the txtPageCount TextBox
                this.txtPageCount.Text = this.ReportViewer1.ServerReport.GetTotalPages().ToString();
    Hope this helps! I would suggest you post a new thread in Visual Studio Report Controls forum if you need more help about using ReportViewer in ASP.NET web application.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • [Forum FAQ] How to use parameter to control the Expand/Collapse drill-down options in SSRS report?

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

  • How do you remove items from the start up disc

    How do you remove items from the start up disc?

    Freeing Up Space on The Hard Drive
    You can remove data from your Home folder except for the /Home/Library/ folder.
    Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
    Also see Freeing space on your Mac OS X startup disk.

  • Any one knows how to use Axis Framework in the SOAP Adapter Modules

    How to use Axis Framework in the SOAP Adapter?
    How to add custom handler modules?
    http://help.sap.com/saphelp_nw04/helpdata/en/45/a4f8bbdfdc0d36e10000000a114a6b/frameset.htm
    I went through the above link on help.sap.com. But still could not create a working example.
    I have created a wc on some 3ed party app server using apaches axis. I am trying to call that web service from XI using SOAP receiver? I need to add some security related headers to the soap message, SO I am trying to use a handler.  I want to know how to configure this handler in SOAP axis adapter module.
    Thank you
    Moni

    Ravi ,
    I am trying exactly the same. Hers is the scenario.
    ABAP Proxy --> PI (7.0) SP 12 ---> WebService.
    Since This is service is secured, means it is using OASIS web servie securyty user name token,
    I am trying to use AXIS adapter. and I want to configure HandlerBean in which I want to use apache wss4j api to add the userNameToken. I am looking for some documentation on this.
    I need to add SOAP action element too as I can not configure this one on the communication channel.
    Thanks for any inputs in this regard.
    Moni

  • How to use bind variables in the following query

    CREATE OR REPLACE PROCEDURE MMDB.test IS
    sel_qtn VARCHAR2 (10);
    CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
    AND run_id = 100
    a PT_QUANTITY%ROWTYPE;
    BEGIN
    FOR i IN PT_QUANTITY
    loop
    sel_qtn := i.quanttity-1;
    While sel_qtn>=1
    loop
    insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
    sel_qtn :=sel_qtn -1;
    End loop;
    commit;
    end;

    Don't duplicate threads: How to use bind variables in the following query

  • I need to program a Hittite Fractional​-N Synthesize​r Evaluation Kit with a HMC702LP6C​E an external YIG oscillator​. Not sure how to use Labview to control the PLL.

    I need to program a Hittite Fractional-N Synthesizer Evaluation Kit with a HMC702LP6CE an external YIG oscillator.  Not sure how to use Labview to control the PLL.

    Here is how to use the PLL. But I don't know of how to interact with that device
    http://zone.ni.com/devzone/cda/tut/p/id/3781
    And for thouse who don't know what a PLL is a free bonus link is here:
    http://digital.ni.com/public.nsf/allkb/07BC8D77D4E​9AE258625708B007CE74F?OpenDocument
    and a second one on what that device is: http://www.hittite.com/products/view.html/view/HMC​702LP6CE
    Now we are all caught up to speed.
    Sam S
    Applications Engineer
    National Instruments

  • Why is the word count different when I use word count from the tools menu to the number at the bottom of my mac word document

    Why is the word count different when I use word count from the tools menu to the number at the bottom of my mac word document

    This forum is for Apple's defunct office suite 'AppleWorks' - since the word count is not in the places you mention I assume you are talking about Microsoft Word? Though it's just possible someone in this forum might also use Word and know the answer, you would stand a higher chance of getting an answer in Microsoft's own forums. You could also try asking in the forum applicable to your operating system - Lion, Mavericks or whatever - on the reasonably chance of finding someone familiar with Word.

  • Using flex pitch is there a way to fine tune the start point .i'm using it as a audio to  midi function

    using flex pitch is there a way to fine tune the start point .i'm using it as a audio to  midi function

    Thank you for your reply Karsten but unfortunately this didn't help me so far. Or maybe I'm missing something?
    First the link is a tutorial for iMovie on a Mac. I'm using iMovie on iPad so the steps are inapplicable.
    Second it is only possible for me to manipulate the end part of the sound clip to whichever duration I want. But I can't do the same with the 'beginning' of the sound clip.
    I simply want to place some photos in the beginning of my video with no sound in the background then after like 2 secs I want to start the music clip. For some reason that is not possible! Cause every time I drop the music clip unto my project timeline it automatically place it self along with the first frame in the project! And consequently the photos and music are forced to start together.
    Hope I'm making sense...

Maybe you are looking for

  • Problems with Adobe account and Adobe support!

    We bought in December 2012 "Creative Cloud for teams" (10 licenses). I have since started our problems with support Adobe that continue today: ( 1. We do not receive invoices by e-mail - every month we have to ask several times adobe support on the c

  • Why not create an external camera for the first iPad ?

    This will resolve the issue to upgrade IO6 and still available for everyone as supplemental device; this can be used for intrusion detection, or take care of the baby, for examples. Apple meet a problem, and can use it for the best of each other. I u

  • How do i get the text app on my i-pod touch?

    i keep trying to go to my app store but it wont let me log in

  • Teststand report size

    The teststand report size in xml format is almost 200 times bigger than html format. Does anyone know why is this? And how to decrease the xml report size. This is very importment to my application. Thanks Franklin Pang

  • Tab Name Help

    I am building a website with a number of links to PDF files. Each PDF opens in a new tab in the browser, I would like to alter the tittle/name of the tab, however I have been unable to find a way of doing this. Any help with this would be greatly app