Current position:  Home > Default > Problem in Dynamic LOV query

Problem in Dynamic LOV query

Time:November 30
Advertisement
Hi,
I have a LOV in my page its query should be based on item condition.
So I tried using Apex provided Dynamic LOV Query with IF.. ELSE.. END IF condition.. But when I use this and run the page it is giving error "URL NOT FOUND".
My query is
   IF :MY_ITEM is not null THEN
   RETURN 'select ename ,eno
                from emp
                where eno = '''||:MY_ITEM||''' ';
   ELSE
    RETURN 'select ename ,eno
                from emp
                where ename = ''ALAKA''  ';
   END IF;But it is not working for me.
Please anyone help me to solve this.
Thanks
Alaka
Advertisement
Hi All,
It worked for me. Just I modified my code a bit. Thanks to all for help.
Just I did ,
   DECLARE
   BEGIN
         IF :MY_ITEM IS NOT NULL THEN
            RETURN 'SELECT ENAME,ENO
                        FROM EMP
                        WHERE ENAME = '''||:MY_ITEM||''' ';
       ELSE
           RETURN 'SELECT ENAME,ENO
                        FROM EMP
                        WHERE ENAME = ''ALAKA'' ';
      END IF;
      EXCEPTION
        WHEN OTHERS THEN
            HTP.PRN('ERROR'||SQLERRM);
   END;
Thanks
Alaka

Strange Problem in dynamically list population with record group

2015-10-11

Hello Room, I am dynamically populating a single list with 2 record groups. I am having a strange problem. All the code are written in 2 seperate buttons. The code of every button is given below. Button 1 code:- DECLARE rg_reports RECORDGROUP; rg_nam

Best way to spool DYNAMIC SQL query to file from PL/SQL

-0001-11-30

Best way to spool DYNAMIC SQL query to file from PL/SQL [Package], not SqlPlus I'm looking for suggestions on how to create an output file (fixed width and comma delimited) from a SELECT that is dynamically built. Basically, I've got some tables that

SSRS - Stored procedure with Dynamic SQL Query

-0001-11-30

Am calling stored procedure in SSRS report.  I have used Dynamic SQL query in stored procedure as I don't know the column name and column count.  And I have used like below at end of the stored procedure "select * from ##temptable". As I have us

NVARCHAR (MAX) TO PRINT DYNAMIC SQL QUERY TO A SQL FILE

-0001-11-30

Hi  I have a requirement where i need to write an SP which would construct a huge query using dynamic SQL and save the Dynamic query to a file.  The Dynamic SQL Variable I am using as @NVARCHAR(MAX) but since the query being built is large (>4000 cha

Problem while opening Bex query on the web

2015-10-11

Hello BW experts, I have a problem while opening Bex query from my SAP Favorites.See below. When i double click on the query, i get the following page, with the server name KBWS01QX. But, from RSRT Tcode, select the query > query display as HTML > C

Problem in writing a query

2015-10-11

Dear all, I have a problem for writing a query, country: name,code,population. economy:country(code),gdp in the economy table i have gdp of each country, i calculated sum of the GDP of all countries and then half of it(50% of world GDP) then i should

How to create a Type Object with Dynamic select query columns in a Function

2015-10-11

Hi Every One, I'm trying to figure out how to write a piplined function that executes a dynamic select query and construct a Type Object in order to assigned it to the pipe row. I have tried by SELECT a.DB_QUERY INTO actual_query FROM mytable a WHERE

Problem in my Select query

2015-10-11

Hi Experts, I need a clarification in my Select query. Have created a custom search help and my requirement is I have Request ID, Last and First Name as my search parameters. I need to fetch the values from my Ztable on search with the above said sea

Problem in standard select query in fagll03

2015-10-11

Good Morning frndz, I m facing a problem while runnin fagll03. when executed it gives timeout error. When I debug it  , it gets stuck in a select query SELECT SINGLE * FROM t800m INTO CORRESPONDING FIELDS OF ls_b WHERE totable = ls_t800a-ntable AND f

Dynamic Select query is failing with error "Invalid Table Name"

2015-10-11

OPEN rc FOR 'SELECT count(*) from :s' USING tab_name; fetch rc into rec_count; CLOSE rc; my requirement is to build dynamic select query to retrieve the total count of rows in each table ( variable tab_name contains the table_name ) But I am getting

Problem in block based Query

2015-10-11

Respected Guru's I have a problem eith block bassed query.i have already used this block based query and it is working too. But here i am facing the the problem.why becuz i have used a global variable to pass value for execute it. and used 'set_block

Build dynamic SQL query in Database Adapter.

2015-10-11

Hi All, I have a requirement to build dynamic sql query at Database Adapter. My BPEL process is getting search spec as input from siebel. I need to process this searchspec in BPEL and need to build the SQL query dynamically at Database Adapter to fet

Setting Column Names in Dynamic Pivot Query

2015-10-11

Hi all, I'm having trouble setting column names in a dynamic pivot query and was wondering if someone could please help me figure out what I need to do. To help you help me, I've setup an example scenario in my hosted account. Here's the login info f

Dynamically built query on execution How to save the data in Object Type

2015-10-11

Hi, In pl/sql I am building and executing a query dynamically. How can I stored the output of the query in object type. I have defined the following object type and need to store the output of the query in it. Here is the Object Type I have CREATE OR

Flash chart with dynamic sql query does not display

2015-10-11

Hi, In my schema SIVOA I have a lot of tables declared like this :   CREATE TABLE "SIVOA"."EVV_xxxx"    (     "CLEF_VAR" NUMBER(4,0),      "DATE1" DATE,      "VALEUR" NUMBER(16,8) Only the last part of the

Absolute dynamic select query with dynamic join and where

-0001-11-30

Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions. I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors. Please let m

Problems with Input Ready Query

-0001-11-30

Hello All, I'm facing problems with input ready query for BI IP. I've created the input query on aggregation level and maintianed all the planning settings.  It is not allowing me to edit, when i'm attaching in the web template. I also attached a but

How to use Field-symbol with dynamic select query

-0001-11-30

Can anybody tell me, how to use field-symbols in the dynamic select query.FIELD-SYMBOLS <fs> { typing | STRUCTURE struc DEFAULT dobj }. 1. ... typing 2. ... STRUCTURE struc DEFAULT dobj The FIELD-SYMBOLS statement declares a field symbol <fs>.

Dynamic select query with dynamic where condition

-0001-11-30

Hi all, I want to use the dynamic select query with dynamic where condition. For that I used the below code but I am getting dump when using this code. Please advice, if there is any other way to achieve this requirement. Thanks, Sanket Sethi Code***