OWB3i - Validate with DECODE function

Hi,
in OWB 3i when I validate an expression defined inside an expression operator with DECODE() function (which is not include in default transformation) come this error:
Line 1, Col 1:
PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
but it seems only a warning because when i generate the scripts and run no other error happen and all works fine.
Regards

Hi,
Welcome to the forum!
When you use a default value, the last argument to DECODE is the actual value you want as a default.
For example:
SELECT       ename
,       deptno
,       DECODE ( deptno
             , 30     , 'Sales'
                  , 'All others'     -- Default value
              )                 AS dname
FROM      scott.emp
ORDER BY  ename
;Output:
ENAME          DEPTNO DNAME
ADAMS              20 All others
ALLEN              30 Sales
BLAKE              30 Sales
CLARK              10 All others
FORD               20 All others
JAMES              30 Sales
JONES              20 All others
KING               10 All others
MARTIN             30 Sales
MILLER             10 All others
SCOTT              20 All others
SMITH              20 All others
TURNER             30 Sales
WARD               30 Sales 
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
If you can show the problem using commonly available tables (such as those in the scott schema) then you don't need to post any sample data; just the results and the explanation.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ {message:id=9360002}

Similar Messages

  • Error while replacing IF statements with DECODE function in procedure

    Hi All,
    I have created a procedure which has nested IF statements. Now I want to replace the IF statements with DECODE functions to improve performance.
    Procedure:
    IF (var_int_sev = '0')
    THEN
    var_sev := '2';
    ELSE
    SELECT sev
    INTO var_int_sev
    FROM errorconfig
    WHERE errorcode = var_errorcode;
    var_sev := var_int_sev;
    END IF;
    I converted the above IF statement into DECODE function as mentioned below:
    var_Sev := DECODE(var_int_sev,0,2,SELECT severity FROM errorconfig WHERE errorcode=var_ErrorCode)
    But it throws below error at the select statement used inside DECODE.
    Error(58,51): PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null others <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set specification> <an alternativ
    Can someone help me in converting the IF to DECODE in the above case. Also how can we use a select statement inside decode.

    instead of trying to rewrite all your code and hoping that the performance will be better, it's a better option to investigate and find out which part of your application is slow
    read this:
    When your query takes too long ...

  • Prob with decode function

    hi iam having prob with the following decode function
    declare
    c varchar2(20);
    begin
    select decode(deptno,
    10, 'accounting',
    20,'Research',
    30 ,'sales',
    40,'operations','UNKNOWN') into c from dept where loc='DALLAS';
    dbms_output.put_line('DEPARTMENT in DALLAS'||c);
    select decode(deptno,
    10, 'accounting',
    20,'Research',
    30 ,'sales',
    40,'operations','UNKNOWN') into c from dept where loc='INDIA';
    dbms_output.put_line('DEPARTMENT IN INDIA'||c);
    end;
    iam getting no_data_found exception which is reasonable..but what happened to 'unknown' clause in decode function.
    thank u
    rajiv

    Please see the responses to your prob in decode function
    John

  • How to convert rows into columns with decode function

    Hi,
    How to convert rows into columns with the help of decode function in oracle.
    thanks and regards
    P Prakash

    say
    col1 col2
    1 10
    2 20
    3 30
    then use
    select col1,
    sum(decode(col2,10,10)) "new1"
    sum(decode(col2,20,20))"new2"
    sum(decode(col2,30,30))"new3"
    from table_name
    group by col1;
    we used sum u can use ny function if wont u have to give the column name i.e col2 name also
    so i think u got it nw
    regards

  • Problem with decode function.

    Hi,
    Can anyone of you help me out in solving this?
    It is like i wish to give different select statements according to the value of a parameter entered by user USING DECODE FUNCTION.The select statement contains some other select statements inside it.So when i execute it,it is giving error like 'ORA-00913-too many values(even when i enclose select statements within brackets).

    ORA-00913 too many values
    Cause: The SQL statement requires two sets of values equal in number. This error occurs when the second set contains more items than the first set. For example, the subquery in a WHERE or HAVING clause may return too many columns, or a VALUES or SELECT clause may return more columns than are listed in the INSERT.
    Action: Check the number of items in each set and change the SQL statement to make them equal.
    the above is from oracle documentation. the brackets is not the problem, u must be using multiple items in the integrated decode queries. If the problem still exists post ur DML for further analysis.
    zaibi.

  • Need help with DECODE function

    Hello,
    I am trying to use default within the decode function and every time I get a missing expression. I have searched everywhere and cant figure out what I'm doing wrong. Thanks
    select decode (request_id,0,'No files found', DEFAULT)

    Hi,
    Welcome to the forum!
    When you use a default value, the last argument to DECODE is the actual value you want as a default.
    For example:
    SELECT       ename
    ,       deptno
    ,       DECODE ( deptno
                 , 30     , 'Sales'
                      , 'All others'     -- Default value
                  )                 AS dname
    FROM      scott.emp
    ORDER BY  ename
    ;Output:
    ENAME          DEPTNO DNAME
    ADAMS              20 All others
    ALLEN              30 Sales
    BLAKE              30 Sales
    CLARK              10 All others
    FORD               20 All others
    JAMES              30 Sales
    JONES              20 All others
    KING               10 All others
    MARTIN             30 Sales
    MILLER             10 All others
    SCOTT              20 All others
    SMITH              20 All others
    TURNER             30 Sales
    WARD               30 Sales 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    If you can show the problem using commonly available tables (such as those in the scott schema) then you don't need to post any sample data; just the results and the explanation.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Between clause with DECODE function.

    Hi All,
    I have one table which has object, date and quantity columns, Now based on date range I can find out the objects and quantity but the question is: I want a query which returns all the objects and should show quantity 0(zero or null) for those objects which don't falls under that date range. So I thought to use a decode function but it only uses the relational operation, I thought something like this but it's wrong,
    select object,decode(created_date,BETWEEN '01/01/2008' TO '08/01/2008',quantity,0) from table;
    Does anyone have any idea how can I make this work in single sql statement?
    Thanks for your help.

    select object,decode(created_date,BETWEEN '01/01/2008' TO '08/01/2008',quantity,0) from table;
    Does anyone have any idea how can I make this work in single sql statement?If you're still interested in using DECODE over Case when, please try this.
    Check for employees hired between 6/17/1987 and 9/30/1987
    SQL> select first_name||' '||last_name as emp_name, hire_date,
      2         decode(sign((to_date('06/17/1987','MM/DD/YYYY')-1)-hire_date)
      3           + sign((to_date('09/30/1987','MM/DD/YYYY')+1)-hire_date)
      4                   ,0,'Between','Not between') as IsBetween
      5    from employees
      6   where hire_date <to_date('01/01/1991','MM/DD/YYYY')
      7  /
    EMP_NAME                                       HIRE_DATE ISBETWEEN
    Steven King                                    17-JUN-87 Between
    Neena Kochhar                                  21-SEP-89 Not between
    Alexander Hunold                               03-JAN-90 Not between
    Jennifer Whalen                                17-SEP-87 BetweenMessage was edited by:
    Bobbydj

  • Odd Error with decode function in Order By Clause

    I am trying to compile a procedure and can't get around an error with a dynamic order by that doesn't make much sense to me. I can repoduce the error with a plain select statment in sql plus so I can rule out a declaration error. Here is an example with 2 numeric columns and a date column.
    select task_id, display_date, remark_id from task_list
    where task_id > 1000
    order by decode('Task_ID', 'Task_ID',Task_ID, 'Display_Date', Display_Date, 'Remark_ID',Remark_ID)
    returns the error:
    select task_id, display_date, remark_id from task_list
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    I'm not sure why this error is occuring, because it doesn't even hit the Display_Date field in the Decode statment. If I take the Display_date out of the statement, it runs properly. If I change Display_Date to To_Char(Display_Date) it also runs fine, but the sorting is incorrect. Also I'm running 9.2, and do not want to use dynamic sql to build my query. Any Ideas out there as to the cause of this error?

    I did find a workaround to this issue by breaking the decode statment into three separate statement, but I still think that the way it is written above should work, and may be a bug, or an error that I don't understand fully.
    The Order by was rewritten like this:
    order by decode(pSort, 'Task_ID',Task_ID), decode(pSort, 'Display_Date', Display_Date),
    decode(pSort, 'Remark_ID',Remark_ID);
    Thanks

  • Help with Decode function

    Hello!!
    Can anyone please help me with the decode statement
    Table 1 Table2 Table3
    Id Id Code
    Volume Code
    For each of the codes in Table3 I need to find the corresponding Volume. Can I use decode in the select statement to this,
    Eg Code Volume
    ABC 20
    XYZ 10 etc etc.
    Thankyou all in advance.

    Your table structure is a little unclear from your post. I am assuming that what you posted was:
    Table 1
    Id
    Table2
    Id
    Code
    Table3
    Volume
    Code You can use decode if there are only a few values for table3. For example,
    SELECT table2.code,
    DECODE(table2.code,'ABC',10,'XYZ',20,'UNKNOWN') volume
    FROM table2
    or even
    SELECT code,DECODE(code,null,'NONE',
                      (SELECT volume FROM table3 where code=table2.code)) volume
    FROM table2However, the first will break, or at least be incorrect, if anyone adds a new code/volume pair, and is tedious if you have more than a few values. The second will likely be pretty slow if there are a large number of records in table3. The best solution would be to use a simple join rather than decode. Something like:
    SELECT table1.id, table2.code, table3.volume
    FROM table1, table2, table3
    WHERE table1.id = table2.id and
          table2.code = table3.code

  • Doubt with Decode function(By Naren)

    Hi all
    i have the following query
    SELECT S.SCHOOLNAME,
    SUM(DISTINCT DECODE(LR.QUESTIONNAIRE_ID,62, L.WORK_SPACE))/5 As LITSUM
    FROM TQDB_LEARNER_RESPONSE L LEFT JOIN TQDB_LEARNER_RESPONSERS LR ON LR.RESPONSER_ID=L.RESPONSER_ID LEFT JOIN
    SCHOOLS S ON S.SCHOOLID=LR.SCHOOL_ID
    GROUP BY S.SCHOOLNAME
    It is working fine if i fixed QUESTIONNAIRE_ID AS 62.
    Can i use parameter in place of 62 like :QID
    When i execute this query and gave 62 as parameter value it should give LITSUM depend on 62,And if i wont give value(null or blank) it should give result irrespective of QUESTONNAIRE_ID.
    I tried it by changing above query like following.
    SELECT S.SCHOOLNAME,
    SUM(DISTINCT DECODE(LR.QUESTIONNAIRE_ID,:QID, L.WORK_SPACE))/5 As LITSUM
    FROM TQDB_LEARNER_RESPONSE L LEFT JOIN TQDB_LEARNER_RESPONSERS LR ON LR.RESPONSER_ID=L.RESPONSER_ID LEFT JOIN
    SCHOOLS S ON S.SCHOOLID=LR.SCHOOL_ID
    GROUP BY S.SCHOOLNAME
    But it is not working properly,not giving expected result.
    Pls help me.

    never noticed that bit, sorry.
    I am assuming that your questionnaire_id is not null, so when you pass null there are no records with a questionnaire_id of null.
    if you want to total all L.WORK_SPACE if you pass null then try this
    SELECT S.SCHOOLNAME,
    SUM(DISTINCT DECODE(:QID, NULL, L.WORK_SPACE, DECODE(LR.QUESTIONNAIRE_ID, :QID, L.WORK_SPACE))) / 5 AS
    LITSUM
    FROM TQDB_LEARNER_RESPONSE L LEFT JOIN TQDB_LEARNER_RESPONSERS LR ON LR.RESPONSER_ID = L.RESPONSER_ID LEFT JOIN SCHOOLS S ON S.SCHOOLID = LR.SCHOOL_ID
    GROUP BY S.SCHOOLNAME;

  • Query with DECODE function

    My table has columns A,B & C with data as below
    A B C
    X 1 1
    1 X 1
    1 1 X
    Result should be all ‘Z’ inserted right to ‘X’ & must look like as below
    A B C
    X Z Z
    1 X Z
    1 1 X
    Please check the below query & help me to modify the query as the result for column b is not correct.
    select a,decode(b,'1','Z','X') b,decode(c,'1','Z','X') c
    from test;

    try
    With Data As
    Select 'X' A,'1' B, '1' C From Dual Union All
    Select '1','X','1' From Dual Union All
    Select '1','1','X' From Dual
    Select A, (Case When A ='X' And B='1' Then 'Z' Else B End) B,
    (Case When (A='X' Or B='X') And C='1' Then 'Z' Else C end)C 
    from dataVivek L

  • Problem with decode function while dispaly the data ( urgent )

    Hi friends ,
    I want the output like this.
    sample:
    CLIENT CODE: 00027
    PLAN CODE: 01
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D M 250.00
    123-45-6036 Perrault Julia D Q 400.00
    CLIENT CODE: 00027
    PLAN CODE: 02
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D S 1000.00
    123-45-7042 Testaverde Alexander D B 50.00
    this is my query:
    SELECT distinct pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'TYPE',rp.userid,NULL) type
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    output for above query:
    PLAN_C SSN LAST_NAME FIRST_NAME CLT_C AMOUNT
    FREQUENCE TYPE
    01 123456036 Perrault Julia 00027 250.00
    01 123456036 Perrault Julia 00027 400.00
    01 123456036 Perrault Julia 00027 M
    01 123456036 Perrault Julia 00027 Q
    01 123456036 Perrault Julia
    00027 D
    02 123456036 Perrault Julia 00027 1000.00
    02 123456036 Perrault Julia 00027 S
    02 123456036 Perrault Julia
    00027 D
    02 123457042 Testaverde Alexander 00027 50.00
    02 123457042 Testaverde Alexander 00027 B
    02 123457042 Testaverde Alexander
    00027 D
    11 rows selected.
    11 rows selected.
    how can i get the above ouput .
    i want the type,frequency,amount values in one line.
    thanks for u r kind help
    srini

    Hi Srini,
    Add Max in the begining and group by at the end of statement.
    Please let me know in both cases if it works or not.
    thanks
    for example
    SELECT distinct pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    MAX(DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'TYPE',rp.userid,NULL) type )
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    GROUP BY
    pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,

  • Problem with decode function ( urgent )

    Hi friends ,
    this is my query
    SELECT DECODE(rp.account_code,'TYPE',rp.userid,NULL) type,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    getting output like this:
    TYPE FREQUENCE AMOUNT
    S
    D
    1000.00
    M
    D
    250.00
    Q
    D
    400.00
    B
    D
    50.00
    12 rows selected.
    i want the output like this :
    TYPE Frequency Amount
    D M 250.00
    D Q 400.00
    D S 1000.00
    D B 50.00
    how can get the above out put.
    thanks for u r kind help
    srini

    Try formatting your columns
    col type for a4
    col frequence for a4
    col amount for a4
    although from looking at you query, I don't understand the
    output you pasted. YOu have 3 decode statments based on the
    same fields?
    Hi friends ,
    this is my query
    SELECT DECODE(rp.account_code,'TYPE',rp.userid,NULL) type,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    getting output like this:
    TYPE FREQUENCE AMOUNT
    S
    D
    1000.00
    M
    D
    250.00
    Q
    D
    400.00
    B
    D
    50.00
    12 rows selected.
    i want the output like this :
    TYPE Frequency Amount
    D M 250.00
    D Q 400.00
    D S 1000.00
    D B 50.00
    how can get the above out put.
    thanks for u r kind help
    srini

  • Problem with decode function while dispaly the data

    Hi friends ,
    I want the output like this.
    sample:
    CLIENT CODE: 00027
    PLAN CODE: 01
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D M 250.00
    123-45-6036 Perrault Julia D Q 400.00
    CLIENT CODE: 00027
    PLAN CODE: 02
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D S 1000.00
    123-45-7042 Testaverde Alexander D B 50.00
    this is my query:
    SELECT distinct pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'TYPE',rp.userid,NULL) type
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    output for above query:
    PLAN_C SSN LAST_NAME FIRST_NAME CLT_C AMOUNT
    FREQUENCE TYPE
    01 123456036 Perrault Julia 00027 250.00
    01 123456036 Perrault Julia 00027 400.00
    01 123456036 Perrault Julia 00027 M
    01 123456036 Perrault Julia 00027 Q
    01 123456036 Perrault Julia
    00027 D
    02 123456036 Perrault Julia 00027 1000.00
    02 123456036 Perrault Julia 00027 S
    02 123456036 Perrault Julia
    00027 D
    02 123457042 Testaverde Alexander 00027 50.00
    02 123457042 Testaverde Alexander 00027 B
    02 123457042 Testaverde Alexander
    00027 D
    11 rows selected.
    11 rows selected.
    how can i get the above ouput .
    i want the type,frequency,amount values in one line.
    please help me.
    thanks for u r kind help.
    srini

    Hi.
    I have not tested this my self, byt tryit.
    SELECT pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    MAX(DECODE(rp.account_code,'AMNT',rp.userid,NULL)) amount,
    MAX(DECODE(rp.account_code,'FREQ',rp.userid,NULL)) frequence,
    MAX(DECODE(rp.account_code,'TYPE',rp.userid,NULL)) type
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    GROUP BY pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name
    /Uffe

  • Problem using DECODE() function with a Query of Queries

    I
    posted
    on my blog about an issue I was having trying to use the PL/SQL
    DECODE() function with a Coldfusion Query of Queries. This function
    works fine when you query a database for information. However, when
    you query another query, it seems that CF doesn't recognize it. I
    got errors stating that it found a left parenthesis where it
    expected a FROM key word. Here is a simplified version of what I am
    trying to do:
    quote:
    <!--- Simulated query; similar to what I was calling from
    my database --->
    <cfscript>
    qOriginal = queryNew("Name,Email,CountryCode",
    "VarChar,VarChar,VarChar");
    newRow = queryAddRow(qOriginal, 5);
    querySetCell(qOriginal, "Name", "Joe", 1);
    querySetCell(qOriginal, "Email", "[email protected]", 1);
    querySetCell(qOriginal, "CountryCode", "AMER", 1);
    querySetCell(qOriginal, "Name", "Sally", 2);
    querySetCell(qOriginal, "Email", "[email protected]", 2);
    querySetCell(qOriginal, "CountryCode", "AMER", 2);
    querySetCell(qOriginal, "Name", "Bob", 3);
    querySetCell(qOriginal, "Email", "[email protected]", 3);
    querySetCell(qOriginal, "CountryCode", "ASIA", 3);
    querySetCell(qOriginal, "Name", "Mary", 4);
    querySetCell(qOriginal, "Email", "[email protected]", 4);
    querySetCell(qOriginal, "CountryCode", "EURO", 4);
    querySetCell(qOriginal, "Name", "John", 5);
    querySetCell(qOriginal, "Email", "[email protected]", 5);
    querySetCell(qOriginal, "CountryCode", "EURO", 5);
    </cfscript>
    <cfquery name="qCountries" dbtype="query">
    SELECT DISTINCT(CountryCode) AS CountryCode,
    DECODE(states, "AMER", "North America &amp; Canada",
    "EURO", "Europe &amp; Africa", "ASIA", "Japan &amp;
    Asia","") CountryName
    FROM qOriginal
    ORDER BY CountryCode
    </cfquery>
    <cfdump var="#qCountries#">
    <!--- ========== END OF CODE ========== --->
    So running this returned the following error:
    Query Of Queries syntax error.
    Encountered "(. Incorrect Select Statement, Expecting a
    'FROM', but encountered '(' instead, A select statement should have
    a 'FROM' construct.
    Does anybody know why this doesn't work? Is it just not
    supported? Please note that I have also tried to use the CASE()
    function instead of DECODE() and that resulted in basically the
    same error. For now I an looping over my distinct query with a
    switch statement and manually loading a new query with the data how
    I want it. But it would be a lot cleaner and less code to have the
    DECODE() to work. Thx!

    DECODE() is an Oracle function, not generic SQL. Q-of-Q is a
    very limited subset of SQL and lacks many functions and clauses
    available in standard SQL, especially what you may be used to using
    in your particular RDBMS.
    See
    Query
    of Queries user guide
    Phil

Maybe you are looking for

  • How to access file from AIX server to windows

    HI all, My question is how to represent file folder name of that server my file folder in AIX server and i want to access that file in window s machine. * is this the right way to represent the data folder in physical schema declaration file:///<aix

  • How many machines can I install Logic on?

    Hi I have Logic 9 installed on my Mac Pro in my studio. But I am about to purchase a new Mac Book Pro, am I allowed to install logic onto a second machine?

  • G3 won't boot.

    I putin a CD. Don't remember which one. And in Startup in Control Panel I said boot the CD. I restarted and now it says "This startup disk will not work on this Macintosh model. Use the latest Installer to update this disk for this model." That's fin

  • Is the Export Quality for PDFs in Reporting Services 2005 only 96DPI?

    I have been fighting with Reporting Services all day, and despite setting the PDF output quality to 300DPI, I have noticed that the image quality appears to be only 96DPI. I've noticed this because images with a size set for 300DPI are too large for

  • BEFW11S4 Wireless-B Problems...Please help!

    Helping my friend set up a home network. No high speed internet yet so she's just going use it for print and file sharing. Setup: Router connected via ethernet to desktop we'll call Sam office Notebook we'll call Sam notebook connected via internal w