Need help using WITH clause

I have an update statement that is using the same suquery twice.
I am not usre if WITh clause be used in update statements?
Is there a way the below statement can be modified to use WITH clause?
UPDATE EMP_TRACKING_LIST L
SET ACTIVE_FLAG = DECODE((SELECT COUNT(*)
FROM EMP_TRACKING_LIST L2
WHERE L.NAME = L2.NAME AND
L.EMP_CODE = L2.EMP_CODE AND
L2.EMP_FLAG = 'Y'), 0, 'N', 'Y')
WHERE ACTIVE_FLAG != DECODE((SELECT COUNT(*)
FROM EMP_TRACKING_LIST L2
WHERE L.NAME = L2.NAME AND
L.EMP_CODE = L2.EMP_CODE AND
L2.EMP_ACTIVE_FLAG = 'Y'), 0, 'N', 'Y')
OR EMP_ACTIVE_FLAG IS NULL;
I would really appreciate your input
Edited by: user10937534 on Sep 2, 2009 4:47 PM

Hi,
WITH comes immediately before SELECT, not before UPDATE.
To use WITH in an UPDATE statement, you would say something like:
UPDATE  EMP_TRACKING_LIST  L
SET     ACTIVE_FLAG =
        WITH  sub_q  AS
            SELECT  ...
        SELECT  ...
        FROM    sub_q  ...
;I don't think there's any way to use values from the sub-query in the WHERE clause of the UPDATE statement itself; MERGE is a much better bet for eliminating redundancy there.
Sorry, I'm not at a database now, so I can test anything.

Similar Messages

  • Need help in 'WITH CLAUSE' Query

    Hello Gurus,
    I am trying to calculate the count of distinct members for each provid.
    I am using the with clause to get information regarding the provid.
       WITH T AS
      (SELECT a.UD_ID MRR_ID,
                            A.UD_LASTNAME LAST_NAME,
                            A.UD_FIRSTNAME FIRST_NAME,
                            COUNT(DISTINCT DP.PA_PROVIDERID) PROVIDERS_ASSIGNED
                       FROM (SELECT UD.UD_ID,
                                    UD_LASTNAME,
                                    UD_FIRSTNAME
                               FROM USER_DETAILS       UD,
                                    MAP_USERS_TO_ROLES MR
                              WHERE MR.MUR_UR_ID_REF = 1000
                                AND MR.MUR_UD_ID_REF = UD.UD_ID) A,
                            D4C_PROVIDER_ASSIGNMENT DP
                      WHERE A.UD_ID = DP.PA_ASSIGNEDTO
                      AND dp.pa_status ='A'
                      GROUP BY A.UD_ID,
                               A.UD_LASTNAME,
                               A.UD_FIRSTNAME
                      ORDER BY 3 DESC)    OUTPUT of just above query without WITH clause.
    MRR_ID     LAST_NAME     FIRST_NAME     PROVIDERS_ASSIGNED
    1229    mrrTest         mrrTest         4
    1228    mrr2Last        mrr2First       5
    1230    mrr1Last        mrr1First       7
    1226    Panwar          SIngh           1
    1181    MRRLast         MRRTest         4
    1221    One             MRR             1
    1322    Thakuria        Bibhuthi        2I am creating this and get all the information to show on front end. Now I want to calculate the no of members as per the providers assigned for each MRR_ID
    Below query show the no of members for all the providers assigned to a provider.
    ex:
    SELECT * FROM (   
    SELECT COUNT(DISTINCT dmpc_hicn) countmember
    FROM D4C_HICN_PROVIDER_claims  a WHERE trim(DPMC_PROVIDER_NO) IN 
    (SELECT trim(pa_providerid)
       FROM d4c_provider_assignment
       WHERE pa_assignedto = 1181  (mrr_id)    --here i have use the mrrid from with clause and get the member count with all the columns coming from WITH CLAUSE.
       AND pa_roleid = 1000
       AND PA_STATUS ='A'
    GROUP BY a.dmpc_ss_id_ref)Right now I am using materialized view i dont wanna use the same..
    I am sending the materialized view code as well what i am doing ..
    ( SELECT SUM(member_count)member_count_bynpi ,mrr_id  FROM (
    (SELECT count(DISTINCT hp.dmpc_hicn) member_count,hp.DMPC_SS_ID_REF ,a1.ud_id mrr_id FROM  D4C_HICN_PROVIDER_claims hp ,
    (SELECT   a.UD_ID ,DP.PA_PROVIDERID
         FROM (SELECT UD.UD_ID, UD_LASTNAME, UD_FIRSTNAME
                 FROM USER_DETAILS UD, MAP_USERS_TO_ROLES MR
                WHERE MR.MUR_UR_ID_REF = 1000
                  AND MR.MUR_UD_ID_REF = UD.UD_ID) A,
              D4C_PROVIDER_ASSIGNMENT DP
        WHERE A.UD_ID = DP.PA_ASSIGNEDTO
        AND dp.pa_status ='A'
        /*AND dp.PA_ASSIGNEDTO = 1221*/) a1
        WHERE trim(a1.PA_PROVIDERID) = trim(hp.dpmc_provider_no)
        GROUP BY a1.ud_id,hp.DMPC_SS_ID_REF))
        GROUP BY mrr_id)Please help me to write the code with the materialized view. Thanks in Advance.
    Kind regards,
    UP
    Edited by: BluShadow on 22-Aug-2011 07:58
    fixed {noformat}{noformat} tags.  Please use lowercase "code" rather than uppercase "CODE" in the tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Probably, this may help
    WITH T1 as(
               SELECT UD.UD_ID,
                      UD_LASTNAME,
                      UD_FIRSTNAME
                FROM USER_DETAILS UD, MAP_USERS_TO_ROLES MR
                WHERE MR.MUR_UR_ID_REF = 1000
                AND MR.MUR_UD_ID_REF = UD.UD_ID)
          T2 as (SELECT a.UD_ID ,DP.PA_PROVIDERID
                 FROM T1 A, D4C_PROVIDER_ASSIGNMENT DP
                 WHERE A.UD_ID = DP.PA_ASSIGNEDTO
                 AND dp.pa_status ='A')
           T3 as(SELECT count(DISTINCT hp.dmpc_hicn) member_count,
                              hp.DMPC_SS_ID_REF ,
                               a1.ud_id mrr_id
                  FROM T2 A1 ,D4C_HICN_PROVIDER_claims hp
                  WHERE trim(a1.PA_PROVIDERID) = trim(hp.dpmc_provider_no)
                  GROUP BY a1.ud_id,hp.DMPC_SS_ID_REF)
    SELECT SUM(member_count)member_count_bynpi ,mrr_id from T3
    GROUP BY mrr_id

  • I cannot use a website I need to use, with Firefox 5.0. So, I need to uninstall and go back to 3.5 or 3.6. Please advise. Also, my control panel locks up since Windows Explorer has pbms. Which is why I am using Firefox instead. Thanks for any help!

    I cannot use a website I need to use, with Firefox 5.0. So, I need to uninstall and go back to 3.5 or 3.6. Please advise. Also, my control panel locks up since Windows Explorer has pbms. Which is why I am using Firefox instead. Thanks for any help!

    ''I figured it was going to be FAFSA causing your problem.''
    Install Portable Firefox 3.6.x to your hard drive for that one website. It won't affect your current Firefox installation at all. <br />
    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • HT5622 i need help using the icloud it is not making any since to me can some one call me and help me with it please don't try to help me through email i need to talk and listen i don't understand instruction by reading

    i need help using the icloud it is not making any since to me can some one call me and help me with it please don't try to help me through email i need to talk and listen i don't understand instruction by reading.
    <Phone Number Edited by Host>

    You aren't addressing anyone from Apple here.  This is a user forum.
    You might want to call a neaby Apple store to see if they have a free class you could attend.

  • Construct a Sql block using With Clause to improve the performance

    I have got four diff parametrized cursor in my Pl/Sql Procedure. As the performance of the Procedure is very pathetic,so i have been asked to tune the Select statements used in those cursors.
    So I am trying to use the With Clause in order to club all those four Select Statements.
    I would appreciate if anybody can help me to construct the Sql Block using With Clause.
    My DB version is..
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    Four Diff cursors are defined below.
    CURSOR all_iss (
          b_batch_end_date   IN   TIMESTAMP,
       IS
          SELECT isb.*
                FROM IMPLMN_STEP_BREKPN  isb
               , ISSUE iss
          WHERE isb.issue_id = iss.issue_id
           AND iss.issue_status_id  =  50738
           AND ewo_no IN
          (SELECT TO_CHAR(wo_no)
            FROM MGO_PLANT_AUDIT
           WHERE dml_status = 'U' OR dml_status = 'I')
          UNION ALL
          SELECT isb.*
           FROM IMPLMN_STEP_BREKPN  isb
            , ISSUE iss
           WHERE isb.issue_id = iss.issue_id
           AND iss.issue_status_id  =  50738
           AND CAST (isb.last_updt_timstm AS TIMESTAMP) >=
                                                                  b_batch_end_date;
          CURSOR ewo_plant  ( p_ewo_no IN  IMPLMN_STEP_BREKPN.ewo_no%TYPE)
          IS
          SELECT DISTINCT wo_no ,
          plant_code
          FROM MGO_PLANT
          WHERE TO_CHAR(wo_no) = p_ewo_no;
          CURSOR iss_ewo_plnt (
          p_issue_id IN IMPLMN_STEP_BREKPN.issue_id%TYPE ,
          p_ewo_no IN IMPLMN_STEP_BREKPN.EWO_NO%TYPE,
          p_plnt_code IN IMPLMN_STEP_BREKPN.PLT_FACLTY_ID%TYPE)
          IS
          SELECT *
          FROM IMPLMN_STEP_BREKPN
          WHERE issue_id = p_issue_id
          AND ewo_no = p_ewo_no
          AND
          (plt_faclty_id = p_plnt_code
          OR
          plt_faclty_id IS NULL);
          CURSOR iss_ewo_plnt_count (
          p_issue_id IN IMPLMN_STEP_BREKPN.issue_id%TYPE ,
          p_ewo_no IN IMPLMN_STEP_BREKPN.EWO_NO%TYPE,
          p_plnt_code IN IMPLMN_STEP_BREKPN.PLT_FACLTY_ID%TYPE)
          IS
          SELECT COUNT(*)
          FROM IMPLMN_STEP_BREKPN
          WHERE issue_id = p_issue_id
          AND ewo_no = p_ewo_no
          AND
          (plt_faclty_id = p_plnt_code
          OR
          plt_faclty_id IS NULL);

    Not tested. Some thing like below. i just made the queries as tables and given name as a,b,c and substituted columns for the parameters used in the 2nd cursor and third cursor. Try like this.
    CURSOR all_iss (
    b_batch_end_date IN TIMESTAMP,
    IS
    select a.*,b.*,c.* from
    ( SELECT isb.*
    FROM IMPLMN_STEP_BREKPN isb
    , ISSUE iss
    WHERE isb.issue_id = iss.issue_id
    AND iss.issue_status_id = 50738
    AND ewo_no IN
    (SELECT TO_CHAR(wo_no)
    FROM MGO_PLANT_AUDIT
    WHERE dml_status = 'U' OR dml_status = 'I')
    UNION ALL
    SELECT isb.*
    FROM IMPLMN_STEP_BREKPN isb
    , ISSUE iss
    WHERE isb.issue_id = iss.issue_id
    AND iss.issue_status_id = 50738
    AND CAST (isb.last_updt_timstm AS TIMESTAMP) >=
    b_batch_end_date) a,
    ( SELECT DISTINCT wo_no ,
    plant_code
    FROM MGO_PLANT
    WHERE TO_CHAR(wo_no) = p_ewo_no) b,
    ( SELECT *
    FROM IMPLMN_STEP_BREKPN
    WHERE issue_id = p_issue_id
    AND ewo_no = p_ewo_no
    plt_faclty_id IS NULL) c
    where b.wo_no = c.ewo_no and
    c.issue_id = a.issue_id ;
    vinodh
    Edited by: Vinodh2 on Jul 11, 2010 12:03 PM

  • I need helping using iAds in my application.

    I need helping using iAds in my application. I currently am not using any storyboards. I am using Sprite builder for my UI.
    I attatched an image ot show all the different file name I have.
    Everyone is being used & they all work fully.
    The "iAdViewController.h & .m" files are just example codes I looked up and was messing with so that my iAd can work.

    I wouldn't even be able to use the Mathscript node in an executable? 
    What I am trying to do is make a user configurable data stream. 
    They tell me how many bytes are in the stream and what parameters they
    want to be put in to it.  Currently I have to make vi's that are
    called dynamicaly to make the parameters.   Then recompile
    the code and send it to them.  This is somewhat of how the config
    file is set up so I know how to make the data.
    Data_Type  foo
    Bytes 30
    parameter_name        
    function           
       byte#          format
    sync              
    foo_sync            
    29               int
    time                              
    foo_time             
    1,2,3,4       double
    If I can't use MathScript to allow the user to make there own functions
    is there another way that I might be able to do this so I do not have
    to recompile the code atleast?  Were I might just be able to make
    the new function and send that to them.
    Any Idea would be great.

  • Re: Beginner needs help using a array of class objects, and quick

    Dear Cynthiaw,
    I just read your Beginner needs help using a array of class objects, and quick of Dec 7, 2006 9:25 PM . I really like your nice example.
    I also want to put a question on the forum and display the source code of my classe in a pretty way as you did : with colors, indentation, ... But how ? In html, I assume. How did you generate the html code of your three classes ? By help of your IDE ? NetBeans ? References ?
    I already posted my question with six source code classes ... in text mode --> Awful : See "Polymorphism did you say ?"
    Is there a way to discard and replace a post (with html source code) in the Sun forum ?
    Thanks for your help.
    Chavada

    chavada wrote:
    Dear Cynthiaw,
    I just read your Beginner needs help using a array of class objects, and quick of Dec 7, 2006 9:25 PM . I really like your nice example.You think she's still around almost a year later?
    I also want to put a question on the forum and display the source code of my classe in a pretty way as you did : with colors, indentation, ... But how ?Just use [code] and [/code] around it, or use the CODE button
    [code]
    public class Foo() {
      * This is the bar method
      public void bar() {
        // do stuff
    }[/code]

  • 'Missing select' error for update statement using WITH clause

    Hi,
    I am getting the below error for update statement using WITH clause
    SQL Error: ORA-00928: missing SELECT keyword
      UPDATE A
      set A.col1 = 'val1'
         where
      A.col2 IN (
      WITH D AS
      SELECT col2 FROM
      (SELECT col2, MIN(datecol) col3 FROM DS
      WHERE <conditions>
        GROUP BY PATIENT) D2
      WHERE
      <conditions on A.col4 and D2.col3>

    Hi,
    The format of a query using WITH is:
    WITH  d  AS
        SELECT  ...  -- sub_query
    SELECT  ...   -- main query
    You don't have a main query.  The keyword FROM has to come immediately after the right ')' that ends the last WITH clause sub-query.
    That explains the problem based on what you posted.  I can't tell if the real problem is in the conditions that you didn't post.
    I hope this answers your question.
    If not, post a complete test script that people can run to re-create the problem and test their ideas.  Include a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Need help using dbms_scheduler to submit an immediate job on the database

    Hi. I need help using dbms_scheduler to submit an immediate job on the database. Essentially I want to issue a one-time call to an Oracle Stored Procedure - this procedure will then send an email. I've never used dbms_scheduler before, but here's what I have so far.
    So my Program is a stored database procedure named 'TTMS.dropperVacationConflict_Notify', but my problem is that I need to pass 3 parameter values to this job each time I run it. This is what I can't figure out. The procedure expects an 'Id' as number(5), begin_dt as a date, and end_dt as a date.
    How do I pass these values when I run my job? Can anyone help?
    begin
        dbms_scheduler.create_program(program_name=> 'PROG_DROPVACCONFLICTS_NOTIFY',
         program_type=> 'STORED_PROCEDURE',
         program_action=> 'TTMS.dropperVacationConflict_Notify',
         number_of_arguments => 3,
         enabled=>true,
         comments=> 'Procedure to notify PCM of a Dropper Vacation Conflict. Pass in Dropper Id, Begin_dt, and End_dt');
    end;
    begin
        dbms_scheduler.create_schedule
        (schedule_name=> 'INTERVAL_EVERY5_MINUTES',
         start_date=> trunc(sysdate)+18/24,
         repeat_interval => 'freq=MINUTELY;interval=5',
         end_date => null
         comments=> 'Runtime: Every day all 5 minutes, forever'
    end;
    begin
        dbms_scheduler.create_job
        (job_name => 'JOB_DROPVACCONFLICTS_NOTIFY',
         program_name => 'PROG_DROPVACCONFLICTS_NOTIFY',
         schedule_name => 'INTERVAL_EVERY5_MINUTES',
         enabled => true,
         auto_drop => true,
         comments => 'Job to notify PCM of Dropper Vacation Conflicts'
    end;
    /And I use this to execute the job as needed...
    begin
        dbms_scheduler.run_job('JOB_DROPVACCONFLICTS_NOTIFY',true);
    end;
    /

    Duplicate Post
    Need help using dbms_scheduler to submit an immediate job on the database

  • Syntax help needed in update using 'WITH' Clause

    Update     CP_JP_CORP_FSASA_FEEDUPLOAD_r r
                             set     (
                                   gfrn,                              
                                   tenor_code,
                                   tenor_description,
                                   exposure_category,          
                                   frr,          
                                   facility_classification,
                                   limit_amount,
                                   limit_usd,
                                   approval_ccy,
                                   approval_date,
                                   expiry_date,
                                   avail_status_code,
                                   avail_status_desc,
                                   revolving_indicator,
                                   committed_flag,
                                   committed_until_date,
                                   committed_amount,
                                   advised_flag,
                                   advised_amount,
                                   facility_long_description,
                                   booking_unit_code,
                                   extending_unit_code,
                                   extending_unit_short_desc,
                                   approving_unit_code,
                                   approving_unit_short_des,
                                   transaction_type,
                                   branch_no
                                   =
                                            With t as
                                                 Select     fac.gfrn,fac.tenor_code,fac.tenor_description,fac.exposure_category,fac.frr,
                                                      fac.facility_classification,fac.limit_amount,fac.limit_usd,fac.approval_ccy,
                                                      fac.approval_date,fac.expiry_date,fac.avail_status_code,fac.avail_status_desc,
                                                      fac.revolving_indicator,fac.committed_flag,fac.committed_until_date,fac.committed_amount,
                                                      fac.advised_flag,fac.advised_amount,fac.facility_long_description,fac.booking_unit_code,
                                                      fac.extending_unit_code,fac.extending_unit_short_desc,fac.approving_unit_code,fac.approving_unit_short_des,
                                                      /*'Check' normalflag,
                                                      cust.adjusted_orr fsasaorr1stborrower,
                                                      'Normal' category1stborrower,
                                                      cust.adjusted_orr fsasaorr2ndborrower,
                                                      'Normal' category2ndborrower,
                                                      cust.adjusted_orr fsasaorrfinal,
                                                      'Normal' categoryfinal */
                                                      txn.transaction_type,txn.branch_no,txn.gfcid,txn.transaction_id
                                                 from     cp_fsa_boj_corp_cr_fac_hist fac,
                                                           --cp_fsa_boj_corp_cr_cust_hist cust,
                                                           cp_fsa_boj_corp_cr_txn_hist txn
                                                 where     fac.gfcid = txn.gfcid
                                                           and fac.facility_id = txn.facility_id
                                                           and fac.as_of_date = txn.as_of_date
                                                           and to_char(fac.as_of_date,'yyyymm') = p_financial_period
                                                           and fac.as_of_date = last_day(fac.as_of_date)
                                            select      t.gfrn,
                                                      t.tenor_code,
                                                      t.tenor_description,
                                                      t.exposure_category,
                                                      t.frr,
                                                      t.facility_classification,
                                                      t.limit_amount,
                                                      t.limit_usd,                                             
                                                      t.approval_ccy,                                             
                                                      t.approval_date,                                             
                                                      t.expiry_date,                                             
                                                      t.avail_status_code,                                             
                                                      t.avail_status_desc,                                             
                                                      t.revolving_indicator,                                             
                                                      t.committed_flag,                                             
                                                      t.committed_until_date,                                             
                                                      t.committed_amount,                                             
                                                      t.advised_flag,                                             
                                                      t.advised_amount,                                             
                                                      t.facility_long_description                                             
                                                      t.booking_unit_code,                                             
                                                      t.extending_unit_code,                                             
                                                      t.extending_unit_short_desc,                                        
                                                      t.approving_unit_code,                                             
                                                      t.approving_unit_short_des,                                             
                                                      t.transaction_type,
                                                      t.branch_no
                                            from     t
                                       where      r.financialperiod           = p_financial_period
                                                 and exists
                                                           Select     1
                                                           from     t
                                                           where     t.transaction_id = r.ce_trans_id
                                                      )I'm facing syntax problem

    Hii All,
    This is my actual update.(I stopped performing dml operations in cursors following Karthick Arp) :-)
    Update     CP_JP_CORP_FSASA_FEEDUPLOAD_r r
                             set     (
                                   gfrn,                              
                                   tenor_code,
                                   tenor_description,
                                   exposure_category,          
                                   frr,          
                                   facility_classification,
                                   limit_amount,
                                   limit_usd,
                                   approval_ccy,
                                   approval_date,
                                   expiry_date,
                                   avail_status_code,
                                   avail_status_desc,
                                   revolving_indicator,
                                   committed_flag,
                                   committed_until_date,
                                   committed_amount,
                                   advised_flag,
                                   advised_amount,
                                   facility_long_description,
                                   booking_unit_code,
                                   extending_unit_code,
                                   extending_unit_short_desc,
                                   approving_unit_code,
                                   approving_unit_short_des,
                                   transaction_type,
                                   branch_no
                                   = (          
                                       Select     fac.gfrn,fac.tenor_code,fac.tenor_description,fac.exposure_category,fac.frr,
                                            fac.facility_classification,fac.limit_amount,fac.limit_usd,fac.approval_ccy,
                                            fac.approval_date,fac.expiry_date,fac.avail_status_code,fac.avail_status_desc,
                                            fac.revolving_indicator,fac.committed_flag,fac.committed_until_date,fac.committed_amount,
                                            fac.advised_flag,fac.advised_amount,fac.facility_long_description,fac.booking_unit_code,
                                            fac.extending_unit_code,fac.extending_unit_short_desc,fac.approving_unit_code,fac.approving_unit_short_des,
                                            txn.transaction_type,txn.branch_no
                                       from     cp_fsa_boj_corp_cr_fac_hist fac,
                                                 --cp_fsa_boj_corp_cr_cust_hist cust,
                                                 cp_fsa_boj_corp_cr_txn_hist txn
                                       where     fac.gfcid = txn.gfcid
                                                 and fac.facility_id = txn.facility_id
                                                 and fac.as_of_date = txn.as_of_date
                                                 and to_char(fac.as_of_date,'yyyymm') = p_financial_period
                                                 and fac.as_of_date = last_day(fac.as_of_date)
                             where Exists
                                                 Select     1
                                                 from     cp_fsa_boj_corp_cr_fac_hist fac,
                                                           cp_fsa_boj_corp_cr_txn_hist txn
                                                 where     fac.gfcid = txn.gfcid
                                                           and fac.facility_id = txn.facility_id
                                                           and fac.as_of_date = txn.as_of_date
                                                           and to_char(fac.as_of_date,'yyyymm') = p_financial_period
                                                           and fac.as_of_date = last_day(fac.as_of_date)
                                                           and txn.transaction_id = r.ce_trans_id
                                            )Now in my update I'm using same 'SELECT' twice once in 'SET' and again in 'EXISTS' clause. I'd like to make use of 'WITH' Clause and avoid unnecessary 'SELECT' . Please help me.

  • Need help using Apple Remote Desktop for remote family members

    I am new to ARD and need help. I know there are solutions to do what I am trying to do through LogMeIn and Teamviewer - but I have LogMein right now and the free edtition is going away and I think Teamviewer will do the same sooner or later. I have remote desktop but hadnt used it, so I thought it would be a good thing to implement so I wont have to worry about paying fees for services like LogMein or teamviewer down the road.  Long story short I need to be able to remote help friends and family members with their macs and using applications, mostly through screen sharing and control and file sharing. All of the folks id like to help have home ( not business style ) internet service whith DHCP and non-static IP's.  I have set this up for myselft to test it and I can be at work and search my homes IP address and I can see all the macs with ARD on them and it all works perfectly.  I have a mac mini running Lion Server so the ports are forwarded to that server at my home - this is the only think I can think of that is making my home work and my friends not.  But when I try to help my friends and family after I type in their IP and it scans it sees their computer - ( it shows a grayed out icon and their IP ) but nothing else.  I cannot control or screen share. It says it cannot verify.  I helped my friends put the ARD client ( most up to date client ) on their macs as well.  I was hoping that using ARD would mean not haivng to set up my friends and family's routers for port fowarding and all those details.  Is there anything I can do using ARD to be able to type in my friends IP address have it scan and then see all their MACS at their home and pick the one that needs attention/ help, without port forwarding or heavy set up ?  I guess the root question here is how or what is best way to set up ARD to be used to help people remotley when they are all home users as well, no port forwarding, no static-IP, that kinda thing.
    Any help is appreciated - Im trying to use ARD and not a 3rd party app since im afraid even if they are free now they wont stay that way. Please let me know throughts and sugesstions ;p)

    I poked around a bit and the file seems to be:
    /Library/Application Support/Macromedia/mms.cfg
    I'd like to get some confirmation from Adobe that this is the correct file to push, though (it seems like it as it only contains this):
    AutoUpdateDisable=0
    SilentAutoUpdateEnable=1

  • External Hard drive help: use with mac and pc? how to backup everything etc

    Hello! I need some help regarding a new external hard drive I got from OWC. It is a 500 gb firewire 400 + usb 2.0 7200 rpm hard drive. I am running it from firewire. The software suggests the first thing you do is make a clone of your macbooks internal hard drive, that way if it fails later you can use the external to back everything up. If I do this ...
    1. do I have to make the drive "Bootable" ? I have software called Data Backup 3 by Pro soft I think. It came with my external.
    2. Can I still back up other stuff like my audio recordings and record onto that drive to a seperate folder?
    3. If I make a bootable copy will it try and boot from the drive everytime I turn it on or something?
    My other question is... how can I use this drive with a pc? I have a pc as well and I heard that the only way it will work is to format it in ms-dos mode (fat32?)
    If I write it to fat32 will it slow down my drive or make it worse? I heard that you should format external drives specifically for mac if you have a mac; so it will only work with macs...
    (sorry this is going on and on; it's like a chain reaction of questions)
    so If its formatted to mac drive format then can I do this with my current situation:
    1. I have wireless internet, the router is on a pc downstairs
    2. Can I send files over a network somehow from the pc to my mac
    3. then store it on my external?
    If so can someone point me in that direction with a link?
    Thank you for reading, sorry for making this so long.

    1. No, you don't have to make a bootable clone.
    2. If you use the drive for a bootable backup, then you cannot use the drive for other types of storage unless you partition the drive and make more than one volume.
    3. No, it will not try to boot the computer. You must designate the startup volume using Startup Disk preferences.
    If you wish to use the drive on both a Mac and a PC, then either you make two partitions - one for Mac and the other for the PC or you must format the entire drive using FAT32 so the drive can be used for read//write by both operating systems. If you do this then you cannot use the drive for a bootable backup nor can you use it with Time Machine.
    FAT32 is slower for read/write on the Mac than using Mac formatting.
    Optimally, I would suggest you partition the drive into two volumes. One volume formatted for the Mac and the other formatted FAT32.
    You can send files from a PC to a Mac and vice-versa using File Sharing. Select Mac Help from the Finder's Help menu and search for "file sharing" or "sharing" to find help articles. Also see,
    Mac OS X 10.5 Help- Setting up a Mac computer to share files with Windows users
    Mac OS X 10.5 Help- Setting up a Windows computer to share files with Mac users
    Mac OS X 10.5 Help- Sharing with Windows computers

  • Need Help/Advice with Photo Web Gallery coming from SQL Database

    This is my first attempt at a database driven website. I assume what I am trying to accomplish should be fairly easy for more experienced but I am stuck at this point.
    First, let me explain what I am trying to accomplish.
    I want to create a thumbnail photo gallery displayed in columns and rows. I want to be able to hover over or click on the thumbnail image and have a lightbox script display the image over the thumb page. I am developing locally right now with intent to upload to the hosting site upon completion.
    I am developing with ASP vbScript pages. I have an SQL database where the paths to the image thumbnails and pictures are stored in a table. On the gallery page, I have created a div tag to hold my image recordset. Within this div, I have inserted 3 absolute positioned divs to hold the pictureID, the pictureName and the image inserted as a datasource. I then inserted the information from the bindings panel of my recordset. Last, I used a horizontal looper extension from Tom Muck to get the thumbnails to display in columns and rows. Everything works up to this point just fine.
    Now, I want to be able to hover or click on a thumnail image and have it displayed in a lightbox. I downloaded and used a javascript called Lightbox 2 which contains 3 javascript files and a css stylesheet. I inserted the files into the head tag like instructed to but could not get things to work properly. Here is where I need help. Currently, I am clicking on the thumbImage binding within the image Div and creating a link holder. I am then binding the larger pictureImage to it with the a.href selected in the bind to. I am then adding the command to call the lightbox javascript. Now, when I test my page, my thumbnail images do not show up (my alt text does in its place) but the links are in place and you can click on the alt text and it will return the correct larger image, but not in the lightbox, just in a new window with no styles.
    Am I going about this correctly? Can you use lightbox scripts with data-driven galleries? Does anybody have any suggestions of what I may be doing wrong or missing? Are there better ways to go about accomplishing this?
    Any help would be appreciated as this dynamic data thing has my head spinning. Although I know a database is needed to simplify the update and maintenance of the photos while allowing them to be searchable by keywords and tags also set up in the database.
    Thanks

    As I explained, I am developing locally a the moment. I will see about getting the databased moved up to the hosting server and then provide a link for an example.
    In the mean time, can you or anyone else explain a way that you would go about displaying an image thumbnail photo gallery laid out in rows / columns, with any lighbox script that would overlay the larger image over the existing page instead of opening a new browser window?
    I don't have to use the method I tried to describe.
    In all of the lightbox examples I have looked at thus far, they give instructions on how to append that javascript to a single static image or a group of static images, not images from a datasource. That is where I am getting confused.
    Don't know if this will help or not but please see code below:
    Javascript and CSS positioned in head tag
    <!--beginning of lightbox script with css -->
    <link href="CSS/lightbox.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/protype.js" type="text/javascript"></script>
    <script src="Scripts/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
    <script src="Scripts/lightbox.js" type="text/javascript"></script>
    <!--end of lightbox script with css -->
    Calling for javascript in the galleryimage div when hovering over thumbnail image
        <!--beginning of gallery div -->
        <div id="gallery">
          <p>
            <!--beginning of galleryImage div -->
          </p>
          <table width="400" border="0" align="center" id="galleryNav2">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
          <p> </p>
          <table align="center" id="HorzLooper">
            <%
    startrw = 0
    endrw = HLooper1__index
    numberColumns = 5
    numrows = 5
    while((numrows <> 0) AND (Not rs_ssfGallery.EOF))
    startrw = endrw + 1
    endrw = endrw + numberColumns
    %>
            <tr align="center" valign="top">
              <%
    While ((startrw <= endrw) AND (Not rs_ssfGallery.EOF))
    %>
              <td><div id="galleryImage">
                <div id="galleryThumb"><a href="images/pic/<%=(rs_ssfGallery.Fields.Item("picture_url").Value)%>"rel="lightbox"><img src="images/thumb/<%=(rs_ssfGallery.Fields.Item("thumb_url").Value)%>" alt="<%=(rs_ssfGallery.Fields.Item("alt_url").Value)%>" /></a></div>
                <div id="galleryImageID"><%=(rs_ssfGallery.Fields.Item("picture_ID").Value)%></div>
                <div id="galleryImageFamily"><%=(rs_ssfGallery.Fields.Item("family").Value)%></div>
              </div></td>
              <%
    startrw = startrw + 1
    rs_ssfGallery.MoveNext()
    Wend
    %>
            </tr>
            <%
    numrows=numrows-1
    Wend
    %>
          </table>
          <p> </p>
          <table width="400" border="0" align="center" id="galleryNav">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
    <!--end of galleryImage div -->
        </div>
        <!--end of gallery div -->
    Thanks for any help or suggestions.

  • Need help ASAP with photoshop elements 11

    Please I need help its photoshop elements 11 but I can't put up the pic I need help with could someone help me out by using Facebook, Amanda Jayne Clarke I have a pic of a little girl n a horse
    Please i need help ASAP

    well you can find many tutorials about how to change background in Photoshop Elements. It ranges all the way from using magic extractor to making a selection using lasso and magnetic lasso tools. But I really prefer using a mask for it. Here is how I would change the background of image A and use Image B as the background.
    Open image B in photoshop elements editor- expert mode.
    go to file->place and choose the image A to place over image B
    go to layers panel by choosing Window-> layers from menu bar. Right click the layer A choose simplify layer.
    with layer A selected, choose layer>layer mask> reveal All from menu bar. It would create a layer mask on the layer A.
    Select the mark layer of layer A, choose the brush tool and change foreground color to black. Paint all over the are you want to remove from the layer A. if you make an error, change the color white to get your image area back. it is a good practice to use lower opacity(~60) while using layer mark as it gives you more control over with how much opacity you want to remove the background
    Happy Editing

  • Need Help Please with Ipod 20G

    Long story short....I had my Ipod 4G and computer stolen several month ago on a business trip(have police report). A friend of mine recently purchased a new Video Ipod and gave me his old 20G...pretty nice of him! I am about to have iTunes loaded on to my new computer. Here are my questions I need help with please.
    1. Will I need to setup a new iTunes account or can I use my old one?
    2. Will I have to reset my newly acquired Ipod before I can place my music on it? I did back up about 80% of the songs from my old Ipod. Or will I be able to keep the 1500 songs my friend placed on it?
    3. Or would it be easier for me to give him back his, cough up the $300 dollars for a new one and start all over?
    Can't think of anything else I might need to know. If there is something I am missing and you could help fill in the blanks for me I would truly appreciate the help.
    Thanks so much!!
    20G   Windows 2000  
    20G   Windows 2000  

    1. No. You can use your old one.
    2. Will I have to reset my newly acquired Ipod before I can place my music on it? No, but iTunes may automatically do this, I will explain.
    I did back up about 80% of the songs from my old Ipod. Or will I be able to keep the 1500 songs my friend placed on it?
    Sorry, but it would not be legal to keep the 1500 songs on this iPod that were your friend's songs, assuming that he's still using/listening to them on another computer.
    3. No, I think it would be worth it to keep going, and use the 20GB iPod on your computer. It's not many hoops to jump through, and you should be up and syncing in no time.
    Overall, it's fairly easy, and I would suggest that you keep going with this iPod.
    My note from question #2:
    If you connect an iPod that hasn't been attatched to your computer before, iTunes will most likely display [to the effect of] this message when you connect the iPod for the first time:
    "The songs on the iPod "~~" are linked to another iTunes library. Would you like to replace the content of the iPod with this current iTunes library?"
    Be sure to click on "NO" when you recieve this message.
    Then, click on your iPod's name in the left panel of iTunes.
    Click on the "Music" tab.
    Deselect "Sync Music" if it is already set to this option.
    This means that your iPod is on manual managing now, instead of iTunes automatically transferring songs to your iPod, or deleting them, which is not what you want at this time.
    Now, if you have any songs on the iPod that you need to keep (i.e., if you have some of your songs on this iPod)you have a few options to transfer your iPod songs to your computer.
    Method 1 - Manually transfer your iPod songs to iTunes using MacMuse's post. See it here -> iPod songs to computer (MacMuse post)
    Method 2 - Add your iPod's folder into the iTunes library (via iTunes). Read this post here -> Using iTunes settings to transfer iPod songs to iTunes
    Method 3 - Use a third-party program to get the transferring done. For a Windows computer, CopyPod should work good. Also, you can try out YamiPod
    I hope that info helps you.
    -Kylene

Maybe you are looking for