Conditional SQL ( Want to avoid having to write a PL/SQL block )

I have a SQL statement and I was hoping to not have to write an IF-THEN-ELSE condition. Here is the SQL in hand which I need to expand.
I need to list the personal information including address of all the employees. However, in the event that I encounter any address ( Home or Office ) where my State is *"NY"*, I should not list the "NY" Address but instead list the address where my address_location = 'O' and address_state_code = *"CA"*.
Here is my code below. Now, the DB procedure call could retrieve the latest address id as a "NY" location and hence my question.
SELECT '"'||emp.employee_name,
              ||'","'||TO_CHAR(emp.birth_date,'YYYY/MM/DD')
              ||'","'||emp.gender
              ||'","'||RTRIM(ead.address_line1)
              ||'","'||RTRIM(ead.address_line2)
              ||'","'||RTRIM(ead.address_line3)
              ||'","'||RTRIM(ead.address_location) -- 'O': Office; 'H': Home
              ||'","'||RTRIM(ead.adh_city)
              ||'","'||ead.address_zip_code
              ||'","'||ead.address_state_code
FROM    employee             emp,
            employee_address ead
WHERE  emp.emp_num = ead.emp_num
-- The proccedure db_get_address_id returns me the most recent Address with Max Effective Date
AND      ead.address_id = db_get_address_id( emp.emp_num )
ORDER BY v.effective_date DESC, emp.employee_name ASC;
{code}
Thanks in advance !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

SELECT  emp_address
  FROM  (
         SELECT  '"'||emp.employee_name,
                        ||'","'||TO_CHAR(emp.birth_date,'YYYY/MM/DD')
                        ||'","'||emp.gender
                        ||'","'||RTRIM(ead.address_line1)
                        ||'","'||RTRIM(ead.address_line2)
                        ||'","'||RTRIM(ead.address_line3)
                        ||'","'||RTRIM(ead.address_location) -- 'O': Office; 'H': Home
                        ||'","'||RTRIM(ead.adh_city)
                        ||'","'||ead.address_zip_code
                        ||'","'||ead.address_state_code emp_address,
                        ROW_NUMBER() OVER(ORDER BY v.effective_date DESC, emp.employee_name ASC) RN,
                        CASE
                          WHEN ead.address_state_code = 'NY' THEN CASE MAX(
                                                                           CASE ead.address_state_code
                                                                             WHEN 'CA' THEN 1
                                                                           END
                                                                          ) OVER(PARTITION BY emp.emp_num)
                                                                    WHEN 1 THEN 0
                                                                    ELSE 1
                                                                  END
                          ELSE 1
                        END TAKE_IT -- 0 means it is NY address for employee who also has CA address, 1 otherwise.
           FROM  employee emp,
                 employee_address ead
           WHERE emp.emp_num = ead.emp_num
             -- The proccedure db_get_address_id returns me the most recent Address with Max Effective Date
             AND ead.address_id = db_get_address_id(emp.emp_num)
  WHERE TAKE_IT = 1
  ORDER BY RN
{code}
SY.
Edited by: Solomon Yakobson on Aug 13, 2009 1:38 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Moving & want to avoid engineer charge

    I will be moving at the end of the month. I would like to transfer my line to my new place but I want to avoid having to pay £130 for an engineer to come out to connect the line. I know that the line there is still connected so I don't see why I should have to. I also don't want to be tied into another or extend my contract. 
    I don't really know how to approach the situation though. Can you help at all?

    There is no need to pay the £130 if the line is actually connected.  By that I mean that if you pick up the phone you get a dial tone, and if you dial 17070 you get a recorded message giving you your phone number.
    Make sure when you go through the ordering process (either by phone or on-line) that you say that the line is already connected.
    As for the minimum contract, it's a standard clause in BT's T&Cs that a home move means a new 12 month minumum contract.  I can't see any way round it.

  • I have recently transferred data from my old Mac to my new one. The result was good, but I have 2 users now, whose data I want to merge into 1 single user, so to avoid having to switch from one user to the other to view and use certain files. How to do it

    I have recently transferred data from my old Mac to my new one. The result was good, but I have 2 users now, whose data I want to merge into 1 single user, so to avoid having to switch from one user to the other to view and use certain files. How to do it?

    Here's an easy way:
    Pick the user that you want to eliminate (making sure that the remaining user has administrator privileges) and move all of the data that you want to keep into the Shared folder. Reboot or log out and login to the user you want to keep. Copy all the data from the Shared folder into your account - placing it neatly in folders (Documents, Music, Movies, etc.).
    Once the data is moved, log into the account you want to delete just once more to make certain that you've grabbed all the data you want to keep. Log out and log back into your admin account and go to System Preferences>Users & Groups and delete the 'old' user.
    That should do it.
    Clinton

  • Sql query ..need idea to write complex query

    Hi there,
    I have assigned the task to write a sql query to get the output as the below stored proc does.
    In the proc conditions are given with IF statements. I really dont know how to give all the conditions for the period in a single sql query as I'm not much used to sql quries.
    Is anyone could help me?
    Any suggestions pls . writing complicated query is nightmare. no idea . if possible help me...
    create or replace PROCEDURE vpp_station_summary_report (
    in_user_id                     IN  VARCHAR2,
    in_report_id      IN  NUMBER,
    in_time_from                IN      vppstation.avi_status_history.status_eff_date%TYPE,
    in_time_to                  IN  vppstation.avi_status_history.status_eff_date%TYPE,
    result                               OUT SYS_REFCURSOR)
    AS
    CURSOR station_loop IS
       SELECT ash.station_id,
              ash.avi_id,
              ash.state_id,
              ash.state_eff_date
       FROM   vppstation.avi_state_history ash
       JOIN   vpproadside.vpp_report_stations
         ON   vpp_report_stations.station_id             = ash.station_id
        AND   vpp_report_stations.vpp_report_seq_number  = in_report_id
       WHERE  ash.state_eff_date BETWEEN in_time_from AND in_time_to
       ORDER BY ash.station_id,
                ash.avi_id,
                ash.state_eff_date,
                ash.ash_id;
    -- cursor to find the 'entry state' i.e. the state the AVI was in AT the time of
    -- in_time_from
    CURSOR entry_state (
              state_station_id vppstation.avi_state_history.station_id%TYPE,
              state_avi_id     vppstation.avi_state_history.avi_id%TYPE,
              state_state_date vppstation.avi_state_history.state_eff_date%TYPE
    IS
       SELECT ash.state_id
       FROM   vppstation.avi_state_history ash
       WHERE  ash.station_id = state_station_id
         AND  ash.avi_id = state_avi_id
         AND  ash.state_eff_date < state_state_date
       ORDER BY ash.state_eff_date DESC,
                ash.ash_id DESC;
    current_station_id         vppstation.avi_state_history.station_id%TYPE;
    current_avi_id             vppstation.avi_state_history.avi_id%TYPE;
    current_state_id           vppstation.avi_state_history.state_id%TYPE;
    current_state_eff_date     vppstation.avi_state_history.state_eff_date%TYPE;
    period_length NUMBER;
    next_station_id     vppstation.avi_state_history.station_id%TYPE;
    next_avi_id         vppstation.avi_state_history.avi_id%TYPE;
    next_state_id       vppstation.avi_state_history.state_id%TYPE;
    next_state_eff_date vppstation.avi_state_history.state_eff_date%TYPE;
    station_open_total       NUMBER;
    station_closed_total     NUMBER;
    station_all_report_total NUMBER;
    current_station_name vpproadside.vpp_station_summary.station_name%TYPE;
    state_open       vppstation.avi_control_state_code.state_id%TYPE;
    state_closed     vppstation.avi_control_state_code.state_id%TYPE;
    state_all_report vppstation.avi_control_state_code.state_id%TYPE;
    BEGIN
    SELECT state_id
    INTO   state_open
    FROM   vppstation.avi_control_state_code
    WHERE  state_type = 'E'
    AND    state_active_ind = 'A';
    SELECT state_id
    INTO   state_closed
    FROM   vppstation.avi_control_state_code
    WHERE  state_type = 'D'
    AND    state_active_ind = 'A';
    SELECT state_id
    INTO   state_all_report
    FROM   vppstation.avi_control_state_code
    WHERE  state_type = 'S'
    AND    state_active_ind = 'A';
    current_station_id := -1;
    current_avi_id     := -1;
    current_state_id   := state_closed;
    current_state_eff_date := in_time_from;
    station_open_total       := 0.0;
    station_closed_total     := 0.0;
    station_all_report_total := 0.0;
    -- for starters - ensure that there is report data for all requested stations...
    INSERT INTO vpproadside.vpp_station_summary
          vpp_report_seq_number,
          station_id,
          station_name,
          ln_number,
          lane_name,
          station_open,
          station_close,
          station_all_report,
          station_total
      SELECT in_report_id,
             vrs.station_id,
             si.station_name,
             l.ln_number,
             l.lane_name,
             0.0,
             0.0,
             0.0,
             0.0
      FROM vpproadside.vpp_report_stations vrs
      LEFT OUTER JOIN  vpproadside.stations_installed si
        ON  si.station_id = vrs.station_id
      LEFT OUTER JOIN vppstation.lane_name l
        ON l.station_id = vrs.station_id
      WHERE vrs.vpp_report_seq_number  = in_report_id;
    -- loop over state history and update information for all stations found
    OPEN station_loop;
    LOOP
      FETCH station_loop
      INTO
            next_station_id,
            next_avi_id,
            next_state_id,
            next_state_eff_date;
      IF station_loop%NOTFOUND THEN
        next_station_id := -1;
        next_avi_id     := -1;
      END IF;
      -- if station/avi has changed take the end of the report period
      IF    (next_station_id <> current_station_id)
         OR (next_avi_id     <> current_avi_id)
      THEN
        period_length := in_time_to - current_state_eff_date;
      ELSE
        -- otherwise the start of the next period marks the end of the current period
        period_length := next_state_eff_date - current_state_eff_date;
      END IF;
      -- if we have a real station id then do some work...
      IF (current_station_id <> -1) THEN
        -- determine which category the period fits to and apply calculation
        IF current_state_id = state_open THEN
          station_open_total := station_open_total + period_length - 1;
        ELSIF current_state_id = state_closed THEN
          station_closed_total := station_closed_total + period_length - 1;
        ELSIF current_state_id = state_all_report THEN
          station_all_report_total := station_all_report_total + period_length - 1;
        ELSE
          RAISE_APPLICATION_ERROR(-20111, 'Error: found unknown state code on avi_state_history - ' || current_state_id );
        END IF;
        -- if the station/avi has changed then commit changes to db
        IF    (next_station_id <> current_station_id)
           OR (next_avi_id     <> current_avi_id)
        THEN
          UPDATE vpproadside.vpp_station_summary
          SET
              station_open       = station_open_total,
              station_close      = station_closed_total,
              station_all_report = station_all_report_total
          WHERE vpp_report_seq_number = in_report_id
          AND   station_id = current_station_id
          AND   ln_number  = current_avi_id;
          -- reset counts
          station_open_total       := 0.0;
          station_closed_total     := 0.0;
          station_all_report_total := 0.0;
        END IF;
      END IF;
      -- if we got past the last record then stop processing
      EXIT WHEN station_loop%NOTFOUND;
      -- if the station/avi is changing, get the state that was 'current' at in_time_from
      IF    (next_station_id <> current_station_id)
         OR (next_avi_id     <> current_avi_id)
      THEN
        current_state_eff_date := in_time_from;
        OPEN entry_state (
               next_station_id,
               next_avi_id,
               in_time_from
        FETCH entry_state
        INTO  current_state_id;
        IF entry_state%NOTFOUND THEN
          current_state_id := state_closed;
        END IF;
        CLOSE entry_state;
        period_length := next_state_eff_date - current_state_eff_date;
        IF current_state_id = state_open THEN
          station_open_total := station_open_total + period_length;
        ELSIF current_state_id = state_closed THEN
          station_closed_total := station_closed_total + period_length;
        ELSIF current_state_id = state_all_report THEN
          station_all_report_total := station_all_report_total + period_length;
        ELSE
            RAISE_APPLICATION_ERROR(-20111, 'Error: found unknown state code on avi_state_history - ' || current_state_id );
        END IF;
      END IF;
      current_state_id       := next_state_id;
      current_state_eff_date := next_state_eff_date;
      current_station_id     := next_station_id;
      current_avi_id         := next_avi_id;
    END LOOP;
    CLOSE station_loop;
    -- update the totals for the percentage calculation
    UPDATE vpproadside.vpp_station_summary
    SET
           station_total = station_open + station_close+ station_all_report
    WHERE   vpp_report_seq_number = in_report_id;
    -- 'fix' the totals that are still zero to avoid divide by zero errors...
    --       note: all the percentages will still come out as zero since the total
    --             was zero
    UPDATE vpproadside.vpp_station_summary
    SET
           station_total = 1.0
    WHERE  vpp_report_seq_number = in_report_id
    AND    station_total = 0.0;
    OPEN result FOR
    SELECT station_name "Site Name",
           lane_name    "Lane Name",
           TO_CHAR((station_open       / station_total) * 100.0, 'FM990.0999') || '%' "Open %",
           TO_CHAR((station_close      / station_total) * 100.0, 'FM990.0999') || '%' "Closed %",
           TO_CHAR((station_all_report / station_total) * 100.0, 'FM990.0999') || '%' "All Report %"
    FROM vpproadside.vpp_station_summary
    WHERE vpp_report_seq_number = in_report_id
    ORDER BY UPPER(station_name),
             UPPER(lane_name);
    DELETE FROM vpproadside.vpp_station_summary
    WHERE vpp_report_seq_number = in_report_id;
    END;Edited by: Indhu Ram on Mar 10, 2010 9:51 AM
    Edited by: Indhu Ram on Mar 10, 2010 9:56 AM
    Edited by: Indhu Ram on Mar 10, 2010 10:58 AM
    Edited by: Indhu Ram on Mar 10, 2010 11:12 AM

    Exactly dont know what you are asking for but I can suggest you some tips here
    - If you want to check the condition in SQL query then you can use CASE statement into select clause i.e.
    SELECT CASE when table1.a=table2.b then table1.c else table2.c END, ... more case..., table columns...
    FROM table1, table2
    WHERE
    <some conditions>
    - If you want to achive same functionality (SELECT only, not UPDATE/INSERT/DELETE) then you can convert the part of same procedure into function and can use the same function into your query by passing the parameters.
    something like this
    SELECT function_name(parameter1, parameter2....) from dual
    Hope this will help

  • How to detect SQL type to avoid SQL injection

    Hi,
    I work in a gsm company and we develop a program to make trend analysis. Users of this program know how to write SQL statements. I want them to write specific sql statements as input statement of my program (SELECT ... from ...). Mostly SELECT statements. I have PL/SQL blocks and dynamic SQL's in my program. I get user defined SQL statements and execute them as Dynamic Sql's.
    Here is the problem: I need to understant what type of SQL they give as input parameter of my program to avoid wrong operations (DELETE, TRUNCATE, DROP...)
    First i thought about the REGEXP to understant if its a SELECT SQL or DELETE SQL..
    Is there any recommend about this problem? Does Oracle have any procedure to detect it?
    Thanks

    acadet wrote:
    BluShadow wrote:
    a_yavuz wrote:
    I work in a gsm company and we develop a program to make trend analysis. Users of this program know how to write SQL statements. I want them to write specific sql statements as input statement of my program (SELECT ... from ...). What is the specification behind these "specific sql statements"?
    This should allow you to define a lexicon of permitted terms within the language and, if it's not too complex, you could then write a lexicon/language parser to validate each of the statements submitted, thus ensuring they cannot permit anything that is not expected. It may not be a simple tasks, depending on how complex your sub-language of SQL is, but if you are wanting to truly allow users to use SQL rather than some user interface that restricts input and prevents injection, then it's one of the safer ways of doing it.Hi,
    This is exactly what the database does through the technique of grants. Why reinvent the wheel.
    AndreAssuming you're only talking about access to database objects etc. and that the database user shouldn't be able to perform those tasks through a controlled interface. What if they should be able to e.g. delete records, but only through a controlled screen, whereas the selection of data is to be flexible and permit SQL.
    The original question sounds more like he wants to permit a certain subset of the SQL language as he says he wants them to write "specific sql statements". If there is a definition of what form those statements should take then a restricted lexicon parser could be written to cater for those.

  • I download apps directly to my iphone.  When I sync with my laptop, how do I avoid having sync delete apps, photos, songs downloaded on my iphone?

    I download apps directly to my iphone.  When I sync with my laptop, how do I avoid having sync delete apps, photos/vdeos, songs downloaded on my iphone?

    If you are syncing to the same computer that you always sync to, and have each of the items in itunes that you want synced then you shouldnt have an issue. The only way you would have an app come off your phone is if you uncheck that app from syncing in th apps location in itunes.

  • Backup DB with dynamic sql - want to substitute in dbname and disk file path

    Re: Backup DB with dynamic sql - want to substitute in dbname and disk file path
    Hope I can explain this. Below is a small snippet of code. I want to set @SQLTemplate_TSQL once at the top of the script and then execute the SET @SQLCommand and sp_executesql in a loop that reads a list of databases. It all works, except for the
    BACKUP DATABASE. Right now it evaluates when the SET @SQLTemplate_TSQL is evaluated. I want it to evaluate when it is executed. I want the DB_NAME() of the USE @dbname.
    -- change @dbname and @dbbackuppath
    DECLARE @SQLCommand NVARCHAR(MAX)
    DECLARE @SQLTemplate_TSQL NVARCHAR(MAX)
    DECLARE @dbname varchar(128) = 'Bank04'
    -- one time setting of @SQLTemplate_TSQL
    set @SQLTemplate_TSQL =
    DECLARE @dbbackuppath varchar(128) = ''''d:\backups''''
    IF RIGHT(@dbbackuppath, 1) <> ''''\''''
    SET @dbbackuppath = @dbbackuppath + ''''\''''
    SET @dbbackuppath = @dbbackuppath + DB_Name() + ''''.bak''''
    PRINT @dbbackuppath
    BACKUP DATABASE ' + DB_NAME() + ' to DISK=''' + QUOTENAME(@dbbackuppath, CHAR(39)) + '''
    -- Execute this several times over different databases
    SET @SQLCommand = '
    USE ' + QUOTENAME(@dbname) + ';
    EXEC(''' + @SQLTemplate_TSQL + ''') '
    PRINT @SQLCommand
    EXECUTE sp_executesql @SQLCommand

    Here is a stripped down version of my code. Someone writes a script. I then take the script and seperate it by GO statement block. Each GO block gets its own row into the
    #SQLTemplate_TSQL. I then replace single quote with 4 quotes and run it. Then I run against my list of databases. I am unable to get the BACKUP DATA base to work with this model.
    Run scripts against multiple databases.sql
    Do a FIND on "CHANGE THIS" to see the databases returned from the SELECT statement
    DECLARE @DatabaseName varchar(128)
    DECLARE @SQLCommand NVARCHAR(MAX)
    DECLARE @SQLTemplate_Seq INT
    DECLARE @SQLTemplate_OperationDesc NVARCHAR(128)
    DECLARE @SQLTemplate_TSQL NVARCHAR(MAX)
    DECLARE @SQLTemplate_Diagnostics INT
    DECLARE @Note VARCHAR(500)
    IF OBJECT_ID('tempdb..#SQLTemplate_TSQL') IS NOT NULL
    DROP TABLE #SQLTemplate_TSQL
    CREATE TABLE [dbo].[#SQLTemplate_TSQL](
    [SQLTemplate_RecID] [int] Identity,
    [SQLTemplate_ID] [int] NOT NULL,
    [SQLTemplate_Seq] [int] NOT NULL,
    [SQLTemplate_OperationDesc] [varchar](128) NOT NULL,
    [SQLTemplate_TSQL] [varchar](max) NOT NULL,
    [SQLTemplate_Diagnostics] [int] NOT NULL,
    [SQLTemplate_Enabled] [int] NOT NULL)
    DELETE FROM #SQLTemplate_TSQL WHERE SQLTemplate_Seq = 65
    DECLARE @SeqID INT
    SELECT @SeqID = MAX(SQLTemplate_ID) FROM #SQLTemplate_TSQL
    SET @SeqID = ISNULL(@SeqID,0)
    SET @SeqID = @SeqID + 1
    INSERT INTO #SQLTemplate_TSQL VALUES(@SeqID ,65,@SeqID,'
    SELECT * FROM ifs_config
    ',1,1)
    SET @SeqID = @SeqID + 1
    INSERT INTO #SQLTemplate_TSQL VALUES(@SeqID ,65,@SeqID,'
    DECLARE @HistoryODS INT
    SET @HistoryODS = 1
    SELECT * FROM ifs_tablelist WHERE HistoryODS = @HistoryODS and Tablename like ''''%HIST%''''
    ',1,1)
    -- Setup Cursor to Loop through each of the Prior Period databases
    DECLARE db_cursor CURSOR FOR
    SELECT [Database Name] --<<<<<<<< CHANGE THIS SELECT statement to select DBs >>>>>>
    FROM v_ifs_PPODSDBInfo_Curr
    WHERE [Database Frequency] <> 'CURRENT'
    ORDER BY [Database Frequency], [Database Number]
    OPEN db_cursor
    FETCH NEXT FROM db_cursor INTO @DatabaseName
    -- Loop through each of the databases
    WHILE @@FETCH_STATUS = 0
    BEGIN
    -- Setup Cursor to Loop through each of the SQL Statements
    DECLARE #SQLTemplate_TSQL_cursor CURSOR FOR
    SELECT [SQLTemplate_TSQL], [SQLTemplate_OperationDesc], [SQLTemplate_Seq], [SQLTemplate_Diagnostics]
    FROM #SQLTemplate_TSQL
    WHERE [SQLTemplate_Enabled] = 1 AND SQLTemplate_Seq = 65
    ORDER BY SQLTemplate_ID
    OPEN #SQLTemplate_TSQL_cursor
    FETCH NEXT FROM #SQLTemplate_TSQL_cursor INTO @SQLTemplate_TSQL, @SQLTemplate_OperationDesc, @SQLTemplate_Seq, @SQLTemplate_Diagnostics
    -- Loop through each of the SQL statements
    WHILE @@FETCH_STATUS = 0
    BEGIN
    SET @SQLCommand = '
    USE ' + QUOTENAME(@Databasename) + ';
    EXEC(''' + @SQLTemplate_TSQL + ''') '
    EXECUTE sp_executesql @SQLCommand
    FETCH NEXT FROM #SQLTemplate_TSQL_cursor INTO @SQLTemplate_TSQL, @SQLTemplate_OperationDesc, @SQLTemplate_Seq, @SQLTemplate_Diagnostics
    END
    CLOSE #SQLTemplate_TSQL_cursor
    DEALLOCATE #SQLTemplate_TSQL_cursor
    FETCH NEXT FROM db_cursor INTO @DatabaseName
    END
    CLOSE db_cursor
    DEALLOCATE db_cursor

  • Newbie wants to avoid disaster!

    Hi everyone,
    My missus is getting a new iPod today to compliment the shuffle she is lovin'!!
    She & I want to avoid any possible disasters when setting it up and avoid erazing music losing settings etc.
    Can anyone help us with 4 questions please?
    Thank you
    Flobbyblob
    Question 1
    She has a collection of bought music which has been downloaded to her Library on her computer using iTunes.
    She has created a list of 53 tunes in DEVICES. (I'm not sure what you call this list)
    Does this mean that when the new 80GB iPod is connected it will also appear as a DEVICE and can have its own list of music, or will it erase her existing library?
    QUESTION 2
    Having purchased the tracks from iTunes, can she put them on both devices, and is it legal? (UK)
    QUESTION 3
    We like what we've bought, and plan to get 'Shuffles' for each of the kids.
    Can they also plug into her computer and load tracks on their Shuffles?
    QUESTION 4
    I will be getting an iPod in October.
    At the moment I have a crap mp3 player with my own collection of MP3's I have transferred from old LP's, plus Mp3's made from my 100 odd CD's.
    Can I then set up my computer to have my Library shared by all our family? i.e. 4 devices
    (I am confused whether if there are two PC's with two different libraries on them, the 2 iPods and 2 shuffles connect to either or both of these two pc's (2 libraries) to put their own selections of music on them - and is it legal?)
    PC   Windows XP Pro  

    "Does this mean that when the new 80GB iPod is connected it will also appear as a DEVICE and can have its own list of music, or will it erase her existing library?"
    You can use multiple iPods with a single library, the library will not be erased: How to use multiple iPods with one computer
    "Having purchased the tracks from iTunes, can she put them on both devices, and is it legal? (UK
    Yes she can put them on as many iPods as she likes
    We like what we've bought, and plan to get 'Shuffles' for each of the kids.
    Can they also plug into her computer and load tracks on their Shuffles?
    Yes they can: Loading songs onto iPod shuffle - Windows
    "Can I then set up my computer to have my Library shared by all our family? i.e. 4 devices"
    Yes you can, see the first link on using multiple iPods with a single computer
    "if there are two PC's with two different libraries on them, the 2 iPods and 2 shuffles connect to either or both of these two pc's (2 libraries) to put their own selections of music on them - and is it legal?)
    First of all yes it's legal (don't know why you think it's not). However:
    1) iPod shuffles can only update from a single iTunes library ( a technical issue, not a legal one, it's the way they are designed).
    2) To use an iPod ( other than a shuffle) on multiple computers you have to set it to manual update:
    Using iPod with Multiple computers
    Managing content manually on iPod

  • Is it possible to avoid having to RENDER clips?

    New to FCE - still working my way through -
    But - My question is - I have a small flip - making videos for the web page only- I find that this camera serves my purpose well.
    Do I have to render every clip after I bring it in to the time line? When watching the tutorials it appears this is not necessary for certain types of vide files.
    Since I am not willing to upgrade my camera - is this something I must deal with? Or is their a trick in the way one can import/export files where I can avoid having to render.
    I just want to make sure I am not overlooking a simple setting during set up - etc....
    Thanks
    gh

    You need to get your media into a format with with which FCE works natively before you bring it into the program.
    Depending on what format the camera shoots, you can probably use a free utility called MPEG Streamclip (http://www.squared5.com/) to convert.

  • How to avoid having to clean a portable class library every time?

    WinRT Project Foo references a portable class library PCLFoo.  Whenever a change is made to Foo and it is run (by pressing F5 or Ctr+F5), the following error occurs:
    The type or namespace name 'PCLFoo' could not be found (are you missing a using directive or an assembly reference?)
    Everything will be fine after cleaning PCLFoo (right-click >Clean).  Is there a way to avoid having to do this cleaning every time?
    Hong

    Hi Jack,
    I will try to reproduce it in a brand new solution.
    The following is the VS:
    Microsoft Visual Studio Ultimate 2013
    Version 12.0.31101.00 Update 4
    Microsoft .NET Framework
    Version 4.5.51650
    Installed Version: Ultimate
    Architecture and Modeling Tools   06181-004-0451047-02055
    Microsoft Architecture and Modeling Tools
    UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.
    LightSwitch for Visual Studio 2013   06181-004-0451047-02055
    Microsoft LightSwitch for Visual Studio 2013
    Team Explorer for Visual Studio 2013   06181-004-0451047-02055
    Microsoft Team Explorer for Visual Studio 2013
    Visual Basic 2013   06181-004-0451047-02055
    Microsoft Visual Basic 2013
    Visual C# 2013   06181-004-0451047-02055
    Microsoft Visual C# 2013
    Visual C++ 2013   06181-004-0451047-02055
    Microsoft Visual C++ 2013
    Visual F# 2013   06181-004-0451047-02055
    Microsoft Visual F# 2013
    Visual Studio 2013 Code Analysis Spell Checker   06181-004-0451047-02055
    Microsoft® Visual Studio® 2013 Code Analysis Spell Checker
    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.
    Windows Phone SDK 8.0 - ENU   06181-004-0451047-02055
    Windows Phone SDK 8.0 - ENU
    AnkhSVN - Subversion Support for Visual Studio   2.5.12478.19
    AnkhSVN - Subversion Support for Visual Studio 2.5.12478.19
     * Ankh.Package 2.5.12478.19
     * Subversion 1.8.10 via SharpSvn 1.8010.3368.58
    SharpSvn is linked to: Apr 1.5.1, Apr-util 1.5.4, Cyrus Sasl 2.1.25, eXpat 2.0.1, OpenSSL 1.0.1j 15 Oct 2014, serf 1.3.8, SQLite 3.7.17, Subversion 1.8.10-SharpSvn-1.8.10, ZLib 1.2.8
    SharpSvn is optionally linked to: Berkeley DB 4.4.20, SharpPlink 1.8010.3368.58
    Application Insights Tools for Visual Studio Package   1.0
    Application Insights Tools for Visual Studio
    ASP.NET and Web Tools   12.4.51016.0
    Microsoft Web Developer Tools contains the following components:
    Support for creating and opening ASP.NET web projects
    Browser Link: A communication channel between Visual Studio and browsers
    Editor extensions for HTML, CSS, and JavaScript
    Page Inspector: Inspection tool for ASP.NET web projects
    Scaffolding: A framework for building and running code generators
    Server Explorer extensions for Microsoft Azure Websites
    Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure
    ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
    For additional information, visit
    http://go.microsoft.com/fwlink/?LinkID=309563
    ASP.NET Web Frameworks and Tools 2013   5.2.21010.0
    For additional information, visit http://www.asp.net/
    Common Azure Tools   1.3
    Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
    Microsoft Advertising SDK for Windows Phone 8.1 Silverlight   8.1.50112.0
    Microsoft Advertising SDK for Windows Phone 8.1 Silverlight
    Build 8.1.50112.0
    Microsoft Azure HDInsight HQL Service   1.0.0000.0
    Language service for Hive query
    Microsoft Azure HDInsight Tools for Visual Studio   1.0.0000.0
    An integrated development environment for HDInsight application development.
    Microsoft Azure Mobile Services Tools   1.3
    Microsoft Azure Mobile Services Tools
    Microsoft Azure Tools   2.4
    Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.4.20730.1601
    Microsoft Azure Tools   2.5
    Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.5.21104.1601
    NuGet Package Manager   2.8.50926.663
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit
    http://docs.nuget.org/.
    Office Developer Tools for Visual Studio 2013 ENU   12.0.31105
    Microsoft Office Developer Tools for Visual Studio 2013 ENU
    PowerShell Tools   1.3
    Provides file classification services using PowerShell
    PreEmptive Analytics Visualizer   1.2
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
    SQL Server Data Tools   12.0.41025.0
    Microsoft SQL Server Data Tools
    Telerik Windows 8 XAML VSExtensions   2014.5.1021.0
    Telerik UI for Windows 8 XAML VSExtensions
    Telerik Windows Phone VSExtensions   2015.2.317.0
    Telerik UI for Windows Phone VSExtensions
    Visual Studio Spell Checker   VSSpellChecker
    An editor extension that checks the spelling of comments, strings, and plain text as you type.
    Web Essentials 2013   2.5.3
    Adds many useful features to Visual Studio for web developers.
    Windows Azure Tools   2.2
    Windows Azure Tools for Microsoft Visual Studio 2013 - v2.2.11003.1601
    Windows Azure Tools   2.3
    Windows Azure Tools for Microsoft Visual Studio 2013 - v2.3.20320.1602
    Windows Phone 8.1 SDK Integration   1.0
    This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.
    Workflow Manager Tools 1.0   1.0
    This package contains the necessary Visual Studio integration components for Workflow Manager.
    Git Extensions
    Git Extensions is a graphical interface for Git
    For more information about Git Extensions, see the Git Extensions website at
    http://code.google.com/p/gitextensions/
    Copyright © 2012 Henk Westhuis
    Hong

  • How to write the pl/sql code for this scenario

    Hi,
    Here is the data in a Table with below colums
    id firstname lastname code
    1 scott higgins 001
    2 Mike Ferrari 001
    3 Tom scottsdale 002
    4 Nick pasquale 003
    1 scott higgins 004
    I want to trap the following exceptions into an error table using pl/sql
    1. same person having multiple code
    example
    id first last Code
    1 scott higgins 001
    1 scott higgins 004
    2. Multiple persons having same code
    id first last Code
    1 scott higgins 001
    2 Mike Ferrari 001
    Could you please help me how to capture the exceptions above using pl/sql
    and what will be the structure of error table. it should capture eff date & end date

    or using analytic functions like this:
    select id, fname, lname, code from (
    with t as(
        select 1 id, 'scott' fname, 'higgins' lname, 001 code from dual
        union all
        select 2 id,'Mike ' fname, 'Ferrari' lname,  001  code from dual
        union all
        select 3 id,'Tom' fname, 'scottsdale' lname, 002  code from dual
        union all
        select 4 id,'Nick' fname, 'pasquale' lname, 003  code from dual
        union all
        select 5 id,'scott' fname, 'higgins' lname, 004  code from dual
        select t.*, count(*) over (partition by fname) row_count from t)
    where row_count > 1;
    select id, fname, lname, code from (
    with t as(
        select 1 id, 'scott' fname, 'higgins' lname, 001 code from dual
        union all
        select 2 id,'Mike ' fname, 'Ferrari' lname,  001  code from dual
        union all
        select 3 id,'Tom' fname, 'scottsdale' lname, 002  code from dual
        union all
        select 4 id,'Nick' fname, 'pasquale' lname, 003  code from dual
        union all
        select 5 id,'scott' fname, 'higgins' lname, 004  code from dual
        select t.*, count(*) over (partition by code) row_count from t)
    where row_count > 1;

  • Need suggestions to write a PL/SQL program

    Hi,
    We have some readme documents in different places. we need to keep the docs in specified folders. for example if we have around 100 docs we need to figure out the required docs by giving the just any one word from that doc name.
    now the requirement is need to keep all the docs in one specified folder (check the product name, if the product is there then it will pick all the docs related to that particular product and keeps in separate folder). whenever we need to find out any one of the document from that product we need to give the short word from that doc name then it will show you the required doc.
    So could you please let me know is it possible to write any PL/SQL program for the above requirement else suggest me which one will support to resolve the above requirement.
    Kindly suggest me for the above request.
    thanks in advance.

    You may want to consider loading the documents into blobs or using BFILES.
    BFILE defnition
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements001.htm#SQLRF50996
    BLOB definition
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements001.htm#SQLRF50997
    Regardless of whether you use BLOB's or BFILE's, you'll have to build a metadata table for each document.
    For example, if you decided upon BLOB's, you would need some kind of metadata table as follows;
    create table doc_table (id number, doc_name varchar2(20), b blob);
    insert into doc_table values (1, 'DOC_A', to_blob('A'));
    insert into doc_table values (2, 'DOC_B', to_blob('B'));
    commit;
    create table doc_metadata (id number, keyword varchar2(20));
    insert into doc_metadata values (1, 'A');
    insert into doc_metadata values (2, 'B');
    commit;You would then search for a document based on a keyword, for example,
    to find document A;
    select dt.doc_Name      
    from   doc_table    dt
          ,doc_metadata dm
    where  dt.id = dm.id
    and    dm.keyword like 'A';You could add more columns (as you like), for example location, size etc.

  • How to avoid having users enroll for multiple certificates?

    Hi
    I am the domain administrator of my company. Recently one of my clients has re-installed his Windows and received a new certificate from CA, but the key pair of certificate is not same with previous one, so he lost his encrypted emails.
    Now, I want to know if there is any way to avoid issuing a new certificate by certificate issuer and reassign the old certificate to a user who changed his Windows? What about when he has other devices like PDAs or smartphones that need unique certificate
    installed on them in order to read encrypted emails on his Exchange mailbox with these devices?

    On Mon, 20 Jan 2014 07:48:07 +0000, AshkanR wrote:
    I am the domain administrator of my company. Recently one of my clients has re-installed his Windows and received a new certificate from CA, but the key pair of certificate is not same with previous one, so he lost his encrypted emails.
    Now, I want to know if there is any way to avoid issuing a new certificate by certificate issuer and reassign the old certificate to a user who changed his Windows? What about when he has other devices like PDAs or smartphones that need unique certificate installed
    on them in order to read encrypted emails on his Exchange mailbox with these devices?
    To avoid having new certificates issued you have 3 choices:
    1. Implement roaming profiles.
    2. Implement credential roaming.
    3. Configure the certificate template to publish to AD and then select the
    option to not re-enroll if a certificate based on that template already
    exists in AD.
    For the BYOD option (and as a general best practice when dealing with
    encryption certificates) you need to enable key archival and recovery on
    the CA and then configure the certificate template to archive the private
    key. When a user gets a new device, you recover the private key and provide
    the user with a PFX file that can be installed on the new device.
    Paul Adare - FIM CM MVP
    The weaknesses and the strengths of computer networking derive from the
    same
    feature: it is easy to send messages to anyone who has access to the
    network.
    -- Donald A. Norman, The Trouble with Networks (Datamation 1/1982)

  • Trying to avoid having to phone customer service.....

    I already have BT Sport on Sky but we have a BT vision box attached to the tv upstairs and want to get BT Sport on there too. I just tried to order it online but it says "can't order" and I have to call a number.
    Having dealt with BT Customer Service over the phone far too many times in the past I am keen to avoid having to do this again...
    Does anyone know why I wouldn't be able to just order it online? We already have BT Infinity but aren't subscribed to any BT TV, we just use it as a DVR and Freeview box, and it is connected to the broadband. Do they just want to try to flog me more BT products...?
    Solved!
    Go to Solution.

    You're not going to get very far with this, unfortunately, because:-
    1. BT Sport is a free add-on to BT Vision.  If you don't have a paid BT Vision subscription, there's nothing to add it to, and
    2. BT only gives you one free BT Sport subscription per broadband connection, either BT Vision or Sky.  You would have to pay for the other.
    Access via the web site or mobile apps is thrown in free for any BT broadband customer, and can be in addition to a free BT Vision or Sky subscription.

  • I want to submit a concurrent program from pl/sql. Please help me.

    Dear all,
    I want to submit a concurrent program from pl/sql. But I failed. Please help me.
    Detail:
    I create a concurrent program in 'Cash Management, Vision Operations (USA)' responsibility. <strong>And it be submitted success in EBS</strong>.
    Then
    I create a test script in pl/sql. And use 'FND_GLOBAL.APPS_INITIALIZE' to initialize ebs, then use 'FND_REQUEST.SUBMIT_REQUEST' to submit
    the consurrent program, But the procedure aways return <strong>0</strong>.
    I cannot found the reason. Please help me.Thanks.
    <em>Attached informations may describe the problem:
    1.The concurrenct submitted success in EBS.</em>
    request_id = 4750655 (Sorry, I dont know how to add pictures.)
    <em>2.The initialize informations which from SQL</em>.
    SELECT FCR.REQUESTED_BY USER_ID
    ,FCR.RESPONSIBILITY_ID
    ,FCR.RESPONSIBILITY_APPLICATION_ID
    ,FA.APPLICATION_SHORT_NAME
    ,FCP.CONCURRENT_PROGRAM_NAME
    FROM FND_CONCURRENT_REQUESTS FCR
    ,FND_APPLICATION FA
    ,FND_CONCURRENT_PROGRAMS FCP
    WHERE FCR.PROGRAM_APPLICATION_ID = FA.APPLICATION_ID
    AND FCR.CONCURRENT_PROGRAM_ID = FCP.CONCURRENT_PROGRAM_ID
    AND FCR.REQUEST_ID = 4750655;
    Result: user_id = 1318;
    responsibility_id = 50579;
    application_id = 260;
    application_short_name = 'CE';
    program_short_name = 'CALLK009';
    <em>3.The test script code.</em>
    <p>
    -- Created on 2008/10/22 by ERIC
    declare
    -- Local variables here
    Wv_conc_req_id VARCHAR2(10) DEFAULT NULL;
    BEGIN
    FND_GLOBAL.APPS_INITIALIZE(
    1318
    ,50579
    ,260
    Wv_conc_req_id := FND_REQUEST.SUBMIT_REQUEST(
    'CE'
    ,'CALLK009'
    ,NULL
    ,SYSDATE
    ,FALSE
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    , CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
    DBMS_OUTPUT.PUT_LINE(Wv_conc_req_id);
    COMMIT;
    end;
    <em>4.The concurrent program code.</em>
    create or replace package body CALLTEST is
    PROCEDURE T1(PvO_errbuf OUT VARCHAR2
    ,PvO_retcode OUT VARCHAR2)
    IS
    BEGIN
    FND_FILE.PUT_LINE(fnd_file.log, 'TEST');
    END;
    end CALLTEST;
    </p>

    Can you check from which schema you are executing FND_REQUEST? You can try as follows;
    Connect to your required schema, create a synonym on apps.fnd_request, connect from apps and finally execute grant all on apps.fnd_request to all.
    You can check for relevance from Doc ID: Note:147495.1
    Please do keep in the mind the soultion above should be applied to a test/dev EBS instance first.
    I hope this would be of help.
    Saad

Maybe you are looking for