Parameter reuse in SQL statement

I'm trying to convert to ODP.NET (version 10.1.0.200) from the Microsoft OracleClient. With the ms client I was able to reuse parameters within the sql statement multiple time. It appears with ODP.NET I can only do this one time with one parameter - after that an ora-01008 is thrown.
For example:
cmd.commandText = "select count(*) from some_table where (dept_no = :deptNo or :deptNo is null) and (emp_no = :empNo or :empNo is null)"
Above would work in ms OracleClient but doesn't appear to in ODP.NET. I am correctly adding the parameters to the command - everything works fine until I add the second occurrence of the second parm...
Has anyone else run into this or found a fix?

Never Mind - The default behavior is cmd.BindByName = false. Once I set it to true everything was just wonderful.

Similar Messages

  • Parameter value in sql statement (Custom Folder)

    Hi ,
    I want to formulate a custom folder - consisting of a sql statement , inside of which there is a parameter. Then in Desktop , the users can select a number as the searching criteria and this value will replace the parameter in sql statement , as in the following:
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA from
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over (order by sum_posotita desc) rw  from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS))
      where rw<=&p
      order by SUM_POSOTITA desc The problem is that the use of parameter , whereas in sql*plus is valid, in Discoverer is not....
    What can i do in this situation...????
    Thanks , a lot
    Simon

    However , a peculiar event happens....
    whereas the sql statement is:
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA,RW from
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over (order by sum_posotita desc) rw  from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_FOREON_MS A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_KLIN A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS))
      order by RW ascand produces the results....
    CODE_FARMAKOU                            EMP_NAME                                                                         PACKTYPE                     PACKSIZE                  SUM_POSOTITA         RW
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                       45          1
    0000014071                               DOPAMINE HYDROCHLORIDE                                                           VIAL                         5 ML X 25                           30          2
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                        21          3
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              6          4
    0000002419                               FACTREL INJECTION                                                                VIAL                         2 ML                                 5          5
    0000086289                               DETUSSIN EXPECTORANT                                                             BOT                          120 ML                               3          6
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                         2          7
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              2          8
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        2          9
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1         10
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1         11
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        1         12
    12 rows selectedIn Discoverer , even i select to see -as parameter- let's say the 10 first records, the system displays the 7 first records , whereas when i want to see the 1,2,3,4,5,6,7 first records the system works fine....and displays accordingly 1,2,3,4,5,6,7 first records. The problem occurs above the 8th record-as parameter selected..!!!!!
    I defined the parameter as :Rw<=:Rw
    What may be the problem...????
    SORRY!!!!! I FOUND THE PROBLEM ....!!!!
    Regards and many thanks,
    Simon
    Message was edited by:
    sgalaxy

  • Parameter passing in sql statement

    hello..
    i want to execute a value insertion query in jdbc..where the values are all parameterized string variables.but it failed to execute the query...
    and generating a sql exception "too few parameter.."
    but it succesfully executes with a direct string like'hello'....
    heres my sample code for this...
    public void settablevalue(String pn,String pid,String time)
    try
    Statement s1=con.createStatement();
    System.out.println(pn+" "+pid+" "+time);
    char []pname=new char[50];
    char []prcsid=new char[50];
    char []timecrtn=new char[100];
    pname=pn.toCharArray();
    prcsid=pid.toCharArray();
    timecrtn=time.toCharArray();
    s1.execute("insert into ProcessEvent values(pname[],prcsid[],timecrtn[])");
    System.out.println("Executed");
    s1.close();
    catch (Exception err)
    System.out.println("ERROR: " + err);
    now do i insert string values in the table...
    pls help...thnx in advance

    You should use a PreparedStatement. Read the JavaDoc of PreparedStatement.
    Usually you prepare a statmenet like this: "insert into ProcessEvent values (?, ?, ?)" and then use setString(), setDate(), ... to set the concrete values.
    Additionally ('though this doesn't have to do anything with your problem): You don't need to create char-arrays, and even if you do, you don't have to initialize them (using "char[]pname=new char[50]") if you later assign a new value (using "pname=pn.toCharArray()").

  • Parameter Issue in Sql statement

    Hi experts
    I am writing a simple parameter query and somehow it is not working .
    Let me specify the condition
    Customer want to choose from three parameter --OINV table and INV1
    1.Customer code C
    2.Date between And B
    At running sequence :
    Customer can either put all the parameter values --A and B And C
    Or
    Customer will put A and B  but Not C
    Can you help me on this
    Thank you
    Bishal

    In case there are credits:
    SELECT t1.docdate, t1.docnum, t0.itemcode, t0.Dscription, t0.quantity, t0.linetotal, t2.cardname FROM dbo.inv1 t0
    inner join dbo.oinv t1 on t1.docnum = t0.docentry
    inner join dbo.ocrd t2 on t2.cardcode = t0.Basecard
    where t2.cardname like '[%2]%' and t2.cardtype = 'C' and t1.docdate >= '[%0]' and t1.docdate<= '[%1]'
    Union
    SELECT t1.docdate, t1.docnum, t0.itemcode, t0.Dscription, t0.quantity, t0.linetotal * -1, t2.cardname FROM dbo.rin1 t0
    inner join dbo.orin t1 on t1.docnum = t0.docentry
    inner join dbo.ocrd t2 on t2.cardcode = t0.Basecard
    where t2.cardname like '[%2]%' and t2.cardtype = 'C' and t1.docdate >= '[%0]' and t1.docdate<= '[%1]'

  • USING MULTIPLE SELECT VARIABLE IN A SQL STATEMENT

    In HTMLDB, the value of the parameter of a multiple select box is colon delimited(ie P6_Name = Smith:Jones:Burke). Is there an easy way to use this parameter in a SQL statement?
    Example
    Select *
    from names
    where
    Name=P6_Name
    Select *
    from names
    where
    Name IN ('Smith','Jones','Burke')
    Thank you

    Thank you for your response! I'm an idiot. It didn't make sense to me because your talking about a <i>multi-select</i> variable and I was thinking about a <i>select-list</i> variable. My problem is that I need to assign a list of values to one select list item.
    <br>
    For example:
    <br>
    SELECT * FROM EMPLOYEE
    WHERE EMPLOYEE_TYPE IN ( :SELECT_LIST_RETURN_VALUE );
    <br><br>
    With the select list as
    <br><br>
    Display value = All Types, Some Types, One Specific Type<br>
    Return Value = (Type1, type2, type3), (type1, type2), (type3)
    <br><br>
    I've just started in all of this so I'd imagine that I'm probably going about it wrong.

  • Precompiled SQL statement at client side ? (JDBC)

    Hi,
    Will Oracle support precompiled SQL statement for jdbc client ?
    Thanks

    A pre-compiled SQL statement on the client side makes absolutely no sense. Let's say the statement refers to system object id 1234 - the EMP table. But in the meantime the EMP table has been dropped and re-created as an index organised table and is now object id 7890.
    What about issues like scope, cost-based optimisation, etc?
    It honestly does not make the slightest sense to even want such a "pre-compiled client SQL" feature.
    > hmm.... Is there anyway to return the compiled SQL
    from database ?
    Yes - that is exactly what a cursor handle is. You give the database a SQL statement. It parses that and returns a SQL (aka cursor) handle for you to use and re-use.
    The typical (stateful) client would use the following template:
    -- open a database connection (usually returns a connection/session handle)
    hConnection = open DBconnection(params)
    -- parse/prepare a SQL statement (returns a SQL/cursor handle)
    hSQL = parseSQL( hConnection, 'INSERT INTO foo VALUES( :0, :1 )' )
    -- reuse the SQL statement
    while (Some_Condition)
    loop
    Some_Processing()
    -- bind values to the SQL statement variables
    SQLBind( hSQL, '0', var1)
    SQLBind( hSQL, '1', var2)
    -- execute the statement (it is not compiled or parsed again by the database)
    ExecSQL( hSQL )
    endloop

  • Execute Stored Procedure SQL Statement with Parameter from Cell

    I would like to know if there is a way to pass the parameters to SQL Statement of Power Query. For example, I have a SQL Statement as follows:
    EXEC [dbo].[spReportBuilder]
    @Report = N'Revenue Summary',
    @Year = N'2014',
    @Period = N'11'
    I would like to know if it is possible to pass the @Report, @Year, @Period values from cells in the workbook, preferably without vba.
    Thanks

    rtisserand, 
    Here is the M code: 
    let
    IDValue = Excel.CurrentWorkbook(){[Name="YearTable"]}[Content],
    Source = Sql.Database("localhost", "AdventureWorks2012", [Query="EXEC [dbo].[spReportBuilder] @Report = N'Revenue Summary', @Year = N'" & Number.ToText(IDValue[ID]{0}) & "', @Period = N'11'"])
    in
    Source
    Some notes:
    You have to reference the excel query from another step in the query or you will get the following error: 
    Formula.Firewall: Query <>something<> references other queries or steps and so may not directly access a data source. Please rebuild this data combination.
    I only did the parameter for one value.
    Hope this helps.
    Reeves
    Denver, CO

  • How do I Pass a parameter to a SQL Component Task where the source SQL statement is also a variable

    Hi,
    I have been tasked with making a complex package more generic.
    To achieve this I need to pass a parameter to a SQL Component Task where the source SQL statement is also a variable.
    So to help articulate my question further I have create a package and database as follows; -
    USE [KWPlay]
    GO
    /****** Object: Table [dbo].[tblTest] Script Date: 05/14/2014 17:08:02 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[tblTest](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [Description] [nvarchar](50) NULL,
    CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    I populated this table with a single record.
    I unit tested the SQL within SSMS as follows;
    SELECT * FROM dbo.tblTest
    Result; -
    ID           
    Description
    1             
    Happy
    DECLARE @myParam NVARCHAR(100)
    SET @myParam = 'Sad'
    UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    SELECT * FROM dbo.tblTest
    Result; -
    ID   
    Description
    1    
    Sad
    Within the package I created two variables as follows; -
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    Name: strStatus
    Scope: Package
    Data Type: String
    Value: Happy
    I then created a single ‘Execute SQL Task’ component within the control flow as follows; -
    However when I run the above package I get the following error; -
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = @myParam FR..." failed with the following error:
    "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. 
    The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the
    errors.
    SSIS package "Package.dtsx" finished: Failure.
    I also tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    However I received the error; - 
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = ? FROM dbo...." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with
    the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches
    the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    SSIS package "Package.dtsx" finished: Failure.
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    and; - 
    Result; - 
    SSIS package "Package.dtsx" starting.
    SSIS package "Package.dtsx" finished: Success.
    Therefore the answer was to put the parameter number rather than the parameter name under the parameter mapping tab-> parameter name column. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

  • Pass ORG_ID as sql statement for parameter in request set

    We are in a multi-org environment. We are running the request PRC: Generate Draft Revenue for a Single Project as part of the request set. We want the request to automatically fill in the open pa period as the accrue through date. We have been using the SQL Statement below as the value for the accrue through date parameter.
    select end_date
    from pa_periods_all
    where status = 'O'
    and current_pa_period_flag = 'Y'
    Unfortunately that does not limit to a specific company. We a company that still have DEC-05 while another has an open period of JAN-06. This is causing the program fits. How do I pass the org_id to the request? [in beginners terms please]
    Thanks.
    Anne

    No idea what might be wroong without more info...
    Do some output. Test the ${params.id} variable passed to the second jsp. If that is correct, then error is in the select statement or display of jsp2. If it is correct the error comes from jsp1.
    If I have to guess, then I would say the error comes from JSP1, and the ${row.vac_id} should only be called once. In which case I would do something like this:
    //in jsp 1
                <c:forEach var="row" items="${results.rows}"  varStatus="counter"  >
                    <c:set var="vac_id" value="${row.vac_id}" scope="page"/>
                    <tr>
                        <td>${vac_id}</td>
                        <td><a href="vacancydetails.jsp?id=${vac_id}">More</a></td>But that is a guess only...
    Errr... Hold on to that as reference, but the it is entirely likely that I misspelled ${params.id} It may be ${param.id} I forget and away from my machine right now...

  • Pass parameter to sql statement in query manager

    Hai to all,
               I want to pass the percentage  as the parameter into the sql statemnet.i what to execute it in the query manager.
              If i execute that statement then cann't found the tablename error is coming.
             Other than the data in the table (general data)  pass to the parameter in the sql at runtime.
    for example:
    select [%0] *100
    how to pass 10 to that sql statement.
    Please help me...
    Regards,
    Raji.

    Hi Ramya,
    You can create a SP with parameters to accept and then execut this SP from SAP Business One Query Manager by passing the parameter (in your case 10). The result will be as desired.
    Ex:
    Create this Procedure in SQL Management Studio
    create proc Test(@a as int)
    as
    begin
    select (@a*100)
    end
    To Execute the Query use this Query and pass the desired values with parameters
    execute Test 10
    Regards,
    Reno

  • Passing parameter into SQL statement in Crystal Reports

    Hi all,
    I would like to call Crystal Reports in JSP. I can handle it well now. But I hope to let user input their selection criteria before printing out the report. I know how to get the parameter value in JSP, but I really dunno how to pass these parameter values into the SQL statement in Crystal Report. Actually, is it possible to do so?
    If anyone has idea, please tell me. Thx Thx!
    Regards,
    Betty

    Dear Sir,
    I want to use Crystal Report as a web base using JSP. But, I am getting how to call .rpt file in .jsp file & passing of parameter.
    If you have any idea, please reply as early as possible
    Thanking U.
    My userid = [email protected]
    Regds
    Pankaj..

  • SQL Statement as Parameter for Stored Proc

    This works fine in SQL script, but doesn't work when converting the script to a sp.  It doesn't like how I've defined the @PeriodEndDate parameter.  How do I set the variable to the results of a SQL statement?
    CREATE PROCEDURE usp_ARAging 
    -- Add the parameters for the stored procedure here
    @FiscalYear int = 2014, 
    @FiscalPeriod int = 5,
    @PeriodEndDate date = (SELECT MAX(JEDate) FROM ERPSQL01.EpicorNamg905.Accounting.Dim_JEDate
    WHERE FiscalYear = @FiscalYear
    AND FiscalMonth = @FiscalPeriod)
    Kirk P.

    Let's start over.  The default value of a procedure argument is a "suggestion" - a value to be used when it is not provided by the caller.  So is your goal to allow the user to supply any date, not just the one that coincides with the
    fiscal year and period values?  IF not, then it should not be a parameter and the value should be determined by the code inside the stored procedure. 
    However, if your goal is to allow any value, then you must follow the rules for specifying an appropriate default and those rules are very restrictive.  You cannot use a query nor can you refer to other parameters.  The typical approach is to use
    a "marker" value which the caller uses to indicate that it wants to use the true "default" value which you would then determine inside your stored procedure.  Often a value of NULL is used; in your procedure the code checks this parameter
    for a null value and, if found, assigns it the value you used in your query above.
    And while we're at it, you should code defensively and check that the set of values supplied as parameters are consistent with each other and with the logic that depends on them.  For example, presumably the period argument should be between 1 and 12
    (and not null).  I suggest you reconsider the use of integers since the domain of these values FAR EXCEEDS that allowed for years and months for most business purposes.

  • Parameter not accessible in SQL statement

    Hello
    I am assigning value to 2 parameters on the form (PARAMETER node)
    :parameter.p1:=5;
    :parameter.p2:='AAA';
    p1 is of number type and p2 is of char type.
    now i want to query as follows
    select count(*) from AA_table where id=:parameter.p1 and name=:parameter.p2;
    this statement return count=0, which is wrong. actual count is 1.
    why param values are not taken in SQL statement, as i display values of parameters using message(), it shows the values properly.....
    plzzzzzz..... help.......

    parameter datatype by default is char. So I doubt though you assign 5 to p1 it considers as a character.
    Try below
    select count(*) from AA_table where id=to_number(:parameter.p1) and name=:parameter.p2;
    or change the data type to number for p1
    Rajesh Alex

  • Parameter containing part of an SQL statement... it could be cool !

    Hi,
    I know this is currently not allowed, but maybe, in the future...
    anyway, I often have the need to programmatically build an SQL statement. Sometimes there is a fixed part (SELECT... FROM...), and a variable part that changes in that statement (WHERE...)
    It could be very cool if I set a parameter that, instead of a value, can carry a part of an SQL statement.
    Example:
    SELECT * from foo where cod in
       (select ID from ringtones where brand in
          (select phone from world where country in ('JAPAN', 'NORWAY'))
       )I wish to have a statement like that:
    SELECT * from foo where cod in
       (select ID from ringtones where brand in
          (select phone from world where :condition)
       )...and set the :contition parameter with a string, that is:
    "country in ('JAPAN', 'NORWAY')"
    or anything else.
    What do you think about this?
    Regards

    anyway, I often have the need to programmatically
    build an SQL statement. Sometimes there is a fixed
    part (SELECT... FROM...), and a variable part that
    changes in that statement (WHERE...)Look for Dynamic SQL.

  • PASSING PARAMETER IN SQL STATEMENT .

    HI,
    Can any one tell me how to use on of the field name as a parameter in the same sql statement ? Here is what i am looking for :
    SELECT EMPNO, DEPTNO, (SELECT COUNT(ORDERNO) FROM ORDERS WHERE DEPTNO = :DEPTNO AND EMPNO = :EMPNO) TOTAL_ORDER FROM EMP;
    Here the embeded sql statment should take the paramter :DEPTNO , :EMPNO from the main sql statement. That means , each DEPTNO, EMPNO should be passed as a aparameter to the embeded SQL statement.
    Thanks
    Feroz

    WHATS THE CONACT, ||, +, HOW TO USE IT, CAN U GIVE ME AN EXAMPLE.
    SORRY , HERE IS THE ACTUAL THING WHAT I AM LOOKING FOR, I WANT TO GET THE MEDIAN AND MODE VALUE IN ORACLE, BUT COZ ORACLE DOES NOT HAVE IN BUILT FUNCTION TO ET THE ABOVE TOW , I WROTE MY SQL STATEMENTS, FOR EXAMPLE THE MEDIAN OF SAL FOR DEPT 20 IS IS
    SELECT AVG(SAL) FROM
    (SELECT RowNum The_Rownum, SAL FROM
    (SELECT SAL FROM EMP WHERE DEPTNO = 20 ORDER BY 1)) V
    WHERE V.The_Rownum = ( SELECT FLOOR((COUNT(SAL)+1)/2) FROM EMP WHERE DEPTNO = 20)
    OR V.the_rownum = (SELECT CEIL((count(SAL)/2) + 1/2) FROM EMP WHERE DEPTNO = 20)
    This median value ncalculation i can put in a functio and return it, but for a record os 1,800,000 volume, calling this function that many times, the sql never executes. It just hangs. so i thought if i can emabede the whole calculaton in the main sql statement instead of writing a function and calling that function in the sql statement. But the median calculation needs the department no as a parameter to calculate the median for that perticular department. Here , where the requirement of PARAMETER comes. ANY IDEA ???
    Thanks
    Feroz

Maybe you are looking for