Best practices for retrieving a single value from the Oracle Table

I'm using Oracle Database 11 g Release 11.2.0.3.0.

I would like to know the best practice to do something like that in a PL/SQL block:

DECLARE
    v_student_id    student.student_id%TYPE;
BEGIN
    SELECT  student_id
    INTO    v_student_id
    FROM    student
    WHERE   last_name = 'Smith'
    AND     ROWNUM = 1;
END;

Of course, the problem here is that when there is no success, the NO_DATA_FOUND exception is thrown, which interrupts the execution.  So, what happens if I want to continue despite the exception?

Yes, I could create a block nested with EXCEPTION section, etc, but it seems awkward for what seems to be a very simple task.

I've also seen this handled like this:

DECLARE
    v_student_id    student.student_id%TYPE;
    CURSOR c_student_id IS
        SELECT  student_id
        FROM    student
        WHERE   last_name = 'Smith'
        AND     ROWNUM = 1;
BEGIN
    OPEN c_student_id;
    FETCH c_student_id INTO v_student_id;
    IF c_student_id%NOTFOUND THEN
        DBMS_OUTPUT.PUT_LINE('not found');
    ELSE
        (do stuff)
    END IF;
    CLOSE c_student_id;   
END;

But it still seems to kill an Ant with a hammer.

What is the best way?

Thanks for any help you can give.

Wayne

201cbc0d-57b2-483a-89f5-cd8043d0c04b wrote:

What happens if I want to continue despite the exception?

It depends on what you want to do.

You expect only 0 or 1 rank. SELECT INTO waiting for exactly 1 row. In this case, SELECT INTO may not be the best solution.

What exactly do you do if you return 0 rows?

If you want to set a variable with a NULL value and continue the treatment, Frank's response looks good, or else use the modular Billy approach.

If you want to "do things" when you get a line and 'status quo' when you don't get a line, then you can consider a loop FOR:

declare
  l_empno scott.emp.empno%type := 7789;
  l_ename scott.emp.ename%type;
begin
  for rec in (
    select ename from scott.emp
    where empno = l_empno
    and rownum = 1
  ) loop
l_ename := rec.ename;
    dbms_output.put_line('<' || l_ename || '>');
  end loop;
end;
/

Note that when no line is found, there is no output at all.

Post edited by: StewAshton - Oops! I forgot to put the result in l_ename...

Tags: Database

Similar Questions

  • I would like to know the "best practices" for unplugging my computer permanently to the internet and other updates.

    Thank you for taking the time to read this. I would like to know the "best practices" for unplugging my computer permanently to the internet and other updates. I thought I would do a clean install of Windows XP, install my Microsoft Works again and nothing else. I would like to effectively transforming my computer into a word processor. He continues more and more slow. I get blue screen errors, once again. I received excellent Microsoft Support when it happened before, but since my computer is around 13 years, I think it is not worth the headache to try to remedy. I ran the Windows 7 Upgrade Advisor, and my computer would not be able to upgrade. Please, can someone tell me how to make it only a word processor without updates or internet connection? (I already have a new computer with Microsoft Windows 7 Home Premium, it's the computer that I use. The old computer is just sitting there and once a week or so I updates.) I appreciate your time, thank you!

    original title: old computer unstable

    http://Windows.Microsoft.com/en-us/Windows-XP/help/Setup/install-Windows-XP

    http://www.WindowsXPHome.WindowsReinstall.com/sp2installxpcdoldhdd/indexfullpage.htm

    http://aumha.NET/viewtopic.php?f=62&t=44636

    Clean install XP sites
    You can choose which site to reinstall XP.

    Once it is installed, then you do not have to connect what anyone, however, some updates may be required to perform the work, test this by installing work and see if you get an error msg. Except that you should be fine.

  • Select values from the db1 table and insert into the DB2 table

    Hello

    I have three databases oracle running in three different machines. their ip address is different. among the DB can access databases. (means am able to select values and insert values into tables individually.)

    I need to extract data from the DB1 table (ip say DB1 is 10.10.10.10 and the user is DB1user and the table is DB1user_table) and insert the values into DB2 table (say ip DB2 is 11.11.11.11 and the user is DB2user and table DB2user_table) of DB3 that is to have access to the two IPs DB.

    How do I do this

    Edited by: Aemunathan on February 10, 2010 23:12

    Depending on the amount of data must be moved between DB1 and DB2, and the frequency at which this should happen, you might consider the SQL * COPY more control. I think it's very useful for one-off tasks little, so I can live within its limits of the data type. More http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/apb.htm#i641251.

    Change some parameter of sqlplus session are almost mandatory in order to get decent transfer rates. Tuning ARRAYSIZE and COPYCOMMIT can make a huge difference in flow. LONG change may be necessary, too, depending on your data. The documentation offers these notes on use:

    To activate the copy of data between Oracle and databases non-Oracle, NUMBER of columns is replaced by DECIMAL columns in the destination table. Therefore, if you are copying between Oracle databases, a NUMBER column with no precision will become a DECIMAL column (38). When copying between Oracle databases, you must use SQL commands (CREATE TABLE AS and INSERTION), or you must make sure that your columns have a specified precision.

    SQL * the VALUE LONGER variable limits the length of the LONG column you are copying. If all LONG columns contain data exceeds the value of LONG, COPY truncates the data.

    SQL * Plus performs a validation at the end of each successful COPY. If you set the SQL * variable more COPYCOMMIT DEFINED to a value positive n, SQL * Plus performs a validation after copying all lots n of records. The SQL * Plus ARRAYSIZE variable SET determines the size of a batch.

    Some operating environments require that the service names be placed between double quotes.

    From a SQL * Plus term on DB3, can resemble the command to move all content from my_table in DB1 to the same table in DB2

    COPY from user1/pass1@DB1 to user2/pass2@DB2 -
    INSERT INTO my_table -
    USING select * from my_table
    

    Note the SQL code * more line-continuation character ' - '. It is used to escape the newline character in a SQL * Plus command if you do not have to type all on one line. I use it all the time with this command, but I can't locate the documentation on that right now. Maybe someone else can put their finger on it.

    There are other ways to accomplish what the command copy and it is not without its quirks and limitations, but I find that there is usefulness in an Oracle Toolbox.

  • XML from the Oracle Table data

    Hi all

    I'm new to this network. I'm also new to oracle XML package. I want a help with the query below.

    CREATE TABLE EMP (ID NUMBER PRIMARY KEY, NAME VARCHAR2 (10), TELEPHONE NUMBER);

    INSERT INTO EMP (ID, NAME, PHONE) VALUES (11, 'Joy', 1234);
    INSERT INTO EMP (ID, NAME, PHONE) VALUES (22, 'Mike', 5678).
    INSERT INTO EMP (ID, NAME, PHONE) VALUES (33, "Jason", NULL);
    COMMIT;

    I want to export data from the EMP table in an XML file with the format below.

    Power required:

    <? XML version = "1.0" encoding = "UTF-8"? > < Joy STATICDATA > < EMP > < ID > 11 < /ID > < NAME > < / NAME > < / EMP > < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? > < Mike STATICDATA > < EMP > < ID > 22 < /ID > < NAME > < / NAME > < / EMP > < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? > < Jason STATICDATA > < EMP > < ID > 33 < /ID > < NAME > < / NAME > < / EMP > < / STATICDATA >

    I used some XML functions and you wrote the following query.

    Select XMLROOT (XMLELEMENT (staticdata, XMLELEMENT (EMP, XMLELEMENT(ID,ID), XMLELEMENT(NAME,NAME))), version "1.0" encoding = "UTF - 8') xml EMP;

    my query output:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < STATICDATA >
    < EMP >
    < ID > 11 / < ID >
    Joy of < NAME > < / NAME >
    < / EMP >
    < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? >
    < STATICDATA >
    < EMP >
    < ID > 22 / < ID >
    < NAME > Mike < / NAME >
    < / EMP >
    < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? >
    < STATICDATA >
    < EMP >
    < ID > 33 / < ID >
    Jason < NAME > < / NAME >
    < / EMP >
    < / STATICDATA >


    But I want the out as the power required above. all records in a single line. can someone help me achieve the desired output. also can I export all columns of the table with something like select * from the table in the XML file?

    Thank you
    Delobelle

    Don't know why you need it on a single line, but you could:

    Select XMLTYPE (REGEXP_REPLACE (XMLROOT (XMLELEMENT (staticdata, XMLELEMENT (EMP, XMLELEMENT(ID,ID), XMLELEMENT(NAME,NAME))), version "1.0" encoding = "UTF - 8'), CHR (10) |)) ' *<><'))>
    FROM EMP;

    SY.

  • Best practices for automation of ghettoVCBg2 starting from cron

    Hello world!

    I set up an instance of vma for scheduling backups with ghettoVCBg2 in a SIN store. Everything works like a charm from the command line, I use vi fastpass for authentication, backups complete very well.

    However, I would like to invade the cron script and got stuck. Since vifp is designed to run only command line and as I read not supposed to work from a script, it seems that the only possibility would be to create a backup user dedicated with administrator privileges and store the user and pass in the shell script. I'm not happy to do so. I searched through the forums but couldn't ' find any simple solution.

    any IDE for best practices?

    Thank you

    eliott100

    In fact, incorrect. The script relies on the fact that the host ESX or ESXi are led by vi-fastpass... but when you run the script, it does not use vifpinit command to connect. It access credentials via the modules of vi-fastpass which don't vifpinit library but as you have noticed, you cannot run this utility in off-line mode. Therefore, it can be scheduled via cron, basically, but you must run the script interactively, just set up in your crontab. Please take a look at the documentation for more information

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    VMware developer community

    If you find this information useful, please give points to "correct" or "useful".

  • Retrieve a single value from a file .lvm

    I have a large batch of files of worksheet whose name is a timestamp. I am writing a program that will get the value of a specific cell (the same cell in each file), coupled with the timestamp and each of them as a pair of coordinates, then save in a master spreadsheet. The goal is to extract a point each of the 700 files I and compile them into a single file.

    However, I've never used Labview to read the files before. I saw some stuff on how to read an entire worksheet in a table, but I was wondering if there was a way to say to Labview to look into a file and extract a single value. I open .lvm in Excel files, so, in my mind, I would be taking, for example, cell D2. Is this feasible? Should I read the entire worksheet in an array and use the index to pick it up on the table? If I do, how I would specify cell J2 as an array index (I have no experience with the berries in Labview either). In addition, if you have any tips on how to record easily 700 pairs of coordinates, that came together in the order, to a single spreadsheet, that is my next task.

    Essentially- I need to extract a single value of a spreadsheet in, ideally, the simplest possible. In addition, pointers on how to save the numbers gathered at each iteration of a while loop to a single worksheet are welcome.

    Thanks in advance for the help!

    FYI I have LabView v8.6

    You can't say LabVIEW to 'out' a specific 'cell' more you can tell Notepad to do. the .lvm files are just text files. When you open them in Excel, the column separator (default tabs) show to put the values in columns. In LabVIEW measurement file VI reading to read .lvm files. It creates the dynamic data, wrong data type that is next to useless. You will need to convert this type of data in a table by using the function convert of DDT. Or, you can use the VI read spreadsheet file. This will give you a table directly. You can just remove the specific item using the table to Index.

  • Support for mandatory request - insert, select from the same table

    Hi all

    I need your help to write queries effectively.
    Oracle Version: 10.2.0.3.0
    OPERATING SYSTEM: UNIX

    I have a METRICS_TBL that is mentioned below table.

    CYCLE_DATE METRIC VALUE
    08/17/2008 COST-TV 100
    08/17/2008 COST-JOURNAL 50
    08/17/2008 COST-POSTALMAIL 25
    08/17/2008-PROD-TV 10
    08/17/2008-PROD-JOURNAL 25
    08/17/2008-PROD-POSTALMAIL 5

    Any data above, I have to add (Insert into select METRICS_TBL METRICS_TBL) at the same table with the records as mentioned below.

    2008-08-17 COSTPERPROD-TV 10
    08/17/2008-COSTPERPROD-LOG 2
    2008-08-17 COST PROD-POSTALMAIL 5

    Basically, I need to calculate the cost per product for each category. Depending on the settings available, metric should also be changed as COSTPERPROD and values should be cost/prod under each category.

    Can someone help me with the query.

    Thank you

    Something like this:

    INSERT INTO metrics_tbl
    (cycle_date, metrics, value)
    SELECT cost.cycle_date
             , 'COSTPERPROD-'||cost.mtype
             ,cost.value / prod.value
    FROM  (
       select cycle_date,substr(metrics, 1, 4) mtype, substrmetrics,instr(metrics,'-')+1) mmetric
       where substr(metrics, 1, 4) = 'PROD'
       ) prod
    INNER JOIN (   select cycle_date,substr(metrics, 1, 4) mtype, substrmetrics,instr(metrics,'-')+1) mmetric
       where substr(metrics, 1, 4) = 'COST'
       ) cost on cost.cycle_date = prod.cycle_date and cost.mmetric = prod.mmetric
    

    Ideally you would divide your METRICS column into two: one for the thing you're measuring (e.g. TV or NEWSPAPER) and the other for the metric (COST, PROD, COSTPERPROD etc.). That's what I did in the views online. Without it, it's kinda a mess and behave so, if the table becomes much more.

    HTH

    Nigel cordially

    Edited by: nthomas on January 14, 2009 15:57 - small correction SQL

  • Generation of the XML from the Oracle tables

    I'm using Oracle 11 g R1.

    I have two tables header and the line:

    CREATE THE TABLE HEADER
    (
    EXPENSE_INFO VARCHAR2 (2000).
    NUMBER OF ERROR_CODE,
    REASON_OF_FAILURE VARCHAR2 (4000)
    )
    /


    CREATE THE ROW IN THE TABLE
    (
    EXPENSE_INFO VARCHAR2 (2000).
    DATE OF EXPENSE_DATE,
    EXPENSE_CODE VARCHAR2 (10),
    EXPENSE_REF VARCHAR2 (2000).
    GROSS_AMOUNT NUMBER,
    NUMBER OF TAX_AMOUNT,
    NUMBER OF ERROR_CODE,
    REASON_OF_FAILURE VARCHAR2 (4000)
    )
    /

    These tables are linked by the EXPENSE_INFO column.

    Complete the tables with the following data:

    Insert in the header (ErrorCode, EXPENSE_INFO, REASON_OF_FAILURE)
    values ('A', 0, 'SUCCESS');

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('A', to_date (December 14, 2012 ', 'dd-mm-yyyy'), 'ABC', 'HOTEL', 100, 500, 0, 'SUCCESS');

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('A', to_date (December 14, 2012 ', 'dd-mm-yyyy'), 'DEF', 'MOVIE', 10, 50, 1, "Cost Code does not exist.");

    Insert in the header (ErrorCode, EXPENSE_INFO, REASON_OF_FAILURE)
    values ('B', 1, "Emp Id does not exist.");

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('B', to_date (December 14, 2012 ', 'dd-mm-yyyy'), "XYZ", "MILEAGE", 200, 300, 0, 'SUCCESS');



    I want to generate the XML following these tables:


    COSTS of <>
    < EXPENSE_DETAILS >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < EXPENSE_LINES >
    < EXPENSE_LINE_REC >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    ABC of < EXPENSE_CODE > < / EXPENSE_CODE >
    HOTEL < EXPENSE_REF > < / EXPENSE_REF >
    < GROSS_AMOUNT > 100 < / GROSS_AMOUNT >
    < > 500 TAX_AMOUNT < / TAX_AMOUNT >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < EXPENSE_LINE_REC >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    DEF < EXPENSE_CODE > < / EXPENSE_CODE >
    FILM of < EXPENSE_REF > < / EXPENSE_REF >
    < GROSS_AMOUNT > 10 < / GROSS_AMOUNT >
    < TAX_AMOUNT > 50 < / TAX_AMOUNT >
    < ERROR_CODE > 1 < / ERROR_CODE >
    < REASON_OF_FAILURE > fresh Code does not exist. < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < / EXPENSE_LINES >
    < / EXPENSE_DETAILS >
    < EXPENSE_DETAILS >
    B < EXPENSE_INFO > < / EXPENSE_INFO >
    < ERROR_CODE > 1 < / ERROR_CODE >
    < REASON_OF_FAILURE > Employee Id does not exist. < / REASON_OF_FAILURE >
    < EXPENSE_LINES >
    < EXPENSE_LINE_REC >
    B < EXPENSE_INFO > < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    XYZ < EXPENSE_CODE > < / EXPENSE_CODE >
    POINT MILE < EXPENSE_REF > < / EXPENSE_REF >
    < > 200 GROSS_AMOUNT < / GROSS_AMOUNT >
    < > 300 TAX_AMOUNT < / TAX_AMOUNT >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < / EXPENSE_LINES >
    < / EXPENSE_DETAILS >
    < / SPENDING >


    I'm not able to generate the XML file. Kindly help me.

    Kind regards
    Sudhanshu

    I love working at the deepest level and then "wrap" with external level tags.

    You want to list all columns of each LINE by line. XMLFOREST is good for this:

    select xmlforest(
      expense_info, expense_date, expense_code, expense_ref,
      gross_amount, tax_amount, error_code, reason_of_failure
    )
    from line;
    
    A
    2012-12-14
    ABC
    HOTEL
    100
    500
    0
    SUCCESS
    ...
    

    Now you want to wrap this up in EXPENSE_LINE_REC

    select xmlelement("EXPENSE_LINE_REC",
      xmlforest(
        expense_info, expense_date, expense_code, expense_ref,
        gross_amount, tax_amount, error_code, reason_of_failure
      )
    )
    from line;
    
    
      A
      2012-12-14
      ABC
      HOTEL
      100
      500
      0
      SUCCESS
    
    

    So far, you have a XML fragment by line in the table of the LINE. You can use XMLAGG to put those together in a single fragment - or rather, a fragment by EXPENSE_INFO.

    Then you use XMLELEMENT again to give the name "EXPENSE_LINES" in this fragment.

    Then you gather the header values and the 'EXPENSE_LINES' fragment in "EXPENSE_DETAILS". This gives you all the information for each row header and associated lines of the LINE.

    Then, you gather all the information into one with XMLAGG header, and give everything a name with XMLELEMENT

    select xmlelement("EXPENSES",
      xmlagg(
        xmlelement("EXPENSE_DETAILS",
          xmlforest(expense_info, a.error_code, a.reason_of_failure),
          xmlelement("EXPENSE_LINES",
            xmlagg(
              xmlelement("EXPENSE_LINE_REC",
                xmlforest(
                  b.expense_date, b.expense_code, b.expense_ref,
                  b.gross_amount, b.tax_amount, b.error_code, b.reason_of_failure
                )
              )
            )
          )
        )
      )
    )
    from header a join line b using(expense_info)
    group by expense_info, a.error_code, a.reason_of_failure;
    

    _Note: _ with the GROUP BY clause, you can 'total' twice, once at the expense_info level and then overall. That's what I do with the two XMLAGGs: the second he puts just all the different stuff EXPENSE_DETAILS together in one package that I wrap "CHARGES" tag autour.

    Also, I omit EXPENSE_INFO of each LINE as it is already in the header information.

    Published by: stew Ashton on December 17, 2012 14:03

  • Remove duplicates from the oracle table using 2 columns

    Hello

    I need to remove the duplicates of an oracle table based on 2 columns in the table.i tried to remove duplicates using the join, but get the error like sql error ora-00933

    Thank you

    Hello

    Here's one way:

    DELETE FROM table_x

    WHERE ROWID NOT IN)

    SELECT MIN (ROWID)

    FROM table_x

    Col_1, col_2

    );

    I hope that answers your question.

    If this isn't the case, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.

    In the case of a DML operation (for example, REMOVE) the sample data should show what look like the paintings before the DML, and results will be the content of the or the tables changed after the DML.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

  • find the previous value of the oracle table

    Hello
    I have a stat table who got the news as login_date, user_id, etc..

    For a specific user, I have a requirement based on the no the difference in days between the date of opening of the current session and the date of last.

    For example, Tom connected on June 4, 2013. His previous connection was May 31. No_of_days_difference is 5 days.

    How to programmatically for each user inside a block of sub pl - sql.

    Appreciate your help

    Thank you
    KP

    Hello

    Here's one way:

    WITH     got_analytics     AS
    (
         SELECT     user_id, login_date
         ,     LAG (login_date) OVER ( PARTITION BY  user_id
                                       ORDER BY      login_date
                               )  AS prev_login_date
         ,     ROW_NUMBER ()       OVER ( PARTITION BY  user_id
                                       ORDER BY      login_date    DESC
                               )  AS r_num
         FROM    stat
    --     WHERE     ...     -- If you need any filtering, put it here
    )
    SELECT       user_id, login_date
    ,       prev_login_date
    ,       login_date - prev_login_date     AS days_difference
    FROM       got_analytics
    WHERE       r_num          = 1
    ;
    

    As you can see, you needn't PL/SQL to do this, but if you need to use the PL/SQL for another reason, you can do the same thing in PL/SQL.

    I hope that answers your question.
    Otherwise, your zip code, a little sample of data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Point where the above statement is erroneous results, and explain, using specific examples, how you get the right result of data provided in these places.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • Best practices for connecting to a database from a Web service

    I develop Web services that need to connect to an Oracle database. Currently, I connect to the database using jdbc as this class:

    con = DriverManager.getConnection (connectURL, "HR_DATA_READERS", "xxxxx").

    I do not like this approach because it hardcodes the connection string and account information. One of our colleagues has suggested that we use the properties file, but this leaves the user name and password in full view. Given that we can define jdbc dataources on the server of the SOA and the server offers all the nice features like pooled connection etc, is there a way to connect to the database using the data source defined the SOA rather than defining a connection server jdbc in the Web service itself? Is the best way to do it or is there still a way paste?

    Thank you

    Hi, Alix,.

    If you are JEE compatible environment. i.e. WLS 12 c, you can use resource injection approach, instead of manually coding the above proposed DS research.

    More information on injected resources and you will find here - http://docs.oracle.com/cd/E19226-01/820-7627/6nisfjmbl/index.html

    "For example, you can use this tutorial - Servlet JDBC DataSource resource Injection" Open tutorials

    Take a look at sections 5.3 and 5.4 only, which is what the code should look like and how to configure resource in the web.xml file.

    And always use finally to try to close the db connection, otherwise in the case of exceptions, as it is not returned to the pool and at some point he's going to get exhausted.

    Hope this helps,

    A.

  • Best practices for creating a new project from an existing WebHelp

    I am currently working to WebHelp Pro (version RH is 9.0.2.271).

    I have a WebHelp project that currently supports the 2012 version of one of our projects. What I had to do was to create a separate project for 2013, using files of 2012 as a starting point. I couldn't find a way in HR to create a new project by importing an existing project of WebHelp, so I copied the files of 2012 in a new directory, open the project and renamed it.

    What drives this issue is that, as a result of this exercise, all seemed well, for once. However, I recently had to create new topics in the 2012 version. However, when I imported these subjects to the 2013 and compiled project, they disappeared - even if the htm files still appear in the appropriate folder of the file 2013 (when we look at with Windows Explorer).

    After reading a few posts on the forum, I thought I might have corrupted my database by creating the incorrectly the new project-, but if what I've done, it's the wrong way to go about this, I don't know what is the right way. I will be grateful for any suggestion.

    The easy way to do this is to create a copy using Windows Explorer.

    Open the project and click file > rename.

    Then you have your project is ready in 2013.

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • Create the flat file data from the oracle table

    d_adp_num char (10)
    d_schd_date tank (8)
    d_sched_code tank (25)
    d_pay_code char (50)
    d_mil_start char (4)
    d_mil_end char (4)
    d_duration char (5)
    d_site_code char (4)
    d_dept_id tank (6)

    Select payroll_id,
    schedule_date,
    reason_code, (sched_code)
    reason_code, (pay_code)
    start_time,
    end_time,
    total_hours,
    site_code,
    department_id
    of dept_staff
    where schedule_date between (sysdate + 1) and (sysdate + 90)


    loading data for the date range instead.
    sched_code - if 'Unavailable' reason_code = 'OD' and 'THE '.

    pay_code - "Berevevement BD" If reason_code = "BD".
    "UP PTO without reasonable excuse" If reason_code = 'UP '.
    "RG" If reason_code = "SH".
    "PTO" If reason_code = "GO".
    Here are some...

    start_time and end_time - convert military time
    based on start_ampm and end_ampm

    On this basis, I need help to create a flat file. Sewing of the flat and data file in dept_staff sample

    If site_code is there so no need to get department_id (see the sample flat file)
    ------------------------------------

    examples of data to flat file

    ZZW002324006072012 PTO
    0800160008.00
    ZZW002428106072012 RG
    1015174507.50HM34
    ZZW002391606072012 RG
    1100193008.50
    ZZW002430406072012 RG
    1100193008.50 130000
    ----------------------------

    dept_staff table data

    REASON_CODE_1 PAYROLL_ID SCHEDULE_DATE REASON_CODE START_TIME, END_TIME START_AMPM END_AMPM TOTAL_HOURS SITE_CODE DEPARTMENT_ID
    ZZW0024468 08/06/2012 HS HS 730 HAS 400 850 12 P
    ZZW0000199 08/06/2012 HS HS 730 HAS 400 850 14 P
    ZZW0023551 08/06/2012 SH SH 1145 A 930 975 GH08 95 P
    ZZW0024460 08/06/2012 SH SH 515 HAS 330 P 1025 GH08 95
    ZZW0023787 08/06/2012 SH SH 630 HAS 300 850 24 P
    ZZW0024595 08/06/2012 TR TR 730 HAS 400 850 90 P
    ZZW0023516 08/06/2012 OD OD 800 HAS 400 800 95 P
    ZZW0023784 08/06/2012 OD OD 800 HAS 400 800 5 P
    ZZW0024445 08/06/2012 SH SH 1145 A GH08 930 975 5 P
    ZZW0024525 08/06/2012 OD OD 800 HAS 400 800 23 P
    ZZW0024592 08/06/2012 TR TR 730 HAS 400 850 5 P
    ZZW0024509 08/06/2012 SH SH 95 MK21 830 HAS 330 P 700

    ZZW0023916 06/14/2012 SH SH 1100 A 850 27 730 P

    How to ask questions
    SQL and PL/SQL FAQ

    UTL_FILE allows to write the OS file

  • Best practices for Smartview when upgrading from Excel 2003 to Excel 2007?

    Anyone know the best practice for Smartview during the upgrade from Excel 2003 to Excel 2007?


    Current users have Microsoft Excel 2003 with Smartview 9.3.1.2.1.003.

    Computers are upgraded to Microsoft Excel 2007.


    What is the best practice for Smartview in this situation?

    1. do nothing with Smartview and just install Excel 2007.

    2. install Excel 2007 and then uninstall and reinstall Smartview

    3 uninstall Smartview, Excel 2007 installation and then install Smartview

    4 something else?


    Thank you!

    We went with option 1 and it worked very well. Be aware that OAS Treaty substantially slower in Excel 2007 to 2003. Many users have been/is unhappy about the switch. We have not tested SV v11 yet, so I don't know if it has improved performance with Excel 2007 or not (hopefully it does).

  • Best practices for color use in Adobe CC?

    Hi all

    Is there an article that describes the best practices for use of color in Adobe CC?

    I produce a mixture of viewing online (PDF, for the most part) and real world print projects - often with the obligation for both. I recently updated my PANTONE + bridge books for the first time in ages and I am suddenly confused by the use of Lab colors in the Adobe Suite (Illustrator and InDesign).

    Everything I found online, looks like Lab color mode preferred to use because it is device independent. And perceptual (on screen), it looks much closer to the color, it is trying to represent. But when I mark a Spot color Illustrator rectangle using laboratory coordinates, to the sides of a rectangle using PANTONE + bridge CP and then export it to PDF, the version of CP to mix CMYK color corresponds exactly to my Pantone book - while the version of laboratory (after converted to CMYK using the ink Manager) is far away.

    I have this fantasy to manage only a single Illustrator or InDesign file for both worlds (PDF) printed and online. Is not possible in practice?

    Any info describing the basic definitions of the color modes - or even a book tracing more than use them in the real world - would be much appreciated!

    Thank you

    Bob

    Here are a few best practices you can already do.

    1 make sure that your color settings are synchronized on all applications.

    2. use a CMYK profile appropriate for your print output. Lab spot colors convert to CMYK values based on the CMYK icc profile.

    3. include icc profiles when save or export pdf files

    In theory, your imagination is possible today. It requires color management and the use of icc profiles. You can place RGB images in InDesign and use Pantone colors in your objects. The problem lies in the printers. If a printer uses a RIP with built in Pantone library, the colors will match when printing. Unfortunately, this kind of CUT is more expensive and not enough printers use them. Most of them is always manually approximate CMYK values composition given Pantone colors.

Maybe you are looking for

  • Satellite L755-128 stop without reason

    Problem #1 when I play games after 30 to 60 minutes pc closed down and power led + battery led flashes orange Problem #2 a few times locking digital LEDs have a variable glow is like a light bulb that receive the variable power. Example of battery pr

  • Computer HP laptop sometimes hangs at startup, op Vista sytem

    I have a problem... when I start myy comp. it sometimes freezes after hp logo, when I manually turn it off and restart it, it will usually normally then. but this freeze won't happen very often maybe 1 x per 3 startups... Please answer me its very an

  • Impossible to disconnect, receive error message "THE DEVICE 'GENERIC VOLUME' IMPOSSIBLE BE STOPPED RIGHT NOW"

    "I CAN'T DISCONNECT MY SEAGATE EXTERNAL DRIVE I GET A MESSAGE SAYING 'THE DEVICE' GENERIC VOLUME ' CANNOT BE STOPPED NOW, TRY THE STOP DEVICE LATER, HELP PLEASE

  • Impossible to install any version of Java 8

    I tried to update my Java runtime version 8u71, and after downloading the installer and open it's nothing past. I thought I would uninstall other versions I've had on my computer, so I did. That has not fixed the problem. I also tried JavaRa to remov

  • 13 elements changing computer

    I have bought 13 element in 2015. I recently changed my macbook to a more recent and have been using the package on a desktop computer as well. It is approved for two computers. I took it to the old macbook until I started to use it on this one, but