SQL query not retrieving special characters in like O', M÷ and û

Hi,
I have a sql script to query database. The output is a string. When I execute this script through a Korn shell script to send the query result to a .csv file, it is showing some characters of the output as below.
The characters O’ is displayed as ?
The characters M÷ is displayed as ?
The characters û is displayed as u
I am able to retrieve the data as it is while running the script through SQL * Plus and spooling the output to a .csv file.
If anybody is having solutions for this please reply.
Thanks in advance for your kind help
Regards,
Sreesha
Edited by: user530278 on Oct 18, 2008 2:56 PM

user530278 wrote:
Hi,
I have a sql script to query database. The output is a string. When I execute this script through a Korn shell script to send the query result to a .csv file, it is showing some charcters of the output as below.
The characters O’ is displayed as ?
The characters M÷ is displayed as ?
The characters û is displayed as uThis sounds like an NLS client setting issue.
Note that there are scenarios where the data is "incorrectly" stored in the database but can be retrieved "successfully" from some clients. This is the case if you specify the same character set at your client as you have as database character set and this client character set setting is wrong, which means you ought to have specified a different client character set than you have in the database.
Specifying the same character set on client and server prevents any conversion from taking place, so as long as the database can store the data (e.g. multi-byte characters won't be stored correctly in single-byte character set database no matter what you do) it will be stored "as is". If you now retrieve the data using the same setting, it looks correct, but if you use a client with a different character set setting that requires conversion the data will be mangled.
The database character set can be identified using the dictionary view NLS_DATABASE_PARAMETERS, parameter "NLS_CHARACTERSET".
The client character set can be identified by issuing the following at the SQL*Plus prompt:
SQL> @[%NLS_LANG%]You'll get a message similar to:
"Unable to open file [AMERICAN_AMERICA.WE8MSWIN1252]"
The string after the dot represents the client character set.
If you get this:
Unable to open file "[%NLS_LANG%]"
then the NLS_LANG client setting is undefined.
Please follow this very useful link regarding client NLS issues and how to resolve them, in particular to determine what is your correct client NLS_LANG setting:
http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm
I am able to retreive the data as it is while running the script through SQL * Plus and spooling the output to a .csv file.You mean that when using SQL*Plus interactively the data is shown/spooled correctly, whereas if you run a script non-interactively then the data is mangled?
Note that if you e.g. use "cron" to schedule/execute your script that you need to take care of the Oracle specific environment variables yourself because no logon scripts are executed when cron forks the process to run. May be you need to define the NLS_LANG variable explicitly or call/source the corresponding script to define your default Oracle environment that includes the NLS_LANG setting.
It probably depends on your environment, operating system, etc. and how you set the Oracle specific settings, e.g. environment variables under Unix, registry settings under Windows etc.
Use the above mentioned check regarding NLS_LANG setting in the different cases that you encounter to get started.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/

Similar Messages

  • Dynamic SQL Query to Find Special Characters in Table columns

    Hi,
    I am new to OTN FORUMS.
    I am trying to find the columnsi of a table which have special characters in them.
    I am planning on using this query
    select ' select INSTR('||column_name||', chr(0))
    from '||table_name||'where INSTR('||column_name||', chr(0)) >0' from user_tab_columns
    where table_name='Account'
    and spool the output to run as a script.
    Is this the right way or do u suggest any modifications to the query?
    Thanks in advance.

    Hi,
    I think your basic approach is right. Since you can't hard-code the table- or column names into the query, you'll need dynamic SQL.
    Instead SQL-from-SQL (that is, writing a pure SQL query, whose output is SQL code), you could do the whole job in PL/SQL, but I don't see any huge advantage either way.
    When you say "Special character<b>s</b>", do you really mean "one given special character" (in this case, CHR(0))?
    Will you ever want to search for multiple special characters at once?
    What if table foo has a column bar, and in 1000 rows of foo, bar contains CHR (0). Do you want 1000 rows of output, each showing the exact position of the first CHR(0)? If the purpose is to look at theese rows later, shouldn't you include the primary key in the output? What if CHR(0) occurs 2 or more times in the same string?
    If you'd rather have one row of output, that simply says that the column foo.bar sometimes contains a CHR(0), then you could do something like this:
    SELECT     'foo',     'bar'
    FROM     dual
    WHERE     EXISTS (
                SELECT  NULL
                FROM       foo
                WHERE       INSTR ( bar
                            , CHR (0)
                        ) > 0
                );

  • Retrieving special characters through an HttpRequest

    Why I can not retrieve special characters like accents, spanish chars, etc. through an HttpRequest? Instead of the special char I want to retrieve it always changes them to another symbol. For example (ni�o, informaci�n)
    Is there any way to do it?
    Thanks in advance

    The HTTP specifications say that data sent through HTTP must be in ASCII. Those accented characters are not in the ASCII character set, so when you ignore the rule and send them anyway, they become mangled. You'll observe that this forum has the same problem.
    The HTTP specs do provide a way to send non-ASCII characters, though, through some kind of escaping or encoding. You could look it up, they are in an RFC on the Internet somewhere. However, you are probably asking about characters that are sent to you by some agent (probably a browser) that you do not control.

  • ### Problem in retrieving special characters with Oracle 9i JDBC drivers

    hi,
    We are having some problem with retrieving special characters like '�' from the database.
    Our application is using JDK1.3.1 with Oracle 9i at the back end(Version: 9.0.1.0.0). We are using oracle 9i thin drivers (classes12.zip) for database interaction.
    To relieve the data from database we are using PreparedStatement in two ways
    1. Creating a preparedstatement from connection object without any parameters and then retrieve the
    data using it. This gives the results in correct format i.e. special characters like '�'
    2. Create the preparedstatement by passing the following parameters.
    i) ResultSet.TYPE_SCROLL_INSENSITIVE
    ii) ResultSet.CONCUR_READ_ONLY
    In this case we are not able to retrieve the special character like '�' correctly. Instead the ResultSet
    returns 'h'
    I think this is the problem with Oracle drivers. Does anyone have any information about the mentioned problem.
    rgds

    I don't know exactly (because I am using JDK 1.4 with ojdbc14.jar where these problems seem to be rare...) but you may consider this:
    1. Add nls_charset12.zip to your classpath to ensure that the encoders are present (may or may not help)
    2. Swith to JDK 1.4, and do this:
    Instead of String s = getString(column)
    use
    byte[] bytes = getBytes(column);
    ByteBuffer bb = ByteBuffer.wrap(bytes); // in package java.nio
    CharBuffer cb = Charset.forname("ISO-8859-x").decode(bb);
    String s = cb.toString();
    The latter method allows you to perform the encoding/decoding manually.
    3. Change the character encoding in the database to unicode upon database setup.
    4. Try playing with NLS parameters (alter session ...)

  • SQL query to retrieve totals from "supporting Details"

    We've had a strange issue where the totals from the supporting details aren't adding up to the value submitted in essbase.
    In effect our RDMS is out of sync with Planning.
    In order to remedy this, I'm trying to build a SQL query to retrieve the value of the supporting details.
    Here is my Sql statement so far :
    SELECT
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    SUM(NVL(HCDI.VALUE,0)) AMOUNT
    FROM hsp_column_detail HCD,
    hsp_column_detail_ITEM HCDI,
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE hcd.detail_id = hcdi.detail_id
    AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and hcdi.generation = 0
    GROUP BY HO1.OBJECT_NAME, HO2.OBJECT_NAME, HO3.OBJECT_NAME, HO4.OBJECT_NAME,
    HO5.OBJECT_NAME,
    HO6.OBJECT_NAME,
    HO7.OBJECT_NAME,
    HO8.OBJECT_NAME,
    HO10.OBJECT_NAME,
    HO12.OBJECT_NAME,
    HO13.OBJECT_NAME,
    HO15.OBJECT_NAME,
    HO16.OBJECT_NAME,
    HO17.OBJECT_NAME
    ORDER BY HO1.OBJECT_NAME, HO3.OBJECT_NAME, HO2.OBJECT_NAME

    This query works using PL SQL and has been used on Oracle 9.2.3.
    Cheers,
    Jeremie
    Here is the Query:
    set serveroutput on;
    set serveroutput on size 1000000;
    --set buffer_size 10000000;
    --set line_size 2000;
    --DBMS_OUTPUT.size = 2000000;
    DECLARE
    CURSOR BUDGET_HEADERS_CU IS
    SELECT
    hcd.detail_id,
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    hcd.dim1 SCENARIO_id,
    hcd.dim2 ACCOUNT_id,
    hcd.dim3 ENTITY_id,
    hcd.dim4 Month_id,
    hcd.dim5 Version_id,
    hcd.dim6 Currency_ID,
    hcd.dim7 Year_ID,
    hcd.dim8 Project_ID,
    hcd.dim10 CC_ID,
    hcd.dim12 Grplcl_ID,
    hcd.dim13 Product_ID,
    hcd.dim15 SalesRegion_ID,
    hcd.dim16 ContractAnalysis_ID,
    hcd.dim17 IC_ID
    FROM hsp_column_detail HCD, /*hsp_column_detail_item HCDi,*/
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE /*hcd.detail_id = hcdi.detail_id
    AND*/ hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and HO5.OBJECT_NAME = 'Working'
    --and hcdi.generation != 0
    --and hcdi.label like 'JRTEST-%'
    --and hcd.detail_id = 253102
    /*GROUP BY HCD.Dim1, HCD.Dim2, HCD.Dim3, HCD.Dim4,
    HCD.Dim5,
    HCD.Dim6,
    HCD.Dim7,
    HCD.Dim8,
    HCD.Dim10,
    HCD.Dim12,
    HCD.Dim13,
    HCD.Dim15,
    HCD.Dim16,
    HCD.Dim17*/;
    CURSOR BUDGET_DETAILS_CU(
    /*scenario_p in varchar2,
    account_p in varchar2,
    entity_p in varchar2,
    month_p in varchar2,
    version_p in varchar2,
    currency_p in varchar2,
    year_p in varchar2,
    project_p in varchar2,
    cc_p in varchar2,
    grplcl_p in varchar2,
    product_p in varchar2,
    salesregion_p in varchar2,
    contractanalysis_p in varchar2,
    ic_p in varchar2*/
    detail_id_p in number
    IS
    SELECT
    /* HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC, */
    label,
    NVL(HCDI.VALUE,0) AMOUNT,
    HCDI.Position,
    HCDI.operator,
    HCDI.generation
    FROM /*hsp_column_detail HCD,*/
    hsp_column_detail_ITEM HCDI
    /* HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17*/
    --WHERE hcd.detail_id = hcdi.detail_id
    WHERE hcdi.detail_id = detail_id_p
    /*AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id*/
    --and hcdi.generation != 0
    --and label like 'JRTEST-%'
    /*AND HCD.Dim1 = scenario_p
    AND HCD.Dim2 = account_p
    AND HCD.Dim3 = entity_p
    AND HCD.Dim4 = month_p
    AND HCD.Dim5 = version_p
    AND HCD.Dim6 = currency_p
    AND HCD.Dim7 = year_p
    AND HCD.Dim8 = project_p
    AND HCD.Dim10 = cc_p
    AND HCD.Dim12 = grplcl_p
    AND HCD.Dim13 = product_p
    AND HCD.Dim15 = salesregion_p
    AND HCD.Dim16 = contractanalysis_p
    AND HCD.Dim17 = ic_p*/
    ORDER BY hcdi.position;
    -- Variable Declaration
    running_total_ln number :=0;
    prev_running_total_ln number :=0;
    add_amount number :=0;
    multiply_amount number :=1;
    prev_generation number :=0;
    prev_add_amount number :=0;
    prev_multiply_amount number :=1;
    running_total_gen0 number :=0;
    running_gen0_op number :=0;
    running_total_gen1 number :=0;
    running_gen1_op number :=0;
    running_total_gen2 number :=0;
    running_gen2_op number :=0;
    running_total_gen3 number :=0;
    running_gen3_op number :=0;
    running_total_gen4 number :=0;
    running_gen4_op number :=0;
    running_total_gen5 number :=0;
    running_gen5_op number :=0;
    output_file utl_file.file_type;
    -- Begin PL/SQL processing
    BEGIN
    --DBMS_OUTPUT.
    DBMS_OUTPUT.ENABLE(1000000);
    DBMS_OUTPUT.PUT_LINE('Begin Processing');
    output_file := utl_file.fopen ('C:\temp', 'test.txt', 'W');
    -- Begin Header For Loop
    FOR BUDGET_HEADERS_CV IN BUDGET_HEADERS_CU
    LOOP
    --Reset Running Totals
    running_total_ln:=0;
    prev_running_total_ln:=0;
    add_amount:=0;
    multiply_amount:=1;
    prev_generation:=0;
    prev_add_amount:=0;
    prev_multiply_amount:=1;
    running_total_gen0:=0;
    running_gen0_op:=0;
    running_total_gen1:=0;
    running_gen1_op:=0;
    running_total_gen2:=0;
    running_gen2_op:=0;
    running_total_gen3:=0;
    running_gen3_op:=0;
    running_total_gen4:=0;
    running_gen4_op:=0;
    running_total_gen5:=0;
    running_gen5_op:=0;
    -- Begin Detail For Loop
    FOR BUDGET_DETAILS_CV IN BUDGET_DETAILS_CU(
    BUDGET_HEADERS_CV.Detail_ID
    /*BUDGET_HEADERS_CV.SCENARIO_ID,
    BUDGET_HEADERS_CV.ACCOUNT_ID,
    BUDGET_HEADERS_CV.ENTITY_ID,
    BUDGET_HEADERS_CV.Month_ID,
    BUDGET_HEADERS_CV.Version_ID,
    BUDGET_HEADERS_CV.Currency_ID,
    BUDGET_HEADERS_CV.Year_ID,
    BUDGET_HEADERS_CV.Project_ID,
    BUDGET_HEADERS_CV.CC_ID,
    BUDGET_HEADERS_CV.Grplcl_ID,
    BUDGET_HEADERS_CV.Product_ID,
    BUDGET_HEADERS_CV.SalesRegion_ID,
    BUDGET_HEADERS_CV.ContractAnalysis_ID,
    BUDGET_HEADERS_CV.IC_ID*/
    LOOP
    -- Null;
    add_amount :=0;
    multiply_amount :=1;
    IF BUDGET_DETAILS_CV.OPERATOR = 1 THEN
    add_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 2 THEN
    add_amount := BUDGET_DETAILS_CV.Amount * -1;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 3 THEN
    multiply_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 4 THEN
    multiply_amount := 1/BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.Position = 0 then
    running_total_gen0 := add_amount*multiply_amount;-- we are dealing with the first line
    Else
    if BUDGET_DETAILS_CV.GENERATION = prev_generation then
    -- run whatever total we are on up
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation +1 then
    -- we are going up a generation
    -- (we cannot go up to gen0
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1:=0;-- reset gen1 counter
    running_gen0_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen0 := running_total_gen0/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 0 total
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2:=0;-- reset gen1 counter
    running_gen1_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen1 := running_total_gen1/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 1 total
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3:=0;-- reset gen1 counter
    running_gen2_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen2 := running_total_gen2/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 2 total
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 1 then
    -- we are Down a generation
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    -- we need to add the current member to the gen2
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 2 then
    -- we are Down 2 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 3 then
    -- we are Down 3 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    end if;
    END IF;
    End IF;
    END LOOP; -- End of Detail Loop
    --DBMS_OUTPUT.PUT_LINE(BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    utl_file.put_line(output_file,BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    /*BUDGET_HEADERS_CV.SCENARIO, BUDGET_HEADERS_CV.ACCOUNT, BUDGET_HEADERS_CV.ENTITY, BUDGET_HEADERS_CV.Month, BUDGET_HEADERS_CV.Version,BUDGET_HEADERS_CV.Currency, BUDGET_HEADERS_CV.Year, BUDGET_HEADERS_CV.Project, BUDGET_HEADERS_CV.CC, BUDGET_HEADERS_CV.Grplcl, BUDGET_HEADERS_CV.Product, BUDGET_HEADERS_CV.SalesRegion, BUDGET_HEADERS_CV.ContractAnalysis, BUDGET_HEADERS_CV.IC */
    END LOOP; -- End of Header Loop
    --DBMS_OUTPUT.PUT_LINE('Total');
    -- DBMS_OUTPUT.PUT_LINE('End Processing');
    utl_file.fclose(output_file);
    END;
    Edited by: JeremieR on Apr 18, 2011 5:02 AM

  • Special characters / symbols  like u2018u2206u2019 are displayed as u2018#u2019 in the print pr

    While displaying print preview / taking print output using QGA3 Transaction with developed Z SAPScript form specified as one of the parameters(say for example ZARMEXP), the special characters / symbols  like u2018∆u2019 are displayed as u2018#u2019 in the print preview / print output . Of course similar problem had existed for Lambda Symbol u2018u03BBu2019., but it was resolved by using the font type Helve_I7. But for the symbol u2018∆u2019 we checked with almost all the fonts that were available in the system, but of not much use. Hence could you kindly provide us solution(s) that would resolve this issue.

    Hi,
    I hope this depends on the printer settings.
    Check whether your printer could support these characters or not!
    Thanks and Best Regards,
    Suresh

  • SQL query not calculating

    SQL query not calculating
    gross_amount is giving the value of extended_amount and the gross_price_rc is giving the value of unit_selling_price
    select customer_trx_line_id,
    ( extended_amount / 1- (decode(decode(attribute6,null,0)+decode(attribute7,null,0)+decode(attribute8,null,0)+decode(attribute9,null,0)/100,null,0,1,0))) GROSS_AMOUNT,
    ( unit_selling_price /1-(decode(decode(attribute6,null,0)+decode(attribute7,null,0)+decode(attribute8,null,0)+decode(attribute9,null,0)/100,null,0,1,0))) gross_price_rc
    from ra_customer_trx_lines_all
    where attribute6 is not null or attribute7 is not null or attribute8 is not null or attribute9 is not null
    whats the isuue here??
    Thanks

    decode(attribute7,null,0)Looking at it again, this always returns 0 or NULL, so it not really surprising
    DECODE
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions040.htm#i1017437
    CASE
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm#i1033392

  • 'Do not encode special characters' preference not working

    I have the preferences in Dreamweaver set to "Do not encode
    special characters in url'. However, every time I paste a url in
    the properties box, when I go to the source code, Dreamweaver has
    encoded the special characters, especially the "&". Is there
    another setting I have to change somewhere, or is there an update
    that fixes this?
    Thanks.

    "Jade73" <[email protected]> wrote in
    message
    news:fcbroh$7ih$[email protected]..
    >I have the preferences in Dreamweaver set to "Do not
    encode special
    >characters
    > in url'. However, every time I paste a url in the
    properties box, when I
    > go to
    > the source code, Dreamweaver has encoded the special
    characters,
    > especially the
    > "&". Is there another setting I have to change
    somewhere, or is there an
    > update that fixes this?
    You can find updaters for dreamweaver here
    http://www.adobe.com/support/dreamweaver/downloads_updaters.html

  • How to create sql query for item master with operator LIKE with variables?

    hi all,
    How to create sql query for item master with
    operator LIKE(Contains,Start With,End With) with variables using query generator in SAP B1 ?
    Jeyakanthan

    Hi Jeyakanthan,
    here is an example (put the like statement into the where field)
    SELECT T0.CardCode, T0.CardName FROM OITM T0 WHERE T0.CardName Like '%%test%%'
    The %% sign is a wildcard. If you need start with write 'test%%' and otherwise ends with '%%test'. For contains you need '%%test%%'. You also could combinate this statements like 'test%%abc%%'. This means starts with test and contains abc.
    Regards Steffen

  • Reading special characters from a flat file and inserting into DB

    I'm reading data with special characters like . etc from a flat file , assigning the data to variable in my anonymous block and inserting into my DB. But the show up as inverted ? s. Any clues about how to do this?
    If i try to do the insert directly it works. It seems like the error occurs when reading this data into a variable
    thanks for the help
    Lalit Bhatia

    lalit, this is probably an character set problem, the default on Database creation tends to be 7bit Ascii which does not support special characters, it's been a while since I set up a db in this way, but you need to change settings in oracle.ini. The db will need to be restarted for this. Also, to check current settings try:
    select * from NLS_DATABASE_PARAMETERS
    You want an 8bit, unicode or multibyte character set. Sorry I cannot remember moer off the top of my head, try searching on NLS or character set

  • Why is my firefox not opening specific web sites like youtube, facebook and hotmail? Please help me or ill will have to start using another browser....

    I can not open specific web sites like youtube, facebook and hotmail in my firefox! This time is youtube, last time was hotmail and now also facebook...

    Do a malware check with some malware scanning programs.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    * "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    More:
    * http://kb.mozillazine.org/Error_loading_websites

  • Storing carriage return and other special characters in a TestStand variable and passing to LabVIEW

    I am using TestStand step to call a LabVIEW VI that writes commands to a serial device.  The device expects a carriage return at the end of the command.  I can create a constant string in TestStand with the carriage return, e.g., "ATA\x0D" and pass that to a LabVIEW string control which shows ATA\r and the VI works properly.
    To provide consistency and flexibility in my code, I want to store the terminator character(s) in a TestStand variable.  However, when I try to use an expression to create the command string, i.e. "ATA" + "Locals.Terminator", where Locals.Terminator is set to "\x0D", my LabVIEW VI string control shows "ATA\\x0D" which doesn't work.  And when I try Locals.Terminator set to "\r", the LabVIEW string control shows "ATA\\r" which doesn't work either.
    Is there a way to store special characters in a TestStand variable and pass them to LabVIEW as special characters?  I saw in another post that if you edit the TestStand variable by pressing Cntl-Enter, it will store  the newline \n properly and it can be sent to LabVIEW - that works for me as well for \n.  But  I need to send a carriage return.
    I've attached my test sequence and the corresponding LabVIEW VI with a string control.
    Hans
    Attachments:
    Special Chars.seq ‏27 KB
    String Passing.vi ‏13 KB

    Hi Hans, 
    Thanks for your detailed explanation and examples.  In TestStand, change the String parameter's String Type to Binary String instead of ASCII.  Then it will pass the desired value.
    Cheers,
    David Goldberg
    National Instruments
    Software R&D

  • SQL query to list all collections, members, OS, SP, IP and if physical/virtual

    Hi guys, I have the below query which lists all the collections and their members, however I need to expand it to also include the OS, Service Pack, IP and if it's a physical or virtual machine.
    I've tried a few things but only made it worse. Is anyone able to expand the below code to include those extras??
    SELECT
    v_FullCollectionMembership.CollectionID AS 'CollID',
    v_Collection.Name AS 'CollName',
    v_FullCollectionMembership.Name AS 'SystemName'
    FROM
    v_FullCollectionMembership, v_Collection
    WHERE v_FullCollectionMembership.CollectionID = v_Collection.CollectionID
    ORDER BY
    CollID ASC, SystemName ASC

    Hi,
    These requirements could be found in several threads or blogs. We need convert WQL to SQL, and you can involve SQL guys to integrate the statements and format the result.
    How to create a all virtual machines collection.
    SCCM SQL Query - IP Address
    ConfigMgr Systems without Current Service Packs, and System Patch Status 

  • DomHandle can not fetch special characters like , or &......

    hi friends......
    I'm using following packages...........
    When I store special characters....like < , > or &......DomHandle can not fetch the values from xml file......why so??? Anybody faced same problem??????
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.w3c.dom.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;

    it actually converts < & > to < & > and so
    on.......but still when it again tries to read
    it....it fails & throws exceptionDepending on what is to be accomplished, I had an issue earlier today and this is how I solved it:
    I needed to put a url with post data:
    Something
    Now to do this we can split this up in parts, tried writing out everything using CDATA and a few other things. But the Damn <'s and >'s would get converted into &lt; and &gt;
    So I did this:
    <a>
    <xsl:attribute name="href">
    <![CDATA[bob.jsp?something="]]><xsl:value-of select="@SomeAttrib"/><![CDATA["]]>
    </xsl:attribute>
    Something</a>
    Hope this helps

  • Query to Handle special characters in the conditions

    Hi all,
    We have a table for colour codes and there related information but the colour codes have special characters in them like
    AL&.MPD
    CH(SB00
    ECA&BC1
    TD..0023
    0O'DON4
    i need to check if these exist in the table or not but when i query like
    select * from art.tb_color_code where color_code in ('AL&.MPD','CH(SB00','ECA&BC1','TD..0023','0O'DON4');
    i get prompts for entering the variable values there are 2500 such codes
    how do i negate the special meanings of these characters
    Regards
    Maverick

    Hi,
    If a string literal contains an apostrophe, use two consecutive apostrophes.
    For example:
    '0O''DON4'is a seven-character string. The third character is an apostrophe.
    As others have said,
    SET   DEFINE  OFFwill disable the special meaning of & in SQL*Plus.

Maybe you are looking for

  • What's the best XML for JAVA?

    Hi There, My big question is what should I use for develop a normal XML document, that can: - contain BASE64 strings - support UTF-8 add attributes, etc. I then want to pick this document and: - do it's parsing (walk trough) - apply a xsl to this doc

  • Material replication ECC-SRM, in wrong queue (outbound in SRM system)

    Hi, I'm working in SRM 5 integrating with multiple ECC systems. When attempt to replicate materials from one of the ECC systems, if I run the transaction R3AS for MATERIAL, the Monitor Load Transaction shows the object is "Running" indefintely. I che

  • ROOT can't enter in the database

    Hi. I have a problem: I need to install a oracle 9i database to a client and configure it. Then, the client will administer the DB and I'll only make the full offline backup. I'll have the root password, but the client wants a way that me, with the r

  • E51 Unable to perform bluetooth operation.

    Hi Team, I am a proud owner of Nokia E51 from last one year,i am facing issue in turning on the bluetooth from past few day . Whenever i try to turn on the bluetooth it gives an error message "Unable to perform bluetooth operation." I tried both soft

  • Java runtime not present

    I have Java 7.45 installed but I can't play my games. I deleted everything that had to do with Java and reinstalled it, my games still just don't open. I used terminal to try and troubleshoot, and I got a message saying "No Java runtime present, requ