DECODE SQL Function - Parsing error in Defining Objects in Universe Designe

Hi,
I have created a class and an object in BO XI R3 Universe designer.
I am getting the parsing error while defining the object when using the custom SQL as
select decode(matteraction,null,decode(matterissue,null,'MATTER','ISSUE'),decode(matterissue,null,'TYPE IS ACTION',' ACTIONu2019)) as TYPE from wh_cf_cmsu
The object Type is "character", i have tried with Long Text, Number, Date as well and the same sql works fine by returning String values through TOAD.
Do we have any constrains in using DECODE in BO XI R3 or any other syntax please....
Please guide me in resolving this issue.
Thanks,
Karthik.

Hi,
1.At back end check the data type for matteraction column and define it accordingly in object definition.
2. Try to break your select clause definition into smaller parts and check it where the exact issue is  as below
i.select decode(matterissue,null,'TYPE IS ACTION',' ACTIONu2019) ............
ii.select decode(matteraction,null,decode(matterissue,null,'MATTER','ISSUE') ..........
iii.select decode(matteraction,null,decode(matterissue,null,'MATTER','ISSUE'),decode(matterissue,null,'TYPE IS ACTION',' ACTIONu2019)) as TYPE from wh_cf_cmsu

Similar Messages

  • Sql function sequence error

    i have a programm ... every time i try to add somthing to it ; wiil bring an error message telling me that there is an (sql function sequence error) ....
    for example i have somthing like
    if(i<beginYear){
    principal[i] = amount/installment;//somthing like that
    //other statments
    here i tried to change it like
    if(i<beginYear + 1)
    and the error came .....
    have you any idea..!!!

    actually iam using a microsoft access table but what is sstrange is that the error comes after the data base has been closed , so i didnt see any connection between the sql and what is going on..... i wander what usually ment by sql funftion sequence error...

  • New object at universe designer

    Hello Gurus,
    1.Can we Create a new Object at Universe designer on top SAP BW.

    Hi ,
    Here is the MDX syntax for creating  a calculated mesure object in the universe.
    <EXPRESSION>@Select(Key Figures\Order Amount)*@Select(Key
    Figures\Order Quantity)</EXPRESSION>
    Go through the below link to know how to customize olap universe(from page#427)
    http://help.sap.com/businessobject/product_guides/boexir31SP3/en/xi31_sp3_designer_en.pdf
    Thanks,
    Pramod

  • Error when using defined object in Universe in Web Intelligence

    Hi all
    I create universe connect from Infocube
    I create a new Object named "Sale Value" to get YTD of Object name "SS Total value of the invoice lin" with code following
    <EXPRESSION>SUM(YTD(@Select(Key Figures\SS Total value of the invoice line)))</EXPRESSION>
    I parse to check systax "OK".
    But when I run query and using above defined object in Web Intelligence, I get error following
    <<
    Query 1 - ZTHP_TEST001
    A database error occured. The database error text is: The MDX query WITH MEMBER [Measures].[384E7D57-FBC9-45A4-BD,4B,1D,D2,D4,41,47,7E] AS ' SUM([Measures].[ZSGROSS_L]) '  SELECT  { [Measures].[ZSVOLUME], [Measures].[384E7D57-FBC9-45A4-BD,4B,1D,D2,D4,41,47,7E] }  ON COLUMNS , NON EMPTY { Descendants( [ZPRODUCT                      ZPRODUCT_HIER].[LEVEL00].MEMBERS, [ZPRODUCT                      ZPRODUCT_HIER].[LEVEL09], LEAVES) }  DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM [$ZIB_02]  failed to execute with the error Invalid MDX command with ). (WIS 10901)
    >>
    I check MDX PARSER connection in SM59 sucessfull
    I am beginer of Universe and Web Intelligence, please help me solve this problem.
    Thanks

    Hi,
    The MDX parser in the universe designer just check the XML Tags or Syntax. It does not validate the expression.
    The YTD, QTD, MTD functions in the universe designer requires a reference to a predefined time chararcteristics eg. 0CALMONTH etc. So the correct expression would be similar to the below expression:
    <EXPRESSION> SUM(YTD([0CALMONTH].CurrentMember), @Select(Key Figures\SS Total value of the invoice line))</EXPRESSION>
    Also you need to add the time characteristics in the result set.
    Regards,
    Rohit

  • PL/SQL Function call error while reading or assigning returned value

    Hi,
    I am getting the following error while tryih to read the value of the PL/SQL Function. I am calling a function in one of my PL/SQL Packages passing mutliple IN parametes and the function returns some value back. Now on BPEL side when I try to read the return value I am getting an error:
    *<summary>*
    empty variable/expression result.
    xpath variable/expression expression "/ns3:OutputParameters/ns3:TEST_FUNCTION" is empty at line 124, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns3:OutputParameters/ns3:TEST_FUNCTION" is not empty.
    *</summary>*
    Even though in the console when I check the Invoke Output Parameter it does shows me a valid value being retuned by a Function but when I am trying to Assgn this value to some variable using Assign Activity I get the above error.
    Even though all goes fine but looks like I am not able to read or assign the value returned from the Function.
    So just wondering if this even works as to me I have a very simple example and that seems not to work. Function is called successfully and is returning the value as I can see it in the BPEL console but when tryin to read or assign that value to some other variable I get the above error.
    Any ideas?
    Thanks

    This issue has come up a lot. The problem is with a mismatch between the version of JDeveloper and SOA. You'll encounter namespace issues if you use 10.1.3.1 in combination with 10.1.3.3 (or 10.1.3.4). You MUST synchronize both JDev and SOA to 10.1.3.3 or 10.1.3.4 (mixing 10.1.3.3 and 10.1.3.4 is OK). We changed when going to 10.1.3.3 by adding elementFormDefault="qualified" to the generated XSD. We used the default "unqualified" in 10.1.3.1. So you'll encounter namespace issues unless you're using 10.1.3.3 or higher JDev AND SOA. The fact that I see &lt;*db:*...&gt; tells me that you're using 10.1.3.1 JDeveloper. The correct solution is to upgrade your components.

  • Are Sql functions different from user defined functions ?

    Hello,
    SQL functions are built into Oracle Database and are available for use in various appropriate SQL statements. Do not >confuse SQL functions with user-defined functions written in PL/SQL.according to first paragraph of this document Sql functions are different from user defined functions . How is that ?
    Is they really differ from each other ?

    bootstrap wrote:
    If you don't know what compilation is, please use Wikipedia or other online resources.I know what is compilation . But i was confused whether those sql functions are compiled in my machine when i install Oracle Database in my machine or they are pre-compiled .
    As you said these Sql functions are pre-compiled , it is clear now that they are pre-compiled platform dependent code .
    Can you provide actual source code of any SQL function , say SUM function .
    I want to see it, how they have defined . Eagerly waiting for any reply. please help .
    Edited by: bootstrap on Aug 19, 2011 11:50 AMYou can ask oracle if they give you their code. I doubt they will. However if you want to write you own user-defined aggregation function, there are examples in the documentation how to do that.
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17125/adfns_packages.htm#i1008575
    Edited by: Sven W. on Aug 19, 2011 9:24 AM

  • CurrentDate as object in Universe Design

    Create object with Getdate() function in universe Design. I had tried, but no result.
    I find two sites,
    http://forumtopics.org/busobj/viewtopic.php?t=91514&sid=382f382c24ed3c4b29362a4d87747fdf
    http://forumtopics.org/busobj/viewtopic.php?p=284562&sid=7ebc50041d51f5e65d58f17d3d71a8ed
    for this but no use.
    Can any one please help me to solve this problem in universe.
    Thanks & Regards,
    Madhu...

    wrote:
    >
    > Thanks for quick reply, I am using SQL Server2008, and BO XI 3.1.
    > But this answer is not solved my problem and showing the error in
    > Universe is: The Query does not reference a table.
    >
    Don't worry for that message. It is normal.
    You can use getdate().
    Now, for WebI, I guess you want to use it with any other table don't you? You can add this CurrentDate object in any query you want instead of using it in an empty query.
    If you don't like this approach then use WebI's CurrentDate function.
    =CurrentDate()
    Edited by: PadawanGirl on Jun 23, 2011 6:48 PM

  • "noexec on" function parse errors, any alternatives?

    Hi there,
    I'm strugling with the noxec option which still produces sql compile errors (not a simple syntax error).
    Situation:
    We use a custom delta script pattern which stops the execution on certain conditions by setting
    noexec.
    This is working fine so far but the problem starts when an old delta script is about to run.
    We can still set noexec but functions which do not match in their parameter count (which is unavoidable) produce this error message:
    An insufficient number of arguments were supplied for the procedure or function ...
    This is pretty painful, because it's still valid syntax. We wouldn't care about the error, but the whole SQL Publish process is aborted by this kind of error.
    Question:
    Is there an alternative for that (besides wrapping everything in dynamic SQL)?
    Maybe there's some kind of SQL Publish like "Ignore all 313 errors" which I could not find?
    Regards and thanks in advance!
    Knickedi

    Thank you for your responses!
    SQL Publish
    SQL Publish is used by WebDeploy (which seems to be build on top of MSDeploy). (It's quite confusing and maybe I'm getting things wrong, so bare with me). In short: You can Publish a Web-Project in Visual Studio with WebPublish (server must support it) and
    you have the option to list SQL files which will be executed against your Database (we have a staging application for testing we publish against before we publish against our productive application).
    Example
    Here's some stripped down example of our delta script:
    We check for the version and if its already present we avoid executing it (noexec off at the end). So in this example I get the wrong parameter count message, because the function has changed in the next versions.
    declare @retVal int;
    execute @retVal = SpDeltaCheck('v1.2')
    if @retVal <> 0
    begin
    set noexec on;
    end
    go
    CREATE VIEW [Test]
    AS
    SELECT dbo.FnWithWrongParamCount(t.Id) as TestValue,
    FROM Test t
    set noexec off;
    go
    parseonly seems to be what we're looking for but you can't execute it conditionally in an if-block. It will be set as soon it is parsed.
    Further consideration
    Of course we could remove the old scripts after every successful publish but then we start adding further traps and complexity for the publisher. Because every developer will add scripts and that's not just one per version but one per git push (if s/he has
    database changes). The idea was to list them all and don't care about which was already executed.

  • PL/SQL XML Parser Error

    Hello,
    I just set up the PL/SQL parser and created a procedure and am getting the following error. I am a new developer so any help would be greatly appreachiated. Thanks
    ERROR at line 1:
    ORA-29541: class XML_WORK.oracle/xml/parser/plsql/XMLParserCover could not be resolved
    ORA-06512: at "XML_WORK.XMLPARSERCOVER", line 0
    ORA-06512: at "XML_WORK.XMLPARSER", line 57
    ORA-06512: at line 14

    Steve,
    I did as you said and now get the following errors:
    ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.net.SocketPermission business.buffalo.edu resolve) has not been granted by dbms_java.grant_permission to SchemaProtectionDomain(XML_WORK|PolicyTableProxy(XML_WORK))
    ORA-06512: at "XML_WORK.XMLPARSERCOVER", line 0
    ORA-06512: at "XML_WORK.XMLPARSER", line 46
    ORA-06512: at "XML_WORK.XML_PARSE_TEST", line 19
    ORA-06512: at line 2
    I created the allow_url_access procedure and the result of the test query appear fine. The url I am using is: http://business.buffalo.edu/hrs/AlfCMTestXML.xml and the results of the test query is as follows. Thanks.
    ALLOWED_SERVER_NAME
    *.buffalo.edu
    *.business.buffalo.edu

  • Row_number() -SQL function throws error - SAP B1 2005 B - PL 36

    hi experts,
    when i try 2 run "SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY CardName) AS RowNo,CardCode,CardName FROM OCRD Where CARDTYPE='C') AS OCRD"
    query in SAP B1 2005 B, PL-36 it shows an error -server throw an exception.
    anybody can comment on it
    thanks in advance
    jithesh nambiar

    Hi,
    Problem might be with your query. Server exception error may occur while accessing large number data retrieving from the data base. It is execution type of error. What do you expect/want from your sql query?
    try this query
    SELECT ROW_NUMBER() OVER (ORDER BY CardName) AS RowNo,CardCode,CardName FROM OCRD Where CARDTYPE='C'
    Senthil Maruthappan.

  • SQL report region source to call a pl/sql function using DB link

    Hi - I have a pl/sql function fn_dbtype(id NUMBER) defined in database X. The pl/sql function executes couple DML statements and returns a string (a SELECT query). I am able to call this function using SQL Plus (Connected to Database X) as below and it works fine:
    declare
    vSQL VARCHAR2(100);
    begin
    vSQL := fn_dbtype(1);
    end;
    The DML operations completed fine and vSQL contains the "Select" query now.
    In APEX:
    I am trying to create a SQL report in APEX using SQL query(PL/SQL function returning a sql statement) option. I am trying to figure out what to put in the region source so that the output of the "Select" query is displayed in the report.
    Moreover APEX is hosted in a different database instance. So I would need to call this pl/sql function using a DB Link.
    Please let me know what I need to put in the region source to execute the pl/sql function which returns the "Select" query thereby displaying the query output in the report. Thanks.
    Edited by: user709584 on Mar 19, 2009 2:32 PM
    Edited by: user709584 on Mar 19, 2009 2:34 PM

    try something like this:
    return fn_dbtype(1)@dblink;

  • PL/SQL-Function for validation

    I wrote a PL/SQL function in order to validate that the SUM of input-values doesn't exceed 100.
    I used validation rule from APEX for PL/SQL-expression (same like SQL-expression):
    f_page_16_validation(:P16_PSP_PSP)<=100 (Condition: CREATE, SAVE)
    source code for function:
    CREATE OR REPLACE FUNCTION f_page_16_validation
    (pi_p16_psp_psp VARCHAR2)
    RETURN NUMBER
    IS
    vl_sum NUMBER(5) := 0;
    BEGIN
    SELECT NVL(SUM(psp_anteil_projekt),0) INTO vl_sum
    FROM st_psp_projekt_psp
    WHERE UPPER(psp_psp) = pi_p16_psp_psp;
    RETURN vl_sum;
    END f_page_16_validation;
    When I check in SQL*Plus against database: SELECT f_page_16_validation('A_TEST_UHL_PSP%') FROM dual;
    I get the correct value. When I input into APEX-Application the validation rule doesn't fire (CREATE). If my SUM is over 100 and try to change
    one value (in order to come under 100) (SAVE) - the validation rule fires but quite independent of the SUM - it accepts NO VALUE!!
    Apex-Version: 3.1.1.00.09
    Can somebody tell me what's wrong? Is there any other way - SQL,PL/SQL-expression, PL/SQL-function body (bool, error text) didn't work.

    1. If your PL/SQL expression is written as you stated:
    f_page_16_validation(:P16_PSP_PSP)<=100then you will receive an error message if the total is <= 100 and not if it exceeds 100.
    2. Where in your code do you consider the input values? I see that you are selecting from a table, where your already inserted values are but I see no input values. Are you using a form or a tabular form? If I look at the names of your buttons then I wouls say you are using a form.
    3. You are talking about condition. What type of condition you use? I would use a PL/SQL Expression like this:
    :REQUEST IN ('CREATE', 'SAVE')4. I would suggest to use a validation of type PL/SQL Function Returning Error Text since you can put all the code in one.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • PL/SQL function body returning SQL - report error:ORA-01403: no data found

    Hi,
    I am working on Application Express 4.0.2.00.06, and 11G database.
    I have a problem with classic report area of type - PL/SQL function body returning SQL query. Query works if I define region area as - Use Generic Column Names (parse query at runtime only), and does not when I define it - Use Query-Specific Column Names and Validate Query.
    I am getting error:
    report error:ORA-01403: no data found
    This is my query that is returned from function, and displayed with htp.p, and it works ok and returns data in SQL Developer and SQL Workshop (in Apex).
    <code>
    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA
    </code>
    As you can see, I even tried with workaround that I found on the previous post on the forum, and that is to put /* select 1 from dual */ to start query.
    Any help would be appriciated.

    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA

  • Use sql function decode with Zend code

    Hi,
    I need to use sql function DECODE() in a query for PHP Code. This query works well in sql*plus but PHP returns
    the following error message:
    Parse error: syntax error, unexpected T_STRING in C:\Program Files\Zend\Apache2\htdocs\Compta\compta2.php on line 16
    the query is :
    $query =
    'select substr(c.NUM,1 ,2) Compte ,
    c.designation , a.Periode
    ,decode(substr(c.NUM,1 ,1), '1',1, '2',1,'3',1,-1) cp_type ,
    sum(credit) - sum(debit) Montant
    from ecritures a, clients b, compte c
    where
    b.NUM (+) =a.NUM
    and a.DATEECRITURE between to_date(:debut, \'dd/mm/yy\') and to_date(:fin, \'dd/mm/yy\')
    and substr(a.num,1,2) =c.num
    group by substr(c.NUM,1 ,1), substr(c.NUM,1,2) , c.designation ,a.periode
    order by compte ';
    Can any one help me ???
    Thanks by advance
    nb: Iuse Zend 2.0

    Hi,
    You need to escape single quote mark:
    decode(substr(c.NUM,1 ,1), \'1\',1, \'2\',1,\'3\',1,-1) cp_type ,
    the same way you did for to_date:
    to_date(:debut, \'dd/mm/yy\')
    Regards,
    Paweł

  • Error while creating sql function

    I am getting the following error when i execute the below query for creatin sql function. Please let me know waht is the problem
    Major Error 0x80040E14, Minor Error 25501
    > create FUNCTION fantastic ( @deal_id , @as_of_date)
    returns @funtab table
    (issue_id int not null,
    par_amount money not null)
    as
    begin
    insert @funtab
    select a.issue_id,a.par_amount 
    from asserts as a, issue as i, issuer_rating_history h, deal d
    where h.as_of_date = @as_of_date and
     d.deal_id = @deal_id and 
    d.deal_id = a.deal_id
    a.issue_id=i.issue_id 
    return
    end
    There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = FUNCTION ]
    create FUNCTION fantastic ( @deal_id , @as_of_date)
    returns @funtab table
    (issue_id int not null,
    par_amount money not null)
    as
    begin
    insert @funtab
    select a.issue_id,a.par_amount 
    from asserts as a, issue as i, issuer_rating_history h, deal d
    where h.as_of_date = @as_of_date and
     d.deal_id = @deal_id and 
    d.deal_id = a.deal_id
    a.issue_id=i.issue_id 
    return
    end

    Hello,
    See MSDN
    Differences Between SQL Server Compact and SQL Server => "User-defined functions and full text:
    Not supported" in SQL CE, so you can not create a function as in SQL Server.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for