Case string returned from the function

Is it possible to run cases return the string somehow?

For example:


BOX WHEN 1.2.2011 > CURRENT_DATE THEN any OTHER 'OFF' END 'ON '.


.. If I do like above, I get the error message: ORA-00932

-case when date'' 2011-02-01 > timestampadd(sql_tsi_day,0,current_date) then 'works' end 'off' else

the above worked for me

M.

Tags: Business Intelligence

Similar Questions

  • The value returned by the function to load is not of type digital errors after migration to Coldfusion 11

    I'm currently testing our website with CF11. He is currently working with CF8 however after the migration to a new server running CF11 I met the following error.

    The value returned by the function of load is not numeric.

    The error occurred in

    D:/applications/CFusion/CustomTags/NEC/COM/objects/address.cfc: line 263
    Called from D:/apps/CFusion/CustomTags/NEC/com/objects/contact. CFC: line 331

    Called from D:/applications/CFusion/CustomTags/NEC/COM/objects/user.cfc: line 510

    Called from D:/applications/CFusion/CustomTags/NEC/COM/objects/user.cfc: line 1675

    Called from D:/website/NECPhase2/action. Validate.cfm: line 54

    261: < cfif isNumeric (get.idCountry) >

    262: < cfset rc = this.objCountry.setID (get.idCountry) >

    263: < cfset rc = this.objCountry.load () >

    264: < / cfif >

    265: < cfset this.sPostcode = get.sPostcode >

    Were there any changes between CF8 and CF11 which can cause this error?

    Does anyone have any ideas?

    The problem is in the charge function.  There is a real return at the end of the function.  The returntype of the function is set to digital.  True is not digital, it will trigger an error.

  • catch the collection returned by the function in a SQL statement

    I have a select like query: (I need all the values returned by the function in the select list)

    Select t1.col1, t2.col2, (by selecting t.a, t.b., t.c in fn (t2.col3) t)
    Of
    T1, t2
    where t1.col1 = t2.col2;



    My function is like:

    FN (T2.col3) returns an array in format of the object



    Here, I was able to select only one value from the table returned by the funcation both. If I select all of the values as above, she gave too much error vales.
    Please someone help me in this

    user13044793 wrote:
    I have a select like query: (I need all the values returned by the function in the select list)

    Select t1.col1, t2.col2, (by selecting t.a, t.b., t.c in fn (t2.col3) t)
    Of
    T1, t2
    where t1.col1 = t2.col2;

    No specific reason for this? It adds additional complexity to the projection of SQL, and there are additional costs of failover for the motor of PL/SQL (per line) of context. Overall - not your typical approach and one that should have sound justification.

    With regard to the basic method - the SQL multiset() function should be used to create a collection. Here is an example of the approach:

    SQL> create or replace type TFoo as object(
      2          id      number,
      3          bar     varchar2(5)
      4  );
      5  /
    
    Type created.
    
    SQL>
    SQL> create or replace type TFooSet as table of TFoo;
      2  /
    
    Type created.
    
    SQL>
    SQL> create or replace function GetSomeFoo( n number ) return TFooSet is
      2          foo     TFooSet;
      3  begin
      4          foo := new TFooSet();
      5          foo.Extend( 5 );
      6
      7          for i in 1..5
      8          loop
      9                  foo(i) := new TFoo( n+i-1, to_char(i-1,'0000') );
     10          end loop;
     11
     12          return( foo );
     13  end;
     14  /
    
    Function created.
    
    SQL>
    SQL> select
      2          object_id,
      3          object_name,
      4          cast(
      5                  multiset( select * from table(GetSomeFoo(object_id)) ) as TFooSet
      6          )       as FOO
      7  from       all_objects
      8  where      owner = 'SYS'
      9  and        rownum <= 5;
    
     OBJECT_ID OBJECT_NAME                    FOO(ID, BAR)
    ---------- ------------------------------ --------------------------------------------------
         27538 /1000e8d1_LinkedHashMapValueIt TFOOSET(TFOO(27538, ' 0000'), TFOO(27539, ' 0001')
                                              , TFOO(27540, ' 0002'), TFOO(27541, ' 0003'), TFOO
                                              (27542, ' 0004'))
    
         28544 /1005bd30_LnkdConstant         TFOOSET(TFOO(28544, ' 0000'), TFOO(28545, ' 0001')
                                              , TFOO(28546, ' 0002'), TFOO(28547, ' 0003'), TFOO
                                              (28548, ' 0004'))
    
         11718 /10076b23_OraCustomDatumClosur TFOOSET(TFOO(11718, ' 0000'), TFOO(11719, ' 0001')
                                              , TFOO(11720, ' 0002'), TFOO(11721, ' 0003'), TFOO
                                              (11722, ' 0004'))
    
         30094 /100c1606_StandardMidiFileRead TFOOSET(TFOO(30094, ' 0000'), TFOO(30095, ' 0001')
                                              , TFOO(30096, ' 0002'), TFOO(30097, ' 0003'), TFOO
                                              (30098, ' 0004'))
    
        684122 /1023e902_OraCharsetUTFE       TFOOSET(TFOO(684122, ' 0000'), TFOO(684123, ' 0001
                                              '), TFOO(684124, ' 0002'), TFOO(684125, ' 0003'),
                                              TFOO(684126, ' 0004'))
    
    SQL>
    SQL> with dataset as(
      2          select
      3                  object_id,
      4                  object_name,
      5                  cast(
      6                          multiset( select * from table(GetSomeFoo(object_id)) ) as TFooSet
      7                  )                as FOO
      8          from    all_objects
      9          where   owner = 'SYS'
     10          and     rownum <= 5
     11  )
     12  select
     13          d.object_id,
     14          d.object_name,
     15          f.id,
     16          f.bar
     17  from   dataset d,
     18          table(d.foo) f
     19  /
    
     OBJECT_ID OBJECT_NAME                            ID BAR
    ---------- ------------------------------ ---------- ---------------
           217 DUAL                                  217  0000
           217 DUAL                                  218  0001
           217 DUAL                                  219  0002
           217 DUAL                                  220  0003
           217 DUAL                                  221  0004
           268 SYSTEM_PRIVILEGE_MAP                  268  0000
           268 SYSTEM_PRIVILEGE_MAP                  269  0001
           268 SYSTEM_PRIVILEGE_MAP                  270  0002
           268 SYSTEM_PRIVILEGE_MAP                  271  0003
           268 SYSTEM_PRIVILEGE_MAP                  272  0004
           271 TABLE_PRIVILEGE_MAP                   271  0000
           271 TABLE_PRIVILEGE_MAP                   272  0001
           271 TABLE_PRIVILEGE_MAP                   273  0002
           271 TABLE_PRIVILEGE_MAP                   274  0003
           271 TABLE_PRIVILEGE_MAP                   275  0004
           274 STMT_AUDIT_OPTION_MAP                 274  0000
           274 STMT_AUDIT_OPTION_MAP                 275  0001
           274 STMT_AUDIT_OPTION_MAP                 276  0002
           274 STMT_AUDIT_OPTION_MAP                 277  0003
           274 STMT_AUDIT_OPTION_MAP                 278  0004
           815 RE$NV_LIST                            815  0000
           815 RE$NV_LIST                            816  0001
           815 RE$NV_LIST                            817  0002
           815 RE$NV_LIST                            818  0003
           815 RE$NV_LIST                            819  0004
    
    25 rows selected.
    
    SQL>
    
  • When I return from the page of google search for a link then button does not return return

    When I return from the page of google search for a link, then button does not return back. Instead, the same page refills. I need to go back click back button twice or even more. How to fix? I cheked it it another browser and there is no such behavior. It seems completele Firefox problem.

    the problem was resolved after remooving extenshion «user agent overrider»

  • c:\windows\system32\osk.exe, a referral was returned from the server

    My scren keyboard on does not: error when I try to use:c:\windows\system32\osk.exe, a referral was returned from the server

    Hi Kevin Urubek,

    1. what operating system do you use?
    2 is connected to the domain of the computer?

    Method 1
    If the steps above fail, I suggest to create a new user account and see if you get the same error message, the following link will allow to create new user account.

    Create a user account
    http://Windows.Microsoft.com/en-us/Windows7/create-a-user-account

    If everything works well in the new user account, then I suggest you to follow the article to transfer files and settings to the new user account.
    Difficulty of a corrupted user profile
    http://Windows.Microsoft.com/en-us/Windows7/fix-a-corrupted-user-profile

    Method 2

    If you're windows7, try the steps from the following link:
    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
    http://support.Microsoft.com/kb/929833

  • A fatal error occurred when attempting to access the SSL server credential private key. The error code returned from the cryptographic module is 0x8009030D. The internal error state is 10001.

    Hello

    I just bought an HP computer, Windows 8 Pro, x64bit. I worked OK for a week and then started to freeze. It freezes all the time. I'll send the error message in the event log. I'd appreciate your help because I've had enough of this gel and I turn it works all the time.

    Log name: System
    Source: Schannel
    Date: 12/07/2013-12:55:12
    Event ID: 36870
    Task category: no
    Level: error
    Keywords:
    User: SYSTEM
    Computer: Aleksey
    Description:
    A fatal error occurred when attempting to access the SSL server credential private key. The error code returned from the cryptographic module is 0x8009030D. The internal error state is 10001.
    The event XML:
    http://schemas.Microsoft.com/win/2004/08/events/event">
     
       
        36870
        0
        2
        0
        0
        0 x 8000000000000000
       
        7179
       
       
        System
        Aleksey
       
     

     
        Server
        0x8009030d
        10001
     

    Thank you

    Hi Aleksey,

    I appreciate the efforts that you put to publish the query on this forum.

    Please help me with the following information about this issue:

    (1) is the computer that is connected to a domain network?

    (2) when exactly you receive the error message? It is by accessing any application?

    If the computer is connected to a domain network, I suggest you send the request on 8 Windows IT Pro. Check out the link:

    http://social.technet.Microsoft.com/forums/Windows/en-us/home?category=w8itpro

    Please let us know if the computer is not in a domain. We will be happy to help you come.

  • Structure from case string "&lt;------"-LabVIEW converts the string

    Hello

    I want to parse the string lines read from a data file.  Some chains start with the characters ".<\".  when="" i="" enter="" this="" kind="" of="" string="" as="" a="" case="" in="" a="" case="" structure="" the="" string="" is="" being="">

    For example, I'm going home. "<\C" (upper-case="" c)="" as="" my="" case="" string,="" it="" changes="" to=""><\f".  if="" i="" enter=""><\c" (lower-case="" c)="" as="" the="" string="" it="" becomes="">

    I am currently using LabVIEW 2012.

    Any ideas what's happening?

    Thank you

    Ian

    Some ASCII characters are nonprinting control characters (less than 32 values). These are sometimes encoded using the backslash code and it seems that is what makes the structure of matter - when you type \C, the structure of the performer as "oh, you want the value 0x0C ASCII, which in the code for backslash is represented" as \f (means 'form feed). "When this is the case, you typically use one-to represent the------characters, so you really need set the structure to match on.<>

  • A varray of returning from a function

    Hello

    I would like to return a set of values of a function as:
    select my_function(6) from dual
    should return multiple values:
    1 2 3 4 5 7 8 9

    right now, my function works only by returning a value from the array:
    create or replace
    FUNCTION sls_forf(
          depassement IN number,position in integer)
        RETURN number
      IS
        type res is varray(9) of number;
        sls res:=res();
        depa number;
      BEGIN
        depa:=depassement*100;
        sls.extend(9);
        CASE
        WHEN depa<60 THEN
          sls(1):=0.13+0.03*(depa-20);
          sls(2):=0.13+0.06*(depa-20);
          sls(3):=0.13+0.075*(depa-20);
          sls(4):=0.27+0.03*(depa-20);
          sls(5):=0.27+0.06*(depa-20);
          sls(6):=0.27+0.075*(depa-20);
          sls(7):=0.34+0.03*(depa-20);
          sls(8):=0.34+0.06*(depa-20);
          sls(9):=0.34+0.075*(depa-20);
        when depa between 60 and 149 then
          sls(5):=2.69+0.08*(depa-60);
        when depa>=150 then
          sls(5):=9.91+0.1*(depa-150);
        END CASE;
        
        RETURN sls(position);
        END sls_forf;
    It is possible.
    Ideally, it would be cool to be able to take the function itself in the form of table as my_funtion() gives me the o set while values than my_function (3) don't give me the 3rd value...

    Something like that?

    SQL> select rtrim(
      2           extract(
      3             xmlagg(xmlelement("a",level||'='||nvl(to_char(sls_forf(0.7,level)),'null')||', '))
      4             ,'//text()'),' ,') myvalues
      5  from dual
      6  connect by level <=9;
    
    MYVALUES
    ----------------------------------------------------------------------------------------------------
    1=null, 2=null, 3=null, 4=null, 5=3.49, 6=null, 7=null, 8=null, 9=null
    

    Max
    http://oracleitalia.WordPress.com

  • How to read the table of string returned by the DLL

    I developed DLLS in labview that takes 2 input parameters as a string and returns an array of strings in return. How can I read back this array returned strings in labview? I tried to return a string and I can't able to read. But how to read a table?

    Is the signature of the function – void GetLoginInfo (char [] DBPath, char [UserName], LStrHandleArray * table)

    Shrinivas

    I found the solution. When you configure the node to call a library function, the argument (in which we expect an array of string) type should be chosen as "Adapt to the Type" and data format to be "pointers to the sleeves.

  • How can I get multiple results returned from a function

    IDBASKET IDSTAGE DTSTAGE
    ---------- ---------- ---------
    3 1 24 JANUARY 03
    3 5 25 JANUARY 03
    4 1 13 FEBRUARY 03
    4 5 13 FEBRUARY 03
    5 3 21 FEBRUARY 03


    I have entry is a unique number of the IDBASKET in this table and this feature works very well that if she has an IDSTAGE by idbasket. (idbasket #5)
    But how do I return a result for an IDBASKET when there several IDSTAGE? (idbasket #3 & 4)
    Thank you very much
    CARPET


    SQL > CREATE or REPLACE FUNCTION status_desc_sf
    2 (NUMBER Code_P)
    3 RETURN VARCHAR2
    4 EAST
    5 lv_output_txt VARCHAR2 (30);
    6 BEGIN
    7. If Code_P = 1 THEN lv_output_txt: = "Command" submitted
    8 ELSIF Code_P = 2 THEN lv_output_txt: = "Accepted, sent to the navigation";
    9 ELSIF Code_P = 3 THEN lv_output_txt: = 'out of stock ';
    10 ELSIF Code_P = 4 THEN lv_output_txt: = "Cancelled";
    11 ELSIF Code_P = 5 THEN lv_output_txt: = "shipped";
    12 lv_output_txt ELSE: not = 'no information ';
    13 END IF;
    14 lv_output_txt of RETURN;
    15 END;
    16.

    I think that your function works as expected, not necessary as you like it is running.
    See the example:

    SQL> create table t11(c1 int, c2 int)
      2  /
    
    Table created.
    
    SQL> insert into t11(c1,c2) values(1,1);
    
    1 row created.
    
    SQL> insert into t11(c1,c2) values(1,2);
    
    1 row created.
    
    SQL> insert into t11(c1,c2) values(2,2);
    
    1 row created.
    
    SQL> create or replace function func2(p_code number)
      2  return varchar2
      3  is
      4  v_output varchar2(64);
      5  begin
      6  if p_code = 1 then
      7     v_output := 'Submitted';
      8  elsif p_code = 2 then
      9     v_output := 'Accepted';
     10  end if;
     11  return v_output;
     12  end func2;
     13  /
    
    Function created.
    
    SQL> /
    
            C1 test
    ---------- ------------------------------
             1 Submitted
             1 Accepted
             2 Accepted
    

    If you have run the function in a manner similar to mine, it will work for all ranks. Your design of the table shows that keep you track of each State of your order, so you have more than one State of each basket. If you want to view only the last State of each basket, please take a look at this example:

    SQL> alter table t11 add c3 date
      2  /
    
    Table altered.
    
    SQL> update t11 set c3 = sysdate - 1 where c1 = 1 and c2 = 1
      2  /
    
    1 row updated.
    
    SQL> update t11 set c3 = sysdate  where c1 = 1 and c2 = 2
      2  /
    
    1 row updated.
    
    SQL> update t11 set c3 = sysdate  where c1 = 2
      2  /
    
    1 row updated.
    
    SQL> select * from t11
      2  /
    
            C1         C2 C3
    ---------- ---------- ---------
             1          1 15-JUN-09
             1          2 16-JUN-09
             2          2 16-JUN-09
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select t11.c1, func2(t11.c2) "test"
      2  from t11, (select c1, max(c3) c3 from t11 group by c1) a
      3* where t11.c1 = a.c1 and t11.c3 = a.c3
    SQL> /
    
            C1 test
    ---------- ------------------------------
             1 Accepted
             2 Accepted
    

    With greetings
    Krystian Zieja

  • Value returned by the function

    SQL * more: Release 10.2.0.1.0 - Production on Sun 17 may at 11:41:10 2009

    Copyright (c) 1982, 2005, Oracle. All rights reserved.


    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64 bit Production
    With partitioning, OLAP and Data Mining options

    SQL > create table testdata
    () 2
    facid number 3.
    4 data varchar2 (10));

    Table created.

    SQL > insert into testdata (facid, data) values ('10 ', 'Data');

    1 line of creation.

    SQL > insert into testdata (facid, data) values ('20', 'Qdata');

    1 line of creation.

    SQL > select * from testdata;

    FACID DATA
    ---------- ----------
    10 data
    20 Qdata


    SQL > create or replace function testdata_fn (v_facid number)
    2 back tank
    3 is
    4
    number of tempid 5;
    6
    7. start
    8
    9. Select facid in tempid testdata where facid = v_facid;
    10
    11. IF tempid is null then
    12 DBMS_OUTPUT. PUT_LINE ('TEMPID' | tempid);
    13 back 'n';
    14 on the other
    15 return "Y";
    16 end if;
    17
    18 end testdata_fn;
    19.

    The function is created.



    SQL > select distinct testdata_fn (10) of testdata.

    TESTDATA_FN (10)
    --------------------------------------------------------------------------------
    THERE

    SQL > SELECT distinct testdata_fn (38) FROM testdata;

    TESTDATA_FN (38)
    --------------------------------------------------------------------------------


    SQL >


    I was expecting a "n" If there is no corresponding data.

    Is this possible in a single query? I will join this query for an existing query.

    Please give your comments.

    you need an exception for this handler:

     ....
     exception when no_data_found then
      return 'N'
     end testdata_fn;
    
  • OpenScript / database: String obtained from the data bank cannot be used for parameters

    Hello

    I add a jar to java code OpenScript file. Since the need to enter the settings of the front console run the jar file, I think that it can read the settings from the database and then run it as "java-jar filename.jar para1, para2 para3", 2 3 para1 is synonymous with three parameters obtained from the database "

    I get the value of the database as follows:
    String para1 = "{{db.caseName.para1}}";
    String para2 = "{{db.caseName.para2}}";
    String para3 = "{{db.caseName.para3}}";

    However, it does not work and it looks that this string has the database cannot used as settings in 'java-jar filename.jar para1, para2 para3.
    I'm trying to assign the value directly as: String para1 = 'PARA1 '; String para2 = "PARA2; String = 'PARA3; then can run 'java-jar filename.jar para1, para2 para3' and this can work.

    So, how can I use parameters got in 'java-jar filename.jar para1, para2 para3' database successfully?
    Thank you very much ^ _ ^!

    Kind regards
    Angyoung

    Hello

    You can use eval() for this. That is to say. Use the following method

    String para1 = eval ("{{db.caseName.para1}}");
    String para2 = eval ("{{db.caseName.para2}}");
    String para3 = eval ("{{db.caseName.para3}}");

    then run "java-jar filename.jar para1, para2 para3.

    Kind regards
    Dembélé M

  • How to use refcursor type returned from the remote database in the local database

    Can anyone say is how they use the refcursor use type returned from remote database in the local database using dblinks.

    See MOS ID 750126.1 doc ORA-24338 when trying to return a Refcursor over a database link.

  • MY iphone6 will not return from the icloud, HELP?

    I had to replace my phone.  The new phone will not render from the icloud.  I tried several times and I even took it in the Apple store without success.

    Weezy616 wrote:

    I had to replace my phone.  The new phone will not render from the icloud.  I tried several times and I even took it in the Apple store without success.

    Thanks a lot for sharing that you cannot restore icloud.

    Maybe include some details as to what happens when your restore IE. error message?

    Or that said Apple store has been without success...

  • Delete the CRLF / CR in a string - (obtained from the string of Excel)

    Hey

    I have an Excel sheet where I save some information for the Script.

    in the past, I had information each field - so it wasn't the problem to geht of information by

    MyString = myProjekt.Cells(DataRow,1). Value

    For more options, put my script, I decided to separate the information in a field by unsing ';' an entry in a new line (same domain)

    is the chain I get in Diadem

    "Info1; Info2; Info3.

    but after each; must be a CRLF CR oder oder another functional character.

    I will separate my information using the

    X = Split (MyString, ";",-1, vbTextCompare in)

    the "trim" command remove the space, but not the functional

    --> (1) X = "Info1.

    --> X (2) = "Info2".

    --> X (3) = "Info3.

    Info2 and 3, there are functional character, that I'm not out of it.

    Someone at - it an idea how to solve my problem?

    Thank you! Have a nice weekend

    Hi Malik.

    The VBScript function you're looking for is Replace(), and you get + "\n" vbCR vbLF or or all simply "". ""  You can also call the function multiple times if you have several ASCII chararacters you want to remove, such as:

    MyStr = Replace (MyStr, vbCRLF, "")

    MyStr = Replace (MyStr, "", "")

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

Maybe you are looking for