Variables to store DBLINK's?

Hi everyone,
I'm an OBIEE developer and totally new to Apex. Just having three days experience in APEX.
We are having only one schema configured with APEX. But we need to show data from different databases. So we created many DB links for connecting to different schemas using only one schema.
We are intend to create an application with two pages.
In our second page we are showing a table view which should be editable. so we selected report with form option.
In our first page we are having a list in which we show all of the available db links. user needs to select a db link in this page. Based on their selection, the table in the second page should come from the selected db link.
the table is present in all the schemas. so our problem is how to fetch a particular table based on the schema selected.
i think this should be already discussed some where. But im totally new to this. dont know where to start. Any help on this will be appreciated..
thanks,
Karthick

Hi,
You can create a form based on a table. If you have a lot of columns then I'd probs suggest this & then remove the extra stuff produced like "Process Row of xxx" process. Instead you want two (or one with IFs) processes for update & insert e.g. UPDATE table@&P3_DBLINK. set .... where ....Assuming it's page 3 & you have a hidden item there too.
The alternative would be to just create a HTML page & add a text field for each row but that could be a bit annoying if you have 50 columns & creating an empty local table for the first option would be quicker.
Mike

Similar Messages

  • How to insert delay without using loops, and how can I use variable to store data in labview

    Hi all,
    I am new to Labview and I realized that quite often I am in condition to require a delay beween two functions or elements.. how can we insert a delay in such cases?
    I know how to use delays in a loop. but don't know how to inser some time delay between two elements.
    I have one more question, I know its a bad practice to post 2 questions in 1 thread.
    How can I use a temporary variable to store data, So far I am storing it in an indicator by making it invisible in front panel and making local variable of that indicator, is it the right way to do it ?
    Thanks in advance.

    Generally, LV doesn't have variables in the same sense that most languages do. You can use indicators to perform the same function as variables, but as Adnan pointed out, you run the risk of having race condition and it creates data copies, which is a problem if you have a lot of data. In most cases, you should use wires to perform the function of variables, which is to store data and make it available to the different functions in your code. Instead of thinking about variables, you need to think about data (something like "I have the data coming out of this function. Where does it need to go?").
    Try to take over the world!

  • UDF -Golobal variables to store the data

    Hi,
    We are sending order information to source system (SAP).
    Here i need to chk in message mapping : if it is the
    first time we received that order into SAP or not.
    As per the expert suggestion its better to use global variable and store the order no and compare it the next time it comes.
    Let me know the UDF code.
    Thanks
    MMV

    HI,
    Refer below blog
    /people/miguel.jorge/blog/2006/10/10/interesting-use-of-global-variables
    Here you can maintain the Global variable and then in 1st mapping assign the value for it as had shown in UDF code in blog and then innext mapping check the value of global variable.
    BUT...as per your suggestion I doubt how you will maintain multiple order information in Global variables.
    Better to go for Either DB / RFC Lookup here you can maintain the table and can check from it whether the Order information is previously send or not
    For db/rfc lukup refer to:
    Lookup’s in XI made simpler : DB lukup
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    RFC Mapping Lookups
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    Thanks
    Swarup

  • How do I create variables and store them?

    How do I create variables and store them?

    As someone already said, we need to know a little more about what you want to do with these variables, but in general, APEX Items are probably what you want. You can create APEX Items at the Application or Page level. Once you set the value of an item, you can reference it anywhere else in the application. So, if you have an item on page 1 called P1_ENAME, you can reference it on page 32 using bind variable syntax :P1_ENAME. If you just want to store but not display some information, you can use either a hidden page item or an Application Level item. Take a look at the 2 Day Developers Guide for more info.
    Tyler

  • OpenScript script variables - can store multiple values or an array?

    Hello,
    I'm helping with a proof-of-concept for driving the Primavera P6 web services using OpenScript, and I'm having a bit of trouble using the script variables. One of the web services can return anywhere from 0 to many objects, and I was trying to save those object IDs into a script variable. The built-in "substitute variable" seemed to work great, but the variable only contains the last result, not all of them. Here's the line that's saving the value:
    http.solve("objIdsToDelete", "<ObjectId>(.+?)</ObjectId>", "", true, Source.Html, 0, EncodeOptions.None);
    Even if there are, for example, 5 <ObjectId> in the response, the variable only has the last result... Any suggestions on how I can tweak this (different regular expression?) to either store an array or a comma-separated list of all the values?
    Thanks!
    -Troy Newton

    Hi Troy,
    Sorry about my last answer. It wasn't too specific. So if you want to collect the whole array instead of a specific value (referenced by the index) you would change e.g.
    http.solve("formsload.loginsubmit_1",
                                  "FORM_SUBMIT_BUTTON':'(.+?)'", "", false, Source.Html,
                                  1, EncodeOptions.None);
    which would give you the second value from the array (remember that arrays are indexed from 0) to
    http.solve("formsload.loginsubmit_1",
                                  "FORM_SUBMIT_BUTTON':'(.+?)'", "", false, Source.Html,
                                  null, EncodeOptions.None);
    Notice the null, this will return an array to the coolection. You can then reference these by:
              String myStrings[]=getVariables().getAll("formsload.loginsubmit_1");
                        info("Number of elements in array is :" + myStrings.length);
                        for (int i=0;i<myStrings.length;i++)
                             info("Element Number " + i + ":" + myStrings [ i ] );
    This will result in an output like:
    0 Passed Comments: Number of elements in array is 2
    0 Passed Comments: Element Number 0: Submit Button
    0 Passed Comments: Element Number 1: Cancel
    I hope this helps.....
    Regards
    Wayne.
    Edited by: byrne_wayne on Nov 26, 2010 1:40 PM
    Edited by: byrne_wayne on Nov 26, 2010 4:42 PM

  • Variable to store a result of a complex calculation in bex query

    Hello all,
    I've got a query in BEX with some key fields to display and also need to perform some calculations not supported in bex formulas.
    I think this could be made in a BEX user exit and I'm trying this by creating a project in CMOD assigning EXIT_SAPLRR0_001... Working with INCLUDE ZXRSRU01 and so on.
    I just want to know if this is possible this way because I execute my query and the variable created never get any value at runtime.
    Could anybody help me or give an idea on how to use BEx user-exits?
    Thank you very much,
    Carlos Hinestrosa.

    Hi!
      I think it should work .here are some links to help topics on using user exits.
    presentations
    https://websmp206.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700005475091999E
    Help:
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
    propably they might help you
    With regards
    Ashwin

  • How to avoid creating a variable to store a temporary value

    This is an artificial example, but it best illustrates what I am trying to do:
    I could create a local variable whose scope doesn't extend beyond the step, but I'd like to avoid that local variable clutter. Or I could dynamically create and delete properties in post expressions, but that would lead to variable names that are invalid at edit-time.  Or I could create a custom Sequence Call step type with a custom subproperty to hold the temporary value, but that is not a very generic solution.
    But really, I'd like to just have two expressions I could use in the sequence Parameter and the Custom Condition that somehow each point to the other, to keep the rest of the step configuration as clean as possible (although the two expressions I am seeking may end up being more complex than the alternatives).  Is this possible?  I think it may be, but I can't figure it out.  One of the alternative solutions wouldn't kill me, but the solution I have in mind would be nicer!

    What you have seems to be the most clear solution to this.  For the dynamic case, if you are worried about errors, you may want to use #NoValidation.  Here's a paragraph from the linked document about using #NoValidation.
    http://zone.ni.com/reference/en-XX/help/370052K-01/tshelp/infotopics/2012whatsnew/
    You can now use the #NoValidation directive in an expression to disable evaluation error checking for part or all of the expression. Use this directive to suppress errors reported at edit time that will not occur at run time, such as using a variable the sequence creates at run time by using the TestStand API. Use this directive without a parameter list to suppress error checking for the remainder of the expression or pass a separate expression as the parameter to this directive to suppress error checking for only the parameter expression.
    Jesse S.
    Applications Engineer
    National Instruments

  • CONVERSION OF 1 TABLE TO ACCOMODATE MORE FIELDS USING TEMP VARIABLE IN STORE PROC

    USE [FacetsXR]
    GO
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[frdmrpt].[pr_pha_BiometricsSummary]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [frdmrpt].[pr_pha_BiometricsSummary]
    GO
    CREATE PROCEDURE [frdmrpt].[pr_pha_BiometricsSummary]
    AS
    BEGIN
    DECLARE @partcTot int
    select @partcTot = [frdmrpt].[fn_pha_total_participants](default);
    DECLARE @TEMPTAB TABLE
    SortOrder varchar(10),
    BIMEASURE VARCHAR(30) NULL,
    RC VARCHAR(100) NULL,
    N VARCHAR(5) NULL,
    PSP VARCHAR(10) NULL,
    AVL VARCHAR(10) NULL
    -- HEADER ROW
    --INSERT @TEMPTAB VALUES('00','Biometric Measure','Risk Citeria','N','Percent Of Screened Population','Average Value')
    --BMI
    declare @BMI int
    select @BMI = count(*)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.BMI is not null and hra.BMI != 0.0
    declare @BMIavg float
    select @BMIavg = cast(isnull(AVG(BMI),0.0) as decimal (5,1))
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.BMI is not null
    INSERT @TEMPTAB VALUES('100','BMI','.',@BMI,'.',@BMIavg)
    INSERT @TEMPTAB
    SELECT SortOrder,RiskCriteria, BS.Risk_Criteria,COUNT(*) Total,CAST((CAST(([frdmrpt].[fn_pha_percent](COUNT(*), @BMI)) AS VARCHAR(100))) AS VARCHAR(100))+'%'
    FROM
    SELECT
    CASE
    WHEN (BMI > 0 AND BMI <= 17.4) THEN '101'
    WHEN BMI BETWEEN 17.5 AND 18.4 THEN '102'
    WHEN BMI BETWEEN 18.5 AND 24.9 THEN '103'
    WHEN BMI BETWEEN 25.0 AND 29.9 THEN '104'
    WHEN BMI >=30.0 THEN '105'
    END AS SortOrder,
    CASE
    WHEN (BMI > 0 AND BMI <= 17.4) THEN 'Very Underweight'
    WHEN BMI BETWEEN 17.5 AND 18.4 THEN 'Underweight'
    WHEN BMI BETWEEN 18.5 AND 24.9 THEN 'Normal'
    WHEN BMI BETWEEN 25.0 AND 29.9 THEN 'Overweight'
    WHEN BMI >=30.0 THEN 'Obese'
    END AS RiskCriteria
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    ) bioSumBI
    INNER JOIN [frdmrpt].[pw_Biometric_Summary] BS
    ON bioSumBI.RiskCriteria = BS.Bimetric_Measure
    AND BS.Bimetric_Category ='BMI'
    WHERE bioSumBI.RiskCriteria is not null
    GROUP BY bioSumBI.SortOrder ,bioSumBI.RiskCriteria,BS.Risk_Criteria,BS.Risk_Higher_Limit
    ORDER BY BS.Risk_Higher_Limit
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='101') = 0
    INSERT @TEMPTAB VALUES('101','Very Underweight','17.4 and below','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='102') = 0
    INSERT @TEMPTAB VALUES('102','Underweight','17.5 to 18.4','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='103') = 0
    INSERT @TEMPTAB VALUES('103','Normal','18.5 to 24.9','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='104') = 0
    INSERT @TEMPTAB VALUES('104','Overweight','25 to 29.9','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='105') = 0
    INSERT @TEMPTAB VALUES('105','Obese','30.0 and above','0','0%','.')
    --BP
    declare @BP INT
    select @BP = count(*)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.Systolic IS NOT NULL AND hra.Diastolic IS NOT NULL
    declare @BPAVG VARCHAR(15)
    select @BPAVG = isnull(CONVERT(VARCHAR(15),AVG(Systolic)) + '/' + CONVERT(VARCHAR(5),AVG(Diastolic)),0)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.Systolic IS NOT NULL AND hra.Diastolic IS NOT NULL
    INSERT @TEMPTAB VALUES('200','Blood Pressure (mmHg)','.',@BP,'.',@BPAVG)
    INSERT @TEMPTAB
    SELECT SortOrder ,RiskCriteria, BS.Risk_Criteria,COUNT(*) Total,
    CAST(([frdmrpt].[fn_pha_percent](COUNT(*), @BP)) AS VARCHAR(100))+'%','.'
    FROM
    SELECT
    CASE
    WHEN (Systolic <=119 and Diastolic <=79) THEN 201
    WHEN not (Systolic >= 140 OR Diastolic >=90) and not (Systolic <=119 and Diastolic <=79) THEN 202 -- basically not high and not low
    WHEN (Systolic >= 140 OR Diastolic >=90) THEN 203
    --WHEN hra.Systolic <=119 OR hra.Diastolic <=79 THEN '201'
    --WHEN (hra.Systolic between 120 AND 139) OR (hra.Diastolic between 80 AND 89) THEN '202'
    --WHEN (hra.Systolic between 140 AND 159) OR (hra.Diastolic between 90 AND 99) THEN '203'
    --WHEN hra.Systolic >= 160 OR hra.Diastolic >= 100 THEN '204'
    END AS SortOrder,
    CASE
    WHEN (Systolic <=119 and Diastolic <=79) THEN 'Low Risk'
    WHEN not (Systolic >= 140 OR Diastolic >=90) and not (Systolic <=119 and Diastolic <=79) THEN 'Moderate Risk'
    WHEN (Systolic >= 140 OR Diastolic >=90) THEN 'High Risk'
    --WHEN hra.Systolic <=119 OR hra.Diastolic <=79 THEN 'Low Risk'
    --WHEN (hra.Systolic between 120 AND 139) OR (hra.Diastolic between 80 AND 89) THEN 'Prehypertension'
    --WHEN (hra.Systolic between 140 AND 159) OR (hra.Diastolic between 90 AND 99) THEN 'Stage I hypertension'
    --WHEN hra.Systolic >= 160 OR hra.Diastolic >= 100 THEN 'Stage II hypertension'
    END AS RiskCriteria
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    ) bioSumBP
    INNER JOIN [frdmrpt].[pw_Biometric_Summary] BS
    ON bioSumBP.RiskCriteria = BS.Bimetric_Measure
    AND BS.Bimetric_Category ='Blood Pressure (mmHg)'
    WHERE bioSumBP.RiskCriteria is not null
    GROUP BY bioSumBP.SortOrder ,bioSumBP.RiskCriteria,BS.Risk_Criteria,BS.Risk_Higher_Limit
    --ORDER BY BS.Risk_Higher_Limit desc
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='201') = 0
    INSERT @TEMPTAB VALUES('201','Low Risk','Systolic: 119 and below Diastolic: 79 and below','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='202') = 0
    INSERT @TEMPTAB VALUES('202','Moderate Risk','Systolic: 120 to 139 Diastolic: 80 to 89','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='203') = 0
    INSERT @TEMPTAB VALUES('203','High Risk','Systolic: 140 and above Diastolic: 90 and above','0','0%','.')
    --Cholestrol
    declare @TC int
    select @TC = count(*)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.TotalCholesterol IS NOT NULL
    declare @TCAVG FLOAT
    select @TCAVG = isnull(ROUND(AVG(TotalCholesterol),0),0)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.TotalCholesterol IS NOT NULL
    INSERT @TEMPTAB VALUES('300','Total Cholesterol (mg/dL)','.',@TC,'.',@TCAVG)
    INSERT @TEMPTAB
    SELECT SortOrder ,RiskCriteria, BS.Risk_Criteria,COUNT(*) Total,
    CAST(([frdmrpt].[fn_pha_percent](COUNT(*), @TC)) AS VARCHAR(100))+'%','.'
    FROM
    SELECT
    CASE
    WHEN hra.TotalCholesterol <= 199 THEN '301'
    WHEN hra.TotalCholesterol between 200 and 239 THEN '302'
    WHEN hra.TotalCholesterol >=240 THEN '303'
    END AS SortOrder,
    CASE
    WHEN hra.TotalCholesterol <= 199 THEN 'Low Risk'
    WHEN hra.TotalCholesterol between 200 and 239 THEN 'Moderate Risk'
    WHEN hra.TotalCholesterol >=240 THEN 'High Risk'
    END AS RiskCriteria
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    ) bioSumHDL
    INNER JOIN [frdmrpt].[pw_Biometric_Summary] BS
    ON bioSumHDL.RiskCriteria = BS.Bimetric_Measure
    AND BS.Bimetric_Category ='Total Cholesterol (mg/dL)'
    WHERE bioSumHDL.RiskCriteria is not null
    GROUP BY bioSumHDL.SortOrder ,bioSumHDL.RiskCriteria,BS.Risk_Criteria,BS.Risk_Higher_Limit
    ORDER BY BS.Risk_Higher_Limit
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='301') = 0
    INSERT @TEMPTAB VALUES('301','Low Risk','199 and below','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='302') = 0
    INSERT @TEMPTAB VALUES('302','Moderate Risk','200 to 239','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='303') = 0
    INSERT @TEMPTAB VALUES('303','High Risk','240 and above','0','0%','.')
    --HDL
    declare @HDL int
    select @HDL = count(*)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE HDL IS NOT NULL
    declare @HDLAVG FLOAT
    select @HDLAVG = isnull(ROUND(AVG(HDL),0),0)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE HDL IS NOT NULL
    INSERT @TEMPTAB VALUES('400','HDL (mg/dL)','.',@HDL,'.',@HDLAVG)
    INSERT @TEMPTAB
    SELECT SortOrder ,RiskCriteria, BS.Risk_Criteria,COUNT(*) Total,
    CAST(([frdmrpt].[fn_pha_percent](COUNT(*), @HDL)) AS VARCHAR(100))+'%','.'
    FROM
    SELECT
    CASE
    WHEN hra.HDL >= 60 THEN '401'--'Desirable'
    WHEN hra.HDL between 40 and 59 THEN '402' --'Borderline Risk'
    WHEN hra.HDL <=39 THEN '403' --'Undesirable Risk'
    END AS SortOrder,
    CASE
    WHEN hra.HDL >= 60 THEN 'Low Risk'--'Desirable'
    WHEN hra.HDL between 40 and 59 THEN 'Moderate Risk' --'Borderline Risk'
    WHEN hra.HDL <=39 THEN 'High Risk' --'Undesirable Risk'
    END AS RiskCriteria
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    ) bioSumHDL
    INNER JOIN [frdmrpt].[pw_Biometric_Summary] BS
    ON bioSumHDL.RiskCriteria = BS.Bimetric_Measure
    AND BS.Bimetric_Category ='HDL (mg/dL)'
    WHERE bioSumHDL.RiskCriteria is not null
    GROUP BY bioSumHDL.SortOrder ,bioSumHDL.RiskCriteria,BS.Risk_Criteria,BS.Risk_Higher_Limit
    ORDER BY BS.Risk_Higher_Limit desc
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='401') = 0
    INSERT @TEMPTAB VALUES('401','Low Risk','60 and above','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='402') = 0
    INSERT @TEMPTAB VALUES('402','Moderate Risk','40 to 59','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='403') = 0
    INSERT @TEMPTAB VALUES('403','High Risk','39 and below','0','0%','.')
    --LDL
    declare @LDL DECIMAL
    select @LDL = count(*)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.LDL IS NOT NULL
    declare @LDLAVG FLOAT
    select @LDLAVG = isnull(ROUND(AVG(LDL),0),0)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.LDL IS NOT NULL
    INSERT @TEMPTAB VALUES('500','LDL (mg/dL)','.',@LDL,'.',@LDLAVG)
    INSERT @TEMPTAB
    SELECT SortOrder ,RiskCriteria, BS.Risk_Criteria,COUNT(*) Total,
    CAST(([frdmrpt].[fn_pha_percent](COUNT(*), @LDL)) AS VARCHAR(100))+'%','.'
    FROM
    SELECT
    CASE
    WHEN hra.LDL <= 129 THEN '501'
    WHEN hra.LDL between 130 and 159 THEN '502' --'Borderline Risk'
    WHEN hra.LDL >=160 THEN '503' --'Undesirable Risk'
    END AS SortOrder,
    CASE
    WHEN hra.LDL <= 129 THEN 'Low Risk'--'Desirable'
    WHEN hra.LDL between 130 and 159 THEN 'Moderate Risk' --'Borderline Risk'
    WHEN hra.LDL >=160 THEN 'High Risk' --'Undesirable Risk'
    END AS RiskCriteria
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    ) bioSumHDL
    INNER JOIN [frdmrpt].[pw_Biometric_Summary] BS
    ON bioSumHDL.RiskCriteria = BS.Bimetric_Measure
    AND BS.Bimetric_Category ='LDL (mg/dL)'
    WHERE bioSumHDL.RiskCriteria is not null
    GROUP BY bioSumHDL.SortOrder ,bioSumHDL.RiskCriteria,BS.Risk_Criteria,BS.Risk_Higher_Limit
    ORDER BY BS.Risk_Higher_Limit
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='501') = 0
    INSERT @TEMPTAB VALUES('501','Low Risk','129 and below','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='502') = 0
    INSERT @TEMPTAB VALUES('502','Moderate Risk','130 to 159','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='503') = 0
    INSERT @TEMPTAB VALUES('503','High Risk','160 and above','0','0%','.')
    --Blood Glucose (mg/dL)
    declare @BG int
    select @BG = count(*)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.BloodGlucose IS NOT NULL
    declare @BGAVG FLOAT
    select @BGAVG = ROUND(AVG(BloodGlucose),0)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.BloodGlucose IS NOT NULL
    INSERT @TEMPTAB VALUES('600','Blood Glucose (mg/dL)','.',@BG,'.','NA' )--@BGAVG)
    INSERT @TEMPTAB
    PRESENT CODE FOR ATTACHED TABLE SELECT SortOrder ,RiskCriteria, BS.Risk_Criteria, Total,
    CAST(([frdmrpt].[fn_pha_percent](Total, @BG)) AS VARCHAR(100))+'%','.'
    FROM
    SELECT
    CASE
    WHEN (r.RiskLevel='LOW') THEN '601'
    WHEN (r.RiskLevel='MODERATE') THEN '602'
    WHEN (r.RiskLevel='HIGH') THEN '603'
    END AS SortOrder,
    CASE
    WHEN (r.RiskLevel='LOW') THEN 'Low Risk'
    WHEN (r.RiskLevel='MODERATE') THEN 'Moderate Risk'
    WHEN (r.RiskLevel='HIGH') THEN 'High Risk'
    END AS RiskCriteria,
    CASE
    WHEN (r.RiskLevel='LOW') THEN cast(COUNT(*)AS VARCHAR(100))
    WHEN (r.RiskLevel='MODERATE') THEN cast(COUNT(*)AS VARCHAR(100))
    WHEN (r.RiskLevel='HIGH') THEN cast(COUNT(*)AS VARCHAR(100))
    END AS Total
    From [frdmrpt].[wt_rpt_pha_pw_UserHealthRisks] r
    join [frdmrpt].[wt_rpt_pha_pw_Member] m on m.UserID = r.UserID
    join [frdmrpt].[wt_rpt_pha_pw_HRADetail2] d on d.UserID = m.UserID
    where r.RiskStringID = 'BLOODGLUCOSE'
    group by GROUPING sets ( r.RiskLevel, () )
    ) bioSumHDL
    INNER JOIN [frdmrpt].[pw_Biometric_Summary] BS
    ON bioSumHDL.RiskCriteria = BS.Bimetric_Measure
    AND BS.Bimetric_Category ='Blood Glucose (mg/dL)'
    WHERE bioSumHDL.RiskCriteria is not null
    GROUP BY bioSumHDL.SortOrder ,bioSumHDL.Total,bioSumHDL.RiskCriteria,BS.Risk_Criteria,BS.Risk_Higher_Limit
    ORDER BY BS.Risk_Higher_Limit
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='601') = 0
    INSERT @TEMPTAB VALUES('601','Low Risk','Fasting: 70 to 99 Random: 80 to 139','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='602') = 0
    INSERT @TEMPTAB VALUES('602','Moderate Risk','Fasting: 100 to 125 Random: 140 to 199','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='603') = 0
    INSERT @TEMPTAB VALUES('603','High Risk','Fasting: 126 and above Random: 200 and above','0','0%','.')
    --Triglycerides (mg/dL)
    declare @TRG int
    select @TRG = count(*)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.Triglycerides IS NOT NULL
    declare @TRGAVG FLOAT
    select @TRGAVG = isnull(ROUND(AVG(Triglycerides),0),0)
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    WHERE hra.Triglycerides IS NOT NULL
    INSERT @TEMPTAB VALUES('700','Triglycerides (mg/dL)','.',@TRG,'.',@TRGAVG)
    INSERT @TEMPTAB
    SELECT SortOrder ,RiskCriteria, BS.Risk_Criteria,COUNT(*) Total,
    CAST(([frdmrpt].[fn_pha_percent](COUNT(*), @TRG)) AS VARCHAR(100))+'%','.'
    FROM
    SELECT
    CASE
    WHEN hra.Triglycerides <=149 THEN '701'
    WHEN hra.Triglycerides between 150 and 199 THEN '702'
    WHEN hra.Triglycerides >= 200 THEN '703'
    END AS SortOrder,
    CASE
    WHEN hra.Triglycerides <=149 THEN 'Low Risk'
    WHEN hra.Triglycerides between 150 and 199 THEN 'Moderate Risk'
    WHEN hra.Triglycerides >= 200 THEN 'High Risk'
    END AS RiskCriteria
    FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ON hra.UserID = mems.UserID
    ) bioSumHDL
    INNER JOIN [frdmrpt].[pw_Biometric_Summary] BS
    ON bioSumHDL.RiskCriteria = BS.Bimetric_Measure
    AND BS.Bimetric_Category ='Triglycerides (mg/dL)'
    WHERE bioSumHDL.RiskCriteria is not null
    GROUP BY bioSumHDL.SortOrder ,bioSumHDL.RiskCriteria,BS.Risk_Criteria,BS.Risk_Higher_Limit
    ORDER BY BS.Risk_Higher_Limit
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='701') = 0
    INSERT @TEMPTAB VALUES('701','Low Risk','149 and below','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='702') = 0
    INSERT @TEMPTAB VALUES('702','Moderate Risk','150 to 199','0','0%','.')
    IF (Select COUNT(*) from @TEMPTAB where SortOrder ='703') = 0
    INSERT @TEMPTAB VALUES('703','High Risk','200 and above','0','0%','.')
    SELECT BIMEASURE,RC ,N ,PSP ,AVL FROM @TEMPTAB order by SortOrder
    END
    GO
    GRANT EXECUTE ON [frdmrpt].[pr_pha_BiometricsSummary] to FRDM_END_USER_ROLE
    GO

    work done so far(I will aprreciate your input and suggestions to complete this.Thanks
    CREATE PROCEDURE [frdmrpt].[pr_pha_T1T2_BiometricsSummaryTest]
    AS
    BEGIN
    DECLARE @partcTot int
    select @partcTot = [frdmrpt].[fn_pha_total_participants](default);
    DECLARE @TEMPTAB TABLE
    SortOrder varchar(10),
    BIMEASURE VARCHAR(30) NULL,
    RC VARCHAR(100) NULL,
    N_T1 VARCHAR(5) NULL,
    PSP_T1 VARCHAR(10) NULL,
    AVL_T1 VARCHAR(10) NULL,
    N_T2 VARCHAR(5) NULL,
    PSP_T2 VARCHAR(10) NULL,
    AVL_T2 VARCHAR(10) NULL
    -- HEADER ROW
    --INSERT @TEMPTAB VALUES('00','Biometric Measure','Risk Citeria','N','Percent Of Screened Population','Average Value')
    --BMI
    --declare @BMI int
    --select @BMI = count(*)
    ---FROM [frdmrpt].[wt_rpt_pha_pw_HRADetail2] hra
    ---INNER JOIN [frdmrpt].[wt_rpt_pha_pw_Member] mems
    ---ON hra.UserID = mems.UserID
    --WHERE hra.BMI is not null and hra.BMI != 0.0
    declare @BMI_T1 int
    select @BMI_T1 = count(*)
    FROM [frdmrpt].wt_pha_T1T2_HRADetail2 hra
    INNER JOIN [frdmrpt].wt_pha_T1T2_Member mems
    ON hra.UserID = mems.UserID and hra.T1T2=mems.T1T2
    WHERE hra.BMI is not null and hra.BMI <> 0.0 and mems.T1T2 = 'T1'
    --SELECT @BMI_T1
    declare @BMI_T2 int
    select @BMI_T2 = count(*)
    FROM [frdmrpt].wt_pha_T1T2_HRADetail2 hra
    INNER JOIN [frdmrpt].wt_pha_T1T2_Member mems
    ON hra.UserID = mems.UserID and hra.T1T2=mems.T1T2
    WHERE hra.BMI is not null and hra.BMI <> 0.0 and mems.T1T2 = 'T2'
    ---SELECT @BMI_T2
    declare @BMIavg_T1 float
    select @BMIavg_T1 = cast(isnull(AVG(BMI),0.0) as decimal (5,1))
    FROM [frdmrpt].wt_pha_T1T2_HRADetail2 hra
    INNER JOIN [frdmrpt].wt_pha_T1T2_Member mems
    ON hra.UserID = mems.UserID
    WHERE hra.BMI is not null --and hra.BMI <> 0.0
    and mems.T1T2 = 'T1'
    --SELECT @BMIavg_T1

  • Get all parameters pass to a powershell script and store it in a variable

    Hi,
    Test.ps1 A B C D E F
    1. How may I get how many parameters was pass to the commandline?
    2. I would like storing A B C D E F in a variable and store Test.ps1 $arguments in VariableWithCommandLine.
    New-Item -path $path -Name test2.ps1 -type file -Value "VariableWithCommandLine"
    Thanks,

    Why this is not working?
    [CmdletBinding()]
    Param (
     [Parameter(Mandatory=$True)]   
     [ValidateSet('Install','Repair','Uninstall', 'MAJ')]  
     [string]$DeploymentType = 'Install',
     [Parameter(Mandatory=$false)]   #Paramètre obligatoire? $True $False
     [ValidateSet('Interactive','Silent','NonInteractive')] #Silent = No dialogs (progress and balloon tip notifications are supressed)
     #NonInteractive = Very silent, i.e. no blocking apps. Noninteractive mode is automatically set if an SCCM task sequence or session 0 is detected.
     [string]$DeployMode = 'Interactive'
    $args

  • Urgent help required...for replacing JSP session variables

    I am trying to enhance the performance of a j2ee based webapp which use session variables to store the data...
    Is there any alternative for session variables..The project is based on j2ee-Struts frame work..But the amount of code maintainance should be minimum ....so i can't create beanforms for all these data...
    Is there any XML based methods available...??

    ok... thanks... i created a fla file and inthe action script
    pasted the following code
    var nc:NetConnection = new NetConnection();
    nc.connect("rtmp://flash.ispstream.com/ondemand/unikron/my_video_dj/");
    var ns:NetStream = new NetStream(nc);
    contentMain.myVideo.attachVideo(ns);
    ns.setBufferTime(5);
    ns.play("dvd_r");
    nothing is working if i tried to load... can u help me out

  • Can F4IF_INT_TABLE_VALUE_REQUEST FM return a value in a global variable?

    Hi everybody,
    I need to use F4IF_INT_TABLE_VALUE_REQUEST FM because I have to let users select an specific option before choosing another value. The point is that I need to save in a program global variable what the user selects, and decide something with it in the program.
    Is it possible that F4IF_INT_TABLE_VALUE_REQUEST FM returns the value in a sinple variable or it has to be paramter?
    I look in a lot of previous threads but I didn't find anything, and I don't know if it's possible.
    Thanks and kind regards,
    MMP.

    Hi,
    Sure you can. All you need to do is to store what the function returns in your global variable. It don't need to be returned back to screen field.
    DATA: BEGIN OF VALUES OCCURS 0,
             CARRID TYPE SPFLI-CARRID,
             CONNID TYPE SPFLI-CONNID,
           END OF VALUES.
    DATA: VALUES_TAB TYPE TABLE OF VALUES,
              G_VALUE TYPE SPFLI-CONNID.  "global variable to store what is returned
    "in PAI first populate your table
      SELECT  CARRID CONNID
        FROM  SPFLI
        INTO  CORRESPONDING FIELDS OF TABLE VALUES_TAB
        UP TO 10 ROWS.
    "then call the function but don't return the value to screen field
    "If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the useru2019s selection is
    "returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the
    "selection is returned into the table instead.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                RETFIELD         = 'CONNID'
                VALUE_ORG        = 'S'
           TABLES
                VALUE_TAB        = VALUES_TAB
                RETURN_TAB      = RETURN_TAB.
    "now simply read first row of return tab and store the value returned there in some global var
    READ RETURN_TAB INDEX 1.
    MOVE RETURN_TAB-FIELDVAL TO G_VALUE.
    Regards
    Marcin

  • Data Acquisition - using local variables to write data to a file

    Hello,
    I am running a Data Acquisition vi (currently in LabVIEW 7.1 but soon to be updated to 8.2) that collects ~100 parameters of data from several sources contained in a while loop. The current configuration (which I did not write) uses very few subVIs and writes to ~100 local variables to store each parameter. It then reads all the local variables and builds an array of all the strings, converts then to a spreadsheet string, then uses the write characters to file function to append to a datafile. I am trying to clean things up and have came up with subVIs to collect the data from the following sources:
    8 serial port sources collecting btwn 8 and 20 parameters each
    ~15 thermocouple readings
    ~10 analog inputs
    ~20 parameters read off an ARINC 429 bus.
    I have come up with a subVI to read each of the sources and have placed the subVIs in the while loop. Each subVI outputs the data that it collects in array or cluster form. I was wondering how best to write each parameter to a CSV file at between 1 and 10 Hz. Should I write each subVI output to a LV and then read them off as was done before (the difference being that I have reduced the # of LVs to ~10 vs >100?
    I should add that precise timing is not that important, so if all the subVIs are not collecting simultaneously (which I understand that they won't be), it does not really matter.
    Thanks.

    Hi jilla,
    jilla wrote:
    What I think that you are saying is to turn the outputs of the 4 subVIs into inputs of a 5th subVI that writes to the data file. Correct?
    Yes.  It may sound like a fine-point, but I beileve it's better to create a VI specifically for formatting data - in your example, 4 arrays IN, a single string OUT.  Then write the string to file as a seperate operation.  GUI-displayed data can go through a similar transformation, the four arrays wired to a subVI which builds output-structures specifically for display.  It's a beginner's mistake to put lots of individual controls and indicators on the screen when groups of them are naturally related (in an object-oriented sense.)  Use clusters to group related controls - this will keep the diagram much cleaner.
    One more question: at what point (either # of data points or frequency of data collection) does it become necessary to use queues? Thanks.
    Well, there's not really a clearly definable "point".  I'd say if your update-rate climbs above 100Hz, or you witness poor program or system performance, then it's time.  The scenario you've described is a fairly simple acquire/display&log loop - and simple is good.   Then-again people can't see/react-to updates faster than about 10Hz - so it doesn't make sense to sacrifice performance - if performance becomes an issue.
    Re: queues:  Queues are sometimes used to buffer data that's "produced" in one place and "consumed" in another.
    Here, if/when logging data, you're logging with every DAQ.  I wouldn't recommend using a queue to transport data from a "DAQ loop" to a "Logging-loop" - those functions can be in the same loop.  Should/could a queue be used to get data from a "DAQ loop" to update the GUI at a lower frequency?  Sure, but a Notifier might be a better choice.   Further, in the (simple?) program you've described, you might use a case structure (True/False) to only update FP indicators every "X" iterations - a simple solution that doesn't require Queues or Notifiers.
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • How to create a table with a variable

    Hi everyone!
    I have a procedure which receives a table name as a parameter and need to create a table using that name
    For example:
    PROCEDURE REFRESH_REPORTS (table_name varchar2) IS
    BEGIN
    table_name_REPORT := table_name;
    execute immediate 'create table table_name_REPORT .....
    But I don't get this working. I am just adding this procedure as a part of a package which is used for web/online reports.
    Could someone guide me on how I could create this table?
    I was getting errors like invalid table name and I even tried to use a variable which stores the entire sql statement and concatenated with the table name's variable but still that was not working.
    Thank You so much in advance.
    Nithya
    Edited by: user645399 on Jan 20, 2010 9:42 PM

    user645399 wrote:
    Thank You so much for the valuable feedback.
    My agency requires some reports to be generated at a certain interval, after a certain type of batch load. A few different types of reports will be generated and usually we have scripts which we run to generate the necessary tables and extract the reports from there. We retain the tables for verification purpose as it stores some valuable status of some customers and so on, which we will not be able to generate again easily. The table will have around 50,000 - 100,000 records averagely. Sometimes more.
    I am automating the process now as per client's request.
    So, I thought of using the same script to automate it in the web. For table name we usually changed them manually.
    Now, when the user runs, he or she have to give them table name/ report name.
    I thought of concatinating the sysdate and report name but what if there is a problem and the user runs it for a second time?
    Unless I have a separate part of the coding to take care of this issue.
    Please advice if there is an alternative.
    Thank You Very Much.
    Cheers!
    NithyaSo why is it necessary to create a table just to create a report?
    You really, really need to rethink this entire process from the beginning, not just try to shoehorn in something from a current, astoundingly bad, design.

  • How to change the variable value at run time in logical column in RPD

    for e.g..
    i have used a session variable in logical column in rpd in case statement. now in dashboard prompt i am using that variable to store data which user is passing but the data captured is not getting reflected in the logical column.
    its been always populated with the default value passed through the initilization block..

    resolved myself

  • Problems using a variable with a tag of a webapp

    I have a webapp where I've built a field in the database for the item is active or not, depending if my client chooses if it's free or not.
    The name of the tag that I want to use as a variable is { tag_estado } and has two values:
    Gratis
    Pago
    When in jQuery I create a variable to store the value of this tag and created a conditional to activate the link and icon of the item, always the tag value prints it on "Pago", even though the webapp item has the value of "Gratis"
    I appreciate your time to help me resolve this issue.
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
              var linkleccionGratis = function() {
                        $(".linkLeccion").attr('href', '{tag_itemurl_withhost}?tab=video');
              var linkleccionPago = function() {
                        $(".linkLeccion").attr('href', '#dataaaaaaaa');
              var imagenGratis = function() {
                        $('.videoIcono').each(function(){
                              //Change the src of each img
                              $(this).attr('src', '/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_1.png');
              var imagenPago = function() {
                        $('.videoIcono').each(function(){
                              //Change the src of each img
                              $(this).attr('src', '/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_0.png');
        var EstadoLeccion = "{tag_estado}";
              if(EstadoLeccion == "Pago"){
                                  linkleccionPago();
                                  imagenPago();
              else if(EstadoLeccion == "Gratis"){
                                  linkleccionGratis();
                                  imagenGratis();
                        else{
                                  linkleccionPago();
    </script>
    <div style="width: 921px; margin-bottom: 10px;">
    <div class="FranjaSuperiorTituloLeccion">
    <div class="TituloContenedorLeccionWebApp">
    <div class="TituloLeccionWebApp">Lecci&oacute;n {tag_num_leccion}: {tag_titulo_leccion}</div> </div> <div class="ImagenesBotonesLeccionWebApp">
    <a class="linkLeccion" href="#data" id="inline"><img alt="Video" class="videoIcono" src="http://www.excelvirtual.org/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_ 0.png" style="margin-top: 6px; width: 31px; height: 31px;" />
    </a>
    </div>
    <div class="ImagenesBotonesLeccionWebApp">{tag_actividad url}</div>
    <div class="ImagenesBotonesLeccionWebApp">
    <a href="{tag_cuestionario}" target="_blank">
    <img alt="Cuestionario" src="http://www.excelvirtual.org/nuevodiseno/images/actividaddef2.png" style="width: 41px; height: 41px;" />
    </a>
    </div>
    </div>
    </div>

    It's tough to tell without seeing the page but it looks like your code may be defaulting to the else statement. You could delete the else and see if it does anything

Maybe you are looking for

  • New iPad has no display in Camera app how do I fix?

    Camera app has been working fine.  Turned it on tonight to photograph something, and there was/is no display.  I've backed out of app numerous times and select it again... same problem.  Both Face Time and Photo Booth apps have proper display but not

  • How do I locate an existing iCal Invitation?

    for weeks iCal has indicated that I have a new event in one of my calendars. I have '1' new marked event. How do I find this event and deal with the invitation?

  • Air for Android video object displays on orientation change

    I have an Android app that plays a video using the normal video object, ie: var nc:NetConnection = new NetConnection(); nc.connect(null); stream = new NetStream(nc); stream.client = this ; stream.addEventListener(NetStatusEvent.NET_STATUS, statusHand

  • Missing Paint Bucket and Paint Drop

    Good morning, I seem to be missing my paint bucket and paint drop.  They are not showing on the icon tool bar.  I have checked in tool icon drop down menu (top left).  I have checked the gradient drop down menu (reached by pressing G when I was in a

  • No 5.1 sound Audigy 2 zs w. Klipsch speak

    I have Audigy 2 zs gamers edition card with Klipsch Pro Media GMX D-5. speakers. Winxp all updates applied, all Audigy updates applied. My problem is that I don't get 5. sound via the Audigy. When I run the creative speaker test or calibration, I onl