in the DECODE statement error

Hello

I wrote that decode the clause but anyway its not working and giving expression error.
SELECT 
( DECODE
(
 select param_value from feed_parameter where upper(param_name) = 'SOURCEENV' and feed_id=5085 AND CLOSE_ACTION_ID IS NULL
),'NTSNGN','mput \\csng11p20126\risk-mgt$\app\data\rds\PLNMARS4\done\',
  'NTNYC' ,'mput \\nnyc11p20008\risk$\app\data\rds\PLNMARS4\done',
           'DONE PATH') "path"
)                                   
FROM feed_parameter;
Is there any mistake in this expression?
SELECT

DECODE(PARAM_VALUE,
'NTSNGN',
'mput \\csng11p20126\risk-mgt$\app\data\rds\PLNMARS4\done\',
'NTNYC' ,
'mput \\nnyc11p20008\risk$\app\data\rds\PLNMARS4\done',
'DONE PATH') AS PATH
from feed_parameter
WHERE UPPER(PARAM_NAME) = 'SOURCEENV'
AND FEED_ID=5085
AND CLOSE_ACTION_ID IS NULL

Try it please.

Published by: Mahir M. Quluzade March 7, 2011 12:28

Tags: Database

Similar Questions

  • Get the SQL statement error programmatically

    Hello

    error SQL in the FORMS, you can display the erroneous SQL statement pressing (shift) (Ctrl) E on the screen. Is there a way to get the text of the SQL statement in a PL/SQL function for logging purposes?

    I get the error using SQLERRM, it's not a problem. But how can I get the SQL text of the statement?

    Thanks and regards,

    Sascha

    Sascha,

    You should be able to use the: SYSTEM. System LAST_QUERY variable forms.

    Craig...

  • Person registering in the Merge statement error!

    Is it possible to save indivudual error in the MERGE statement (Update / Insert).
    I'm unable to save these error. instead of MERGING, if I update the table in the cursor loop then I am able to record the individual error but the process takes time.
    Thanks in advance.
    Deba

    Hi Deba,

    Logging of DML errors:

    SQL> create table tab1 (x number(1));
    
    Table created.
    
    SQL> exec dbms_errlog.create_error_log('tab1')
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> merge into tab1 t
      2        using (select 1 x from dual union all
      3               select 112 x from dual) s
      4  on (t.x = s.x)
      5  when not matched
      6  then insert (x) values (s.x)
      7  log errors into err$_tab1 reject limit unlimited;
    
    1 row merged.
    
    SQL>
    SQL> COL x for 9999
    SQL> select * from tab1;
    
        X
    -----
        1
    
    SQL> COL x for a4
    SQL> select ora_err_number$, X from err$_tab1;
    
    ORA_ERR_NUMBER$ X
    --------------- ----
               1438 112
    
    SQL>
    

    Concerning
    Peter

  • No data found in the select statement error

    Hi all

    Find my sample table and data structure:
    SQL> desc states;
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ------------------------------------
     SNO                                                            NUMBER
     SNAME                                                          VARCHAR2(10)
    
    SQL> select*from states;
    
           SNO SNAME
    ---------- ----------
             1 kerala
             2 Tamil nadu
             3 AP
             4 MP
             5 jammu
    Now, I create a block like:
    declare
    v_state varchar2(20):=' AP';
    v_no number;
    begin
    select sno into v_no from states where sname=v_state;
    dbms_output.put_line(v_no);
    end;
    /
    After excecuting this block no data found error takes place.
    Coz in where defective condition. "AP"="AP."

    What oracle function I should use to eliminate this error.

    I tried something like
    where trunc(sname)=trunc(v_state);
    But it defective. Please help me

    / * Don't know what is your exact question, but: * /.

    use the TOPPING instead of TRUNC

    Published by: hoek on November 26, 2011 10:00

  • The transition state errors

    Here is the error:

    ReferenceError: Error #1069: property cannot be found on mx.containers.Canvas and there is no default value.
    in mx.states::SetProperty/apply() [C:\dev\beta3\sdk\frameworks\mx\states\SetProperty.as:179]
    at mx.core::UIComponent/mx.core:UIComponent::applyState() [C:\dev\beta3\sdk\frameworks\mx\cor e\UIComponent.as:6432]
    at mx.core::UIComponent/mx.core:UIComponent::commitCurrentState() [C:\dev\beta3\sdk\framework s\mx\core\UIComponent.as:6272]
    at mx.core::UIComponent/setCurrentState() [C:\dev\beta3\sdk\frameworks\mx\core\UIComponent.as: 6208]
    to mx.core::UIComponent / set currentState() [C:\dev\beta3\sdk\frameworks\mx\core\UIComponent.as:3854]
    to UIPlay / __cat2_click () [C:\Documents and Settings\drk\My Documents\Flex Builder 2.0\UIPlay\UIPlay.mxml:219]

    Here is the passage:
    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" width = "100%" height = "100%" backgroundColor = "#FFFFFF" >
    < mx: states >
    < name mx: State = "ouverts1" >
    < mx:SetProperty target = "{cat1}" name = "width" value = "390" / >
    < mx:SetProperty target = "{cat1}" name = "height" value = "390" / >
    < mx:SetProperty target = "{cat1}" name = "left" value = "0" / >
    < mx:SetProperty target = "{cat1}" name = 'top' value = '0' / >
    < / mx: State >
    < / mx: states >
    < mx:Canvas id = 'mystage' width = "390" height = "390" horizontalCenter = "0" resizeEffect = "Resize" >
    < mx:Canvas id = "cat1" left = "30" top = "30" width = "150" height = "150" backgroundColor = click on "#999999" = "{currentState = 'open1' ;}" useHandCursor = "true" buttonMode = "true" / >} "
    < / mx:Canvas >
    < / mx:Application >

    I was getting right back in with States, something I've avoided since alpha because of bugs. In the full version of the application of this test, I have paintings that don't work very well with state changes of left, right, up, down, but in this case - no chance.

    Edit: It also appears that the effects of transition and SetStyleAction SetPropertyAction also do not apply to these properties.

    My name is Ashish not brand ;)

    CornerRadius support made of canvas and shadows. To get these styles work, you need to set the solid borderStyle property so he can show a rounded border. To view the drop shadow, you must set dropShadowEnabled to true.

    I just checked the documentation and I couldn't find the reference to the left, right... as properties etc. They are listed as styles.

    Here's the ActionScript reference Guide. You can access the Web search all of these styles.

    http://livedocs.Macromedia.com/labs/1/flex20beta3/langref/index.html

    In addition, you can go to the live docs and looking for one of these styles.

    Flex 2.0 LiveDocs

    There may be a few places that listed the wrong as you have seen. Please let me know the URL, so we can fix it.

    Now, the problem with SetStyleAction. I added the transition to your code example. When you set the left styles and superior, move effect is played, and when you set the width and height properties Resize effect would play. Keep in mind, these effects of the action are just triggers, you can use these effects of the action with the other effects to choreograph the transition.

    I also added dropShadow and cornerRadius styles.


    http://www.Adobe.com/2006/mxml"layout ="absolute"width ="800"height ="800"backgroundColor ="#FFFFFF">



















    Let me know if you have any questions.

    Thank you
    -Ashish

  • The SQL statement error - help nicely!

    Was scratchin my head, but cannot yet understand why it's a failure... Try to fill in the use of space for relevant tablespaces: get the below error. Kindly advice?


    9999999.999 free_space_mb column format
    column allocated_mb 9999999.999 format
    used_mb 9999999.999 column format
    column tablespace format a12
    filename format a20 column

    Select ts.name tablespace, file name trim (substr (df.name, 1 100));
    DF.bytes/1024/1024 allocated_mb,
    (((df.bytes/1024/1024) - nvl(sum(dfs.bytes)/1024/1024,0)) used_mb,.
    NVL(sum(DFS.bytes)/1024/1024,0) free_space_mb
    v $ datafile df left outer join dba_free_space dfs
    We df.file # = dfs.file_id join v$ tablespace ts
    We df.ts # = ts.ts #.
    We df.name # = ts.name #.
    and 'ts.name =' DATA_TS
    or 'ts.name =' INDEX_TS
    or 'ts.name =' LOB_TS
    Group of ts.name, df.name, dfs.file_id, df.file #, df.bytes
    order of file name;

    ERROR on line 8:
    ORA-00933: SQL not correctly completed command.

    Hello

    user568296 wrote:
    ...
    Select ts.name tablespace, file name trim (substr (df.name, 1 100));
    DF.bytes/1024/1024 allocated_mb,
    (((df.bytes/1024/1024) - nvl(sum(dfs.bytes)/1024/1024,0)) used_mb,.
    NVL(sum(DFS.bytes)/1024/1024,0) free_space_mb
    v $ datafile df left outer join dba_free_space dfs
    We df.file # = dfs.file_id join v$ tablespace ts
    We df.ts # = ts.ts #.
    We df.name # = ts.name #.
    and 'ts.name =' DATA_TS
    or 'ts.name =' INDEX_TS
    or 'ts.name =' LOB_TS
    Group of ts.name, df.name, dfs.file_id, df.file #, df.bytes
    order of file name;

    ERROR on line 8:
    ORA-00933: SQL not correctly completed command.

    There is a 2nd clause on line 8, WE join the same. 'AND' instead of 'ON', it would make sense to syntaic, but the names of files in v$ datafile are usually superstring of tablespace names in v$ ablespace. In other words, if ts.name (no # at the end) is "DATA_TS", then df.name could be ' D:\ORACLE\ORADATA\DEVELOPMENT\DATA_TS01. DBF'.
    I don't think that you need all of this condition. Try:

    select    ts.name                    tablespace,
           trim (substr (df.name, 1, 100))      filename,
           df.bytes/1024/1024                    allocated_mb,
           ( ( df.bytes / 1024 / 1024)
           - nvl ( sum (dfs.bytes) / 1024 / 1024
                  , 0
                 )
           )                         used_mb,
           nvl ( sum (dfs.bytes) / 1024 / 1024
               , 0
               )                         free_space_mb
    from                     v$datafile          df
    left outer join      dba_free_space          dfs     on     df.file#     = dfs.file_id
    join                   v$tablespace          ts     on     df.ts#          = ts.ts#
    --                                   AND     df.name          = ts.name     -- AND, not ON
                                       and     ts.name          IN ( 'DATA_TS'
                                                         , 'INDEX_TS'
                                                         , 'LOB_TS'
                                                         )
    group by  ts.name,
                 df.name,
           dfs.file_id,
           df.file#,
           df.bytes
    order by  filename;
    

    It's a bad idea to mix AND and gold at the same level in the same query. In this case, you can use the IN operator to avoid the need where. In other cases, use parentheses to isolate the ANDS of ORS.

  • Windows Mail for vista, will not e-mail delete after that it is proposed to delete the record States error due

    Cannot delete all emails when they are in the folder deletion

    Try to compact and repair the database with this tool.

    WMUtil
    http://www.oehelp.com/WMUtil/default.aspx

  • Decode in the insert statement

    Hi friends,

    I use an insert select with decode function as below... I get the error Ora-01722 invalid number

    insert into table (name, user...) tNom

    Select col1, col2,...,.

    Decode (tab2. COL4, 'AF','(susbstr (tab2. COL8, 1, 5). » -'|| substr (tab2. COL8, 6))', tab2. COL8) COL8,.

    ....

    of tname2 tab2

    The two tNom. COL8 and tab2.col8 are varchar fields...  Please let me know if something escapes me in the DECODE statement...

    Thank you very much

    >,'(susbstr (tab2

    You have single quotes around your substr function calls.

  • DECODE statement and the argument limits

    No one knows the number of arguments that the DECODE statement allows you to enter. I currently have 863 and it gives me an error message when I try to run the query.

    Database - ORA-00939 error: too many arguments for the function.

    Thank you
    Chris

    Hello

    You still have too many parameters your decodes, the limit is 250 so you can enter only 124 values and decoded. I would like to nest decodes by doing:

    DECODE (point, "c1", "v1", "c2", "v2", "c3", "v3",..., DECODE (point, 'c4', 'v4', 'c5', 'v5', 'c6', 'v6',..., DECODE (...)))

    Alternatively, you can for example use case

    WHEN BOX point IN ( END)

    Rod West

  • Calculation grouping using decode statement?

    I have 4 sales reps who are numbered 9801, 9802, 9803 VRP, 9804.

    I have 3 support staff that support accounts by virtue of these representatives of REPS 1, 2, 3

    Support rep 1 will support the commercial attaché 9801 & 9802
    Support rep 2 will support the commercial attaché 9802 and 9803
    Support rep 3 will support the commercial attaché 9803 & 9804.

    Initially, I had a report which gave the results for all listed sales reps. The representatives of support and then imported it into excel and delete the records of the sales reps that they do not need.

    I want to create a page filter that will support rep select its name in a drop-down which shows only sales reps they support. So support rep 1 can select their name from the drop down and the report would only show information for the commercial attaché 9801 & 9802.

    I tried to do this with a calculation using the decode statement, but it does not work. It seems only to associate support rep to each sales representative. Is there a way to accomplish the grouping I want?

    DECODE (put into commercial service Rep.Sales,
    9801,'REP ' 1,.
    9802,'REP ' 1,.
    9802, ' REP 2',
    9803, ' REP 2',
    9803, ' REP 3',
    9803, ' REP 4'.
    9804, ' REP 4'.
    "ERROR")

    Hello

    I don't think you can do it easily if you want to use a filter on the page. This is because if a row is returned by the database that has a sales of 9802, then, the line must be on 2 pages.

    You can create a parameter to select the support rep and use this setting to select the records. Therefore, if the parameter is p_support_rep then you have a condition like:

    (: p_support_rep = 'REP1' AND sales_rep IN (9801, 9802)) OR
    (: p_support_rep = "REP2' AND sales_rep IN (9802, 9803)) OR
    (: p_support_rep = "REP2' AND sales_rep IN (9803, 9804))

    If you really need to use a filter on the page, then you will need to use a generator of line to create a line for each support rep and to join your generator line report by using a report similar to the one above. You can search for "Generator line" of this forum, or check out the learndiscoverer blog (http://learndiscoverer.blogspot.com/2008/10/row-generators.html) for more details.

    Rod West

  • Problem with Decode statement

    Hello

    I try to do the following in my report:

    If an employee is a family name. (dot) or a name of. (dot), the report does not display a point. An employee name consists of the family name, first name and middle name, which should all be concatenated sets. An attempt to achieve this goal, I have the following statement in my report:

    Decode (e.Surname, '.', (LTRIM (RTRIM ((INITCAP (e.FIRST_NAME))) |))) » '|| INITCAP (e.MIDDLE_NAME))),
    e.FIRST_NAME, '.', (LTRIM (RTRIM ((INITCAP (e.Surname))) |)) » '|| INITCAP (e.MIDDLE_NAME))),
    (LTRIM (RTRIM ((INITCAP (e.SURNAME))) | ',' |)) INITCAP (e.first_name) | » '|| INITCAP (e.MIDDLE_NAME))) as emp_name

    E employee

    Problem: The above statement only works for employees with the name of. (dot). It doesn't for the first names of dot. How to use the decode statement OR is there another way to do it without using the CASE statement?

    It seems my decode statement does not work with 2 different fields (name, first name) tested within the decode statement. Thank you.

    LTRIM and RTRIM the comma too:

    select rtrim(ltrim(rtrim(ltrim(', Somename ,',','),','))) Name
    from dual;
    
    NAME
    --------
    Somename
    
  • Decode function in the Update statement

    Hi all

    I'm writing a query where I can update a pastdue_fees column in a table of book_trans based on a difference between the return_dte and due_dte columns.

    I use Oracle SQL. That's what I have so far for my decoding function:

    SQL > SELECT
    2 DECODE (SIGN ((return_dte-due_dte) * 2),)
    3 '-1 ', ' 0',
    4 '1', '12', 'Null')
    5 FROM book_trans;

    DECO
    ----
    Null value
    12
    Null value
    0

    If the logic is that, if the sign is - 1, the value in the return_dte column must be 0; If it is + 1, then it has 12 and everything else is Null.

    So now, I have to conclude my function of decoding of the update statement to update the columns. However, I get the error messages.

    The logic should be:
    UPDATE book_trans SET PastDue_fees = decode (expression)

    I gave him a few different tests with the following results:

    SQL > UPDATE book_trans
    2 SET pastdue_fees = SELECT
    3 DECODE (SIGN ((return_dte-due_dte) * 2),)
    4 '-1 ', ' 0',
    5 '1', '12', 'Null')
    6 FROM book_trans.
    SET pastdue_fees = SELECT
    *
    ERROR on line 2:
    ORA-00936: lack of expression


    SQL > UPDATE book_trans
    2 SET pastdue_fees =
    3 DECODE (SIGN ((return_dte-due_dte) * 2),)
    4 '-1 ', ' 0',
    5 '1', '12', 'Null')
    6 FROM book_trans.
    OF book_trans
    *
    ERROR on line 6:
    ORA-00933: SQL not correctly completed command.

    Any help or advice would be greatly appreciated I got SQL for about six weeks and not very competent!

    Thank you!

    882300 wrote:
    Hi all

    I'm writing a query where I can update a pastdue_fees column in a table of book_trans based on a difference between the return_dte and due_dte columns.

    I use Oracle SQL. That's what I have so far for my decoding function:

    SQL > SELECT
    2 DECODE (SIGN ((return_dte-due_dte) * 2),)
    3 '-1 ', ' 0',
    4 '1', '12', 'Null')
    5 FROM book_trans;

    DECO
    ----
    Null value
    12
    Null value
    0

    If the logic is that, if the sign is - 1, the value in the return_dte column must be 0; If it is + 1, then it has 12 and everything else is Null.

    So now, I have to conclude my function of decoding of the update statement to update the columns. However, I get the error messages.

    The logic should be:
    UPDATE book_trans SET PastDue_fees = decode (expression)

    I gave him a few different tests with the following results:

    SQL > UPDATE book_trans
    2 SET pastdue_fees = SELECT
    3 DECODE (SIGN ((return_dte-due_dte) * 2),)
    4 '-1 ', ' 0',
    5 '1', '12', 'Null')
    6 FROM book_trans.
    SET pastdue_fees = SELECT
    *
    ERROR on line 2:
    ORA-00936: lack of expression

    SQL > UPDATE book_trans
    2 SET pastdue_fees =
    3 DECODE (SIGN ((return_dte-due_dte) * 2),)
    4 '-1 ', ' 0',
    5 '1', '12', 'Null')
    6 FROM book_trans.
    OF book_trans
    *
    ERROR on line 6:
    ORA-00933: SQL not correctly completed command.

    Any help or advice would be greatly appreciated I got SQL for about six weeks and not very competent!

    Thank you!

    If you really really really want to update the entire table, the syntax would be...

    UPDATE book_trans
       SET
          pastdue_fees  = DECODE(SIGN((return_dte - due_dte)*2), -1, 0, 1, 12, Null);
    

    I took out all the single quotes. If you actually have a string column and store all numbers in there so it must be reported as a NUMBER column and not a column of type character (varchar2).

    ALWAYS use the appropriate data type, it will save you a ton of headaches in the future.

    Also, since you are new to the forum, please read the FAQ to learn etiquette and what not.

    http://wikis.Sun.com/display/Forums/Forums+FAQ

  • Satellite L30: Cannot watch DVDs - error between the decoder and the graphics card.

    I'm watching DVDs on my satellite L30, but also good Windows media player and the application of Toshiba, will not let me.
    He said that there is an error between the decoder and the graphics card.

    I checked and I'm set for region 2 and windows says I have the right drivers for the dvd and the graphics.

    Any help would be appreciated with gratitude

    Hello

    Try it please with the K-lite codec pack. Download and install it. Maybe it helps.

  • My browser is blocked for security reasons. Code error-QFR5000RT11C. My incoming connections in open State distance. Then I got the call from the United States 1 (866)986-3669, I picked up the phone, but they put the phone down. No matter what? Help, plea

    My browser is blocked for security reasons. Code error-QFR5000RT11C. My incoming connections in open State distance. Then I got the call from the United States 1 (866)986-3669, I picked up the phone, but they put the phone down. No matter what? Help, please.

    It's probably a SCAM.  Do not call these numbers.  Force Quit Safari and reopen it by holding down the SHIFT key.

    Ciao.

  • Error: "failure of the decoder or not installed' when try to play a DVD in Windows Media Center.

    Original title: Dell Inspiron 1501 with Windows XP Media Edition drive d / error/defect of the decoder.

    After download of Internet Explorer 8 I now get a decoder error when you insert a DVD and Media Center. The message says 'malfunction of the decoder or not installed' and suggests to restart the computer and Media Center. This does not solve the problem. The drive is identified as Philips SDVD8820. What can I do to fix this?

    Hi Don,

    You can download and run the Microsoft Windows XP Video Decoder Checkup Utility . This utility will help you determine if an MPEG-2 video decoder, or a DVD decoder is installed on your system and if the decoder is compatible with Windows Media Player 10 and Windows XP Media Center Edition 2005.

    Hope the helps of information.

Maybe you are looking for