Can use place holder (?)in select statement.

Is it possible to have have a place holder in my select clause or it is possible to have only in where clause?
Please find the below query I am having place holder in select statement emp_id=? nit it is throwing an error for me.
select * from(select myrows.*, rownum rn from(select acc as account, es as identity,address as street_address
state as stae,select id from mytable where emp_id=? as my site from myview
where ert_id=? and chek=?
I am getting an error ORA-00936:     missing expression is it possible to have a place holder in select statement
Please help me on this.
Regards,
BA

user575682 wrote:
Is it possible to have have a place holder in my select clause or it is possible to have only in where clause?
Please find the below query I am having place holder in select statement emp_id=? nit it is throwing an error for me.
select * from(select myrows.*, rownum rn from(select acc as account, es as identity,address as street_address
state as stae,select id from mytable where emp_id=? as my site from myview
where ert_id=? and chek=?
I am getting an error ORA-00936:     missing expression is it possible to have a place holder in select statement
Please help me on this.
Regards,
BAfor clarity and easy to be read i attempted to rearrranged your code and this is what it will look like:
select *
  from (select myrows.*, rownum rn
          from (select acc as account,
                       es as identity,
                       address as street_address
                       state as stae,
                       select id
                  from mytable
                 where emp_id = ? as my site from myview where ert_id=? and chek=?apparently the syntax is not correct and by that you are missing some comma in your column, ? question mark symbol will not be recognize, and some ')' closed parenthesis.
are you using a report builder that you want to use a placeholder column?

Similar Messages

  • Error by using database procedure in select statement

    hi ,
    I have built a database procedure having one parameter with in out varchar type. that return value with some addition.
    i am using it with some column in select statement only for display purpuses but i am facing error by doing that in select statement. that procedure is working well with bind variable but not with select statement.
    plz help me how i can use a procedure in select statement. or can i do it or not.

    plz help me how i can use a procedure in select statement. or can i do it or not.A workaround could be to create a wrapper function for your procedure. One that only passes the input parameters and returns the output parameter.
    The simply call this function in your select which internally calls the procedure.

  • Using plsql tables in select statement of report query

    Hi
    Anyone have experience to use plsql table to select statement to create a report. In otherwords, How to run report using flat file (xx.txt) information like 10 records in flat files and use this 10 records to the report and run pdf files.
    thanks in advance
    suresh

    hi,
    u can use the utl_file package to do that using a ref cursor query in the data model and u can have this code to read data from a flat file
    declare
    ur_file utl_file.file_type;
    my_result varchar2(250);
    begin
    ur_file := UTL_FILE.FOPEN ('&directory', '&filename', 'r') ;
    utl_file.get_line(ur_file, my_result);
    dbms_output.put_line(my_result);
    utl_file.fclose(ur_file);
    end;
    make sure u have an entry in ur init.ora saying that your
    utl_file_dir = '\your directory where ur files reside'
    cheers!
    [email protected]

  • Can i join these sql select statement in one

    Hi All,
    Can i join this two select statement in to one select statement.
    select username from dba_users where username like 'SAP%%%'; # to the Schemaid of the below /BMC/YGO_CPROD.
    select YOP_PRD_NM, YOP_VERS from <schemaid>."/BMC/YGO_CPROD"; # To know a version from the table.
    I am using this in a script can any help to join the above select statements into one.
    Schemaid should be passed to this select YOP_PRD_NM, YOP_VERS from <schemaid>."/BMC/YGO_CPROD"; and i need to get output!
    Thanks a lot

    Are you asking about using the output of one query as the input to the WHERE clause of another?
    If so look at the demos here: http://www.psoug.org/reference/conditions.html
    PS: There is zero value in the construct 'SAP%%%'
    What is it you are trying to do?
    One "%" wildcard is sufficient.

  • How to use SET ID in select statement of SQ02

    Hi,
    I have a infoset, where for one of my Zfield, i have writen a select statement in order to get my ouput.
    if aufk-aufnr = 'XYZ'.
      select sum( FKBTR ) from fmifiit into zfmifiit
      where fikrs = aufk-kokrs
      and fipex IN capex
      and wrttp NE '51'.
    endif.
    For the above statement, i have created (with 10 single values, table name FMCI, field name FIPEX)  a SET id named CAPEX and used with IN operator.
    But when i generating the infoset i am getting error like below
    The IN operator with "CAPEX" is followed neither by an internal table nor by a value list
    I was using IN opeartor for set ids during validation / substitutions, where if i have to validate multiple single values.
    What to do here?
    Regards,
    Srinu

    [OPEN-SQL|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_GENERAL.htm] set of statement, [SELECT|http://help.sap.com/abapdocu_70/en/ABAPWHERE.htm] statement, [WHERE|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP.htm] addition requires a selection table (type range, [WHERE - IN seltab |http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_SELTAB.htm]) of parameter and not a set. We are in Abap here, not in a Customizing screen
    You have to convert the set to a selection table in an ABAP coding before using it in a SELECT statement.
    (Check FM like G_SET_TREE_IMPORT to import definition of set (values and intervals) and map them to a select-table, or ask a developper to perform it, look at G_SET_TREE_IMPORT -> select statement)
    Regards,
    Raymond

  • Using java function in select statement

    Hi,
    I am trying to use java function in select statement.
    public class ClassA{
         private static String MyConst = "foo";
         public static String functionA(){
              return MyConst;
    in my query I have:
    select
         ClassA.functionA() AS id,
         groupId AS newID,
    from
         myChannel[now]
    ClassA is part of the application (no need to import).
    I get and error of Invalid Expression on ClassA.functionA().
    I also tried to declare the function in the processor element:
    <wlevs:processor id="proc">
         <wlevs:function function-name="A" exec-methode="functionA">
              <bean class="mtPackage.ClassA"/>
         </wlevs:function>
    <wlevs:processor>
    but then I get a different error in the processor XML file:  "An InvocationTargetException was encoutered while attemting to register the user defind function A. The message was null"
    What am I missing here?

    Hi,
    From the above description, you have tried two manners to call method functionA() in the user defined  class ClassA. One uses java cartridge manner directly and the other try to use user defined function manner.
    For the java cartridge manner, the following CQL query should work if the ClassA is really included in the OEP app. I have done similar test before, it works.
    select
         ClassA.functionA() AS id,
         groupId AS newID,
    from
         myChannel[now]
    For user defined function manner, I think two things you need to change:
    1. Need to declare the function in the EPN assembly file(under META-INF/spring/), not component configuration file(under META-INF/wlevs/). The following is an example:
    <wlevs:processor id="proc">
         <wlevs:function function-name="A" exec-methode="functionA">
              <bean class="mtPackage.ClassA"/>
         </wlevs:function>
    </wlevs:processor>
    2. Call the user defined function in the CQL query in the component configuration file under processor. For example:
    select A() from myChannel
    Regards,
    XiYing

  • How to use  'is null' in select statement of ABAP program

    hi,
    I want to use 'is nul' or 'not null' in select statement of my ABAP program for any field. I have written below query but I am getting sy-subrc = 4 and getting no data.
    SELECT * FROM mara INTO TABLE it_mara
          WHERE volum IS NULL .
    Can anyone resolve this.

    Hi PKB,
    Check the below thread for NULL and Space value in ABAP . It will help you
    NULL and Space value in ABAP
    Regards,
    Pawan

  • Use of wildcard * in SELECT statement

    I have read that the use of the wildcard * in a SELECT statement cannot be utilized when using the INSERT INTO or other queries where data column/field alignment is critical. I have noted that the INSERT INTO column/fields must be in the same order
    as the SELECT statement (as there is no alignment to column/field names). Can someone please provide me with the information or article that covered this scenario?

    It is consider a good practice to specify columns name, however , SQL Server is smart enough to insert the data without too , but only if the table does not have an IDENTITY property
    CREATE TABLE #t (c1 int, c2 char(1),c3 real, c4 bit)
    CREATE TABLE #t1 (c1 int, c2 char(1),c3 real, c4 bit)
    ---Same thing with INSERT  like SELECT * you asked
    INSERT INTO #t1 VALUES (1,'A',2.5,0) 
    INSERT INTO #t1 VALUES (2,'B',3.5,1)
    INSERT INTO #t1 VALUES (3,'C',4.5,0)
    INSERT INTO #t SELECT * FROM #t1
    SELECT * FROM #t
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Using Variables in a select statement through a Database Adapter

    I was wondering how I reference a variable in a select statement through a Database Adapter.
    Ex.
    1. I have a global variable that stores an employee number
    2. I want to select an SSN # from a table based on an employee #
    variable.
    select ssn from emp where ssn = :input_variable - ????
    - how do i reference the variable - I am getting a 'missing IN or OUT parameter error?
    Any advice is much appreciated.
    ~Thanks

    I'm just wondering if anyone knows a work around so that I might be able to store a Table's FIELD name in a variable or an array[] so that I can do a query based on the decision of a loop without having to code 10 IF/ELSE statements.For instance, although the above code will not work, this code, although quite lengthy, does:
    If DataGrid1.SelStartCol = 0 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES__PUR_DT"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 1 Then
    Adodc1.RecordSource = "Select * from tblReservation order by VENDOR"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 2 Then
    Adodc1.RecordSource = "Select * from tblReservation order by VEN_LOC"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 3 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_TYPE"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 4 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_FROM_DT"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 5 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_TO_DT"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 6 Then
    Adodc1.RecordSource = "Select * from tblReservation order by MISC_ADJ"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 7 Then
    Adodc1.RecordSource = "Select * from tblReservation order by STATE_TAX"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 8 Then
    Adodc1.RecordSource = "Select * from tblReservation order by LOC_CHARGE"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 9 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_ID"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 10 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_OP"
    Adodc1.Refresh
    End If
    Do you see where i'm going with this?
    I simple want to use a variable in the "select * from <Table> Order by <Field>"

  • Problem - Creating a Dynamic LOV using duplicate value in select statement

    I am trying to create a Dynamic LOV by attempting to follow a pattern similar to the following:
    select shop_name d, shop_id r
    from shops
    order by 1
    However, I want to use the shop_name twice as in the following because I do not have any other unique identifier available such as a shop_id to associate with the shop name:
    select shop_name d, shop_name r
    from shops
    order by 1
    But I get an error where I am not allowed to duplicate the shop_name in the select statement. I read somewhere on this forum where it can be done but I can't find exactly how.
    Can someone tell or show me how to accomplish this?
    Thanks in anticipation for your answer.
    Thanks,
    Ric

    Ric,
    I just tried to do this on APEX 3.0, and it worked just fine with this SQL:
    select ename d, ename r from emp order by 1Perhaps you could put an example on apex.oracle.com or specify the error message that you're getting.
    So as long as you have uniquely aliased both columns, this should not present a problem.
    Thanks,
    - Scott -

  • Using Nested Table in Select Statement

    Hi all ,
    Can i use the PL/SQL nested table or Varray
    in the select statement as a normal table joined with other database tables.
    i.e.
    I have a nested table NT_1 in PL/SQL proc
    i have to use this NT_1 in the select statement as
    select xxx from
    tab_1,
    tab_2,
    NT_1
    where
    < some conditional joins >.
    Please help me in this regard.
    regds
    Dhananjaya.H

    you can not use a varray as part of a SQL Statement in order to build joins.
    Can you explain better what do you want to do ?
    Joel P�rez

  • [php+mysql] how to use variables in a select statement?

    Hi all,
    I'm searching for a way to use a variable in the select
    statement of mysql
    query.
    I have this variable that can contain:
    $var=field_1 field_2 field5
    or
    $var=field3 field4 field8
    so, the variable content is not always the same.
    I would like to filter a table selecting only the columns
    specified by the
    current $var content.
    Is this possible to do something like this?
    $var=field1 field5 field10
    SELECT string_to_array($var)
    FROM mytable
    ORDER BY mysortfield ASC
    Or, is there another way to select columns dynamically?
    Thanks for any suggestion.
    tony

    Hi all,
    I'm searching for a way to use a variable in the select
    statement of mysql
    query.
    I have this variable that can contain:
    $var=field_1 field_2 field5
    or
    $var=field3 field4 field8
    so, the variable content is not always the same.
    I would like to filter a table selecting only the columns
    specified by the
    current $var content.
    Is this possible to do something like this?
    $var=field1 field5 field10
    SELECT string_to_array($var)
    FROM mytable
    ORDER BY mysortfield ASC
    Or, is there another way to select columns dynamically?
    Thanks for any suggestion.
    tony

  • Can we write function in select statement?

    i have function and it has Out parameter,so in this case can i write select statement for my function to retrieve the value?

    Or, you could use pipelined function - i guess.
    Like ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>create or replace type a_obj as object
      2    (
      3       e_nm  varchar2(30),
      4       e_sal number(7,2)
      5    )
      6  /
    Type created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>create or replace type a_rec as table of a_obj;
      2  /
    Type created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>create or replace function multi_return(e_cd in number)
      2  return a_rec
      3  pipelined
      4  is
      5    cursor c1
      6    is
      7      select a_obj(ename, sal) as a_det_rec
      8      from emp
      9      where empno = e_cd;
    10     
    11      r1 c1%rowtype;
    12  begin
    13    for r1 in c1
    14    loop
    15      pipe row(r1.a_det_rec);
    16    end loop;
    17  
    18    return ;
    19  end;
    20  /
    Function created.
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>select * from table(cast(multi_return(&e_no) as a_rec));
    Enter value for e_no: 7369
    old   1: select * from table(cast(multi_return(&e_no) as a_rec))
    new   1: select * from table(cast(multi_return(7369) as a_rec))
    no rows selected
    Elapsed: 00:00:00.02
    satyaki>
    satyaki>
    satyaki>select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7521 WARD       SALESMAN        7698 22-FEB-81     226.88        500         30 SALESMAN
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1815       1400         30 SALESMAN
          7788 SCOTT      ANALYST         7566 19-APR-87     598.95                    20 ANALYST
          7839 KING       PRESIDENT            17-NOV-81       7260                    10 PRESIDENT
          7844 TURNER     SALESMAN        7698 08-SEP-81       2178          0         30 SALESMAN
          7876 ADAMS      CLERK           7788 23-MAY-87     159.72                    20 CLERK
          7900 JAMES      CLERK           7698 03-DEC-81     1379.4                    30 CLERK
          7902 FORD       ANALYST         7566 03-DEC-81    5270.76                    20 ANALYST
          7934 MILLER     CLERK           7782 23-JAN-82     1887.6                    10 CLERK
          7566 Smith      Manager         7839 23-JAN-82       1848          0         10 Manager   23-JAN-89
          7698 Glen       Manager         7839 23-JAN-82       1848          0         10 Manager   23-JAN-89
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7599 BILLY      ANALYST         7566 10-JUN-09       4500                    30
    12 rows selected.
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>select * from table(cast(multi_return(&e_no) as a_rec));
    Enter value for e_no: 7698
    old   1: select * from table(cast(multi_return(&e_no) as a_rec))
    new   1: select * from table(cast(multi_return(7698) as a_rec))
    E_NM                                E_SAL
    Glen                                 1848
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>/
    Enter value for e_no: 7599
    old   1: select * from table(cast(multi_return(&e_no) as a_rec))
    new   1: select * from table(cast(multi_return(7599) as a_rec))
    E_NM                                E_SAL
    BILLY                                4500
    Elapsed: 00:00:00.00
    satyaki>Regards.
    Satyaki De.

  • What is the change occured by using the package in select statement

    Hi all,
    Can some one please tell me using the following package in the select statement of the view does it restricts the data or fetches the data
    what is the change occurred using the package for fetching the date column
    hr_discoverer.check_end_date (per_assignments_f.effective_end_date)
    Thanks in advance

    You can check the code -
    -- this function checks to see if a date is equivalent to the end of time(31-Dec-4712)
    -- if this is true it will return null else the actual end-date
    Cheers,
    Vignesh

  • Using Multiple Parameters in Select Statement

    My goal is to be able to use more than one parameter for the select statement.  When I use OR instead of AND it works but with only one parameter. I thought using AND would return any parameter that is listed in the  ?Report Based On}. Any ideas why this will not work?
    I've created four parameters:
    Report Based on (string)  Allow Multiple Values (Default Values: Customer, Part Id, and Serial Number)
    RMA info by Customer  (string)
    RMA Info by Part Id  (string)
    RMA Info by SN  (string)
    This is my select statement
    (if {?Report Based On} = "Customer" then
        {RMA_Information.Customer}LIKE{?RMA info by Customer})
    and
    (if {?Report Based On} = "Part Id" then
    {RMA_Information.Part Id}LIKE{?RMA Info by Part Id})
    and
    (if {?Report Based On} = "Serial Number" then
      {RMA_Information.Serial Number}={?RMA Info by SN })
    tx Shirley

    Try this...
    IF "Customer" IN {?Report Based On} AND
         "Part Id" IN {?Report Based On} AND
         "Serial Number" IN {?Report Based On}
    THEN {RMA_Information.Customer}LIKE{?RMA info by Customer} AND
         {RMA_Information.Part Id}LIKE{?RMA Info by Part Id} AND
         {RMA_Information.Serial Number}={?RMA Info by SN}
    ELSE
    IF "Customer" IN {?Report Based On} AND
         "Part Id" IN {?Report Based On}
    THEN {RMA_Information.Customer}LIKE{?RMA info by Customer} AND
         {RMA_Information.Part Id}LIKE{?RMA Info by Part Id}
    ELSE
    IF "Customer" IN {?Report Based On} AND
         "Serial Number" IN {?Report Based On}
    THEN {RMA_Information.Customer}LIKE{?RMA info by Customer} AND
         {RMA_Information.Serial Number}={?RMA Info by SN}
    ELSE
    IF "Part Id" IN {?Report Based On} AND
         "Serial Number" IN {?Report Based On}
    THEN {RMA_Information.Part Id}LIKE{?RMA Info by Part Id} AND
         {RMA_Information.Serial Number}={?RMA Info by SN}
    ELSE
    IF "Customer" IN {?Report Based On}
    THEN {RMA_Information.Customer}LIKE{?RMA info by Customer}
    ELSE
    IF "Part Id" IN {?Report Based On}
    THEN {RMA_Information.Part Id}LIKE{?RMA Info by Part Id}
    ELSE
    "Serial Number" IN {?Report Based On}
    THEN {RMA_Information.Serial Number}={?RMA Info by SN}
    HTH,
    Jason

Maybe you are looking for

  • ORA-22813: operand value exceeds system limits

    hi all, ORA-22813: operand value exceeds system limits the above error occurs while calling a function. in 10g its working fine. after moving it to 11g v r facing the error. Plz help

  • CL_GUI_ALV_TREE  Event CHECKBOX_CHANGE

    Dear Experts, i use a tree control using class cl_gui_alv_tree. All fields of my fieldcatalog are specified as fieldcat-checkbox = 'X' and fieldcat-edit = 'X'. i have a global class zcl...... where i implemeted a method as event_handler for class cl_

  • Accessing application module in a POJO for SOA architecural question

    Hi, I have an architectural question. We have an app in jdev 11.1.1.1.0 that has app modules and jsf pages. It works great. I am of the thought that biz logic should not be contained in managed beans but in a POJO which is more tied to the model part

  • TS3274 cant configure wifi

    I bought my mom a "New iPad" for mother's day and she can't connect to her household wifi right out of the box.  I thought perhaps it was ineptitude on her part so when I visited this weekend I tried myself. I turn it on, it asks me what language to

  • Offline approval not updating

    Hi Srm gurus, Please help! We have copied Prod to qas. We are currently testing email notification which includes approval via email. Problem: We have tried to approved via email, but the status is not updating. We have copied the whole Prod system t