Calling database specific function

Hi all,
I need to use an oracle-specific function in a query but I can't find a corresponding example. The SQL to produce should look like this :
select column_1, column_2, ... from table_1 where bitand(column1, ?) > 0
'?' is an argument
I'm using Toplink 9.0.4.5
Any idea on how I can build an expression ? I know how to use a db specific function with 1 column as the argument, but I don't know how to do it with 2 args, one being a column and the other some runtime value.
Thanks
JCG

DataReadQuery query = new DataReadQuery();
SQLCall call = new SQLCall("select column_1, column_2, ... from table_1 where bitand(column1, #param1) > 0");
query.addArgument("param1");
Vector args = new Vector(1);
args.add(new Integer(1));
Object result = getSession().executeQuery(query, args);

Similar Messages

  • Calling database stored  function from Entity Object

    Hi,
    I want to call a database stored function from create() method of Entity Object.
    Database function returns some value.
    Can anybody suggest me some way to do it.

    You can try the following:
    make a String whit your function call, I dont know if this is the correct SQL syntax for a function, it should be for a stored procedure.
    String call = "begin; callyourfunction; end;"
    PreparedStatement ps = getDBTransaction().createPreparedStatement(call,0);
    ps.execute();
    ResultSet rs = ps.getResultSet();
    You can now read the data from the function from the rowset.
    Be sure to cleanup the PreparedStatement when your done whit it to avoid open database connections.
    ps.close();ps=null;

  • Read item from Java class and call to stored function/procedure of database

    Hi,
    I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
    I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
    question1: How can I read jsp pages items value to java class ?
    question2: How can I call to database stored function/procedure with that parameter?
    question3: How can I use return value of that stored function/procedure ?
    Please reply me .
    Thanks,
    zakir
    ===
    Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

    ---

  • Calling schema specific packe/function from PL/SQL

    From PL/SQL I am trying to call a package function in a specific schema (see below). When I try it gives me this error:
    Invalid function body condition: ORA-06550: line 3, column 15: PLS-00201: identifier 'SCHEMA1.SIS_EXPRESS' must be declared ORA-06550: line 3, column 1: PL/SQL: Statement ignored
    Am I missing something as I thought this was the correct syntax?
    DECLARE button_ok boolean := FALSE;
    BEGIN
    button_ok := my_schema.SIS_express.ok_to_add (:APP_USER,:P0_LOGIN_SCHOOL_YEAR,:P0_LOGIN_SCHOOL,:APP_ID,:APP_PAGE_ID);
    <<end_of_trigger>>
    return button_ok;
    END;

    An Apex workspace is associated with one or more schemas.
    An Apex application in that workspace needs to select one of these schemas as its parsing schema.
    This means that all application code (PL/SQL and SQL code you write in that Apex app) will be parsed (using the DBMS_SYS_SQL package) as the parsing schema.
    Note that the current and acual schema for the Apex database session will the anonymous schema account as configured for connectivity for that database access descriptor (DAD) on the Apache server. You do not connect (via Apex) as your parsing schema. You connect to an anonymous schema. It runs trusted Apex code (that executes with the Apex schema's privs). This code parses your Apex app code via the system package to be executed as your parsing schema.
    So you need to make sure that your parsing schema has the appropriate rights to execute the PL/SQL and SQL application code you put into your Apex application.
    Also be aware that if you use that DAD to directly execute your PL/SQL code in the database (procedures or functions), the call will be made from the anonymous database schema used by that Apache DAD connection - thus that schema will then need to have exec rights on your code.
    In the case of the Apex flow engine - public exec rights exist on it and thus that DAD session from Apache can logon as the anonymous schema and execute the Apex run-time to run an Apex application.

  • Result of the Explain SQL function database-specific ?

    Hello, gurus...
    I'm not able to find the "secondary index" information in ST05 + Explain.
    Is the Explain SQL function database-specific ?
    We're running SAP ECC 6.0 on a MSSQL database....
    Please advice.

    Is the Explain SQL function database-specific ?
    yes it is. It must be database specific because it shows what the database is doing.
    But also MSSQL shows you the index information.
    Check the Explain, and search for clustered index seek, behind you will something like
    tablename1, telling you that the first index was used. Primary index is tablename0.
    Siegfried

  • Remotely call a PHP function?

    My alliance in a game uses a tool to keep track of information. I am trying to make a program that allows me to simply copy information I want to submit to the system's clipboard and then push it to the "submit form" of the alliance's website.
    At any rate, I have the clipboard part working. The part that isn't working is pushing the update to the server. The page I want is called:
    spioparser.inc.php
    The class declared in that PHP file is "Probeparser"
    and the specific function in that file I want to call is "parseEntry($string,$flush=true)"
    Is it even possible to have my java program open a connection to the server and send information to this function (this function will automatically insert it into the database.)?
    The code I am using to try and connect to the server is this:
    URL Gala = new URL("http://" +
                        "<username>:<password>@" +
                        "mtuogame.lhosting.info/GalaxyTool/secret/spioparser.inc.php");
                   HttpURLConnection Connection =
                        (HttpURLConnection) Gala.openConnection();
                   Connection.setDoInput(true);
                   Connection.setDoOutput(true);
                   Connection.setRequestProperty( "Content-type",
                        "application/x-www-form-urlencoded" );
                   Connection.setRequestProperty( "Content-length",
                        Integer.toString(Input.length()));
                   DataInputStream tmp = new DataInputStream(Connection.getInputStream());
                   readInput(tmp); //reads all input until EOF
                   PrintWriter out = new PrintWriter(Connection.getOutputStream());
                   out.print(Input); //sends the report to server?Thanks.
    -Kingdud

    If you have things set up so that some HTTP request will call that function, then you can certainly call that HTTP request from Java code. As you already know.
    But generally you can't just reach out over the network and run arbitrary executable code on somebody else's computer. (Think for a minute what security implications that would have.) Java or not, the answer is the same.

  • Calling CVI DLL Function from Visual Studio

    HI all ,
    Iv'e created a DLL using CVI and i'm tring to call one of it's function from visual studio 6.0
    I'm getting a general error , is there a specific prototype that i need to set my functions in ordrer to call them ?!  
    Kobi Kalif
    Software Engineer

    You will need to distribute the CVI RTE along with your DLL, since anything you write in CVI is going to use the RTE.
    As far as calling the DLL functions, you can use the CVI defined macros
    <return type> DLLEXPORT DLLSTDCALL <function name> (<param1 type> <param1> ...) {
    to declare your functions in the DLL for access by a VS application.
    for example
    int DLLEXPORT DLLSTDCALL myfunction (int funparam1, double func param2) {
    There are options for identifying which functions to export from your DLL, I use "functions marked for export" but there are other choices available.  I also include a type library so when you type the name of a DLL funciton in VS6 you see a balloon popup with the function signature.  This is a check box in the target settings.  You have to create a ".fp" file (function panel file) to collect the function info for the library.
    From VB6 you can access the DLL a couple of ways, but I usually add the DLL as a reference.

  • Help needed in calling a javascript function from a jsp

    Hey guys,
    I need help.
    In my jsp I have a field called date. When i get date field from the database, it is a concatination of date and time field, so I wrote a small javascript function to strip just the date part from this date and time value.
    The javascript function is
    function formatDate(fieldName)
              var timer=fieldName;
              timer = timer.substring(5,7)+"/"+timer.substring(8,10)+"/"+timer.substring(0,4);
              return timer;
    Now I want to call this javascript function from the input tag in jsp where I am displaying the value of date. Check below
    This is one way I tried to do:
    <input size="13" name="startDate" maxLength="255" value=<script>formatDate("<%=startDate%>")</script> onChange="checkDate(this)">
    I even tried this:
    <input size="13" name="startDate" maxLength="255" value="'formatDate(<%=startDate%>)'" onChange="checkDate(this)">
    But it dosen't work
    Please help. I am struggling on this for days.
    Thanks,
    Ruby

    Hey all you developers out there , Pleaseeee help me with this one.

  • Calling an HTML function from PL/SQL stsement

    The pl/sql statement below is in attempt to raise an alert window whenever a new record is added to the database by an automatic page refresh.
    Pls help me edit the statement below to call a HTML function named attention()from within the pl/sql statement or better still review the stuff to achieve the objective.
    declare
    v_count number;
    attention varchar2(100);
    begin
    select count(move_id)
    into v_count
    from move
    where move_status = 'Approved';
    if v_count > :f100_move_count then
    attention();
    end if;
    end;
    Thanks gents
    Sirdeeq

    Sorry, the function is Javascript not HTML

  • Fatal error: Call to undefined function oci_connect()

    I get below error when I try to connect to oracle in PHP on SUSE 10. I orginally posted this question in PHP forum but I was advised to post it to Linux forum. so here is the error and other details.
    Fatal error: Call to undefined function oci_connect()
    I followed one of the documentation realed to this error and I get below error.
    /home/knaik # php -version
    PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2008 23:35:28)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    /home/knaik/oci8-1.3.5 # phpize
    Configuring for:
    PHP Api Version: 20041225
    Zend Module Api No: 20060613
    Zend Extension Api No: 220060519
    Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
    environment variable is set correctly and then rerun this script.
    I was looking into below link. But I could not find oci8.so file after the OCI build.
    http://www.orware.net/tips-and-how-tos/plesk/46-oracle-oci8-php-installation.html
    ===================================================
    ===> In reply to my request *"mgogala's"* reply was as below.
    Install autoconf using yast. Check whether the package is installed by using:
    $>rpm -qa autoconf
    autoconf-2.59-5
    BTW, this is not a Linux forum. There is one on OTN, I'm sure that Frits Hoogland will gladly help you out.
    ====>
    I am not able to find "autoconf" rpm for Suse 10.
    Below is the exact version details of the O/S.
    #*more SuSE-release*
    SUSE Linux Enterprise Server 10 (i586)
    VERSION = 10
    PATCHLEVEL = 2
    #*uname -a*
    Linux osdvglobalopsdv02 2.6.16.60-0.21-smp #1 SMP Tue May 6 12:41:02 UTC 2008 i686 i686 i386 GNU/Linux
    Please let me know, from where can I download this RPM?
    Thanks
    Shelly

    btw, this is the oracle enterprise linux forum, the forum specific for oracle's linux distro, there is a general linux forum here: Generic Linux

  • How to register database plsql function in obiee

    Hi,
    I've a database plsql function which accepts two date arguments - StartDate and EndDate and return Integer.
    I discoverer like we've Plsql function registration tool, where we import function and pass parameter values as arguments in report- how same can be done in Oracle BI Administration tool and BI Answers?
    I tried to create logical column as
    EVALUATE('YOUR_FUNCTION(%1, %2, %3, %4)' as varchar(20),@{p_1},@{p_2},@{p_3},@{p_4})
    it is giving syntax error.
    url: How to store OBIEE presentation level variable values in DB
    Please help. It is really urgent.
    Kind Regards.

    Hi,
    I created 2 session variables p_startym and p_endym of char datatype and called in function(name: RepInitDates). It looks like:
    EVALUATE('INIT_DATES_MONID(%1, %2)' AS INTEGER , VALUEOF(NQ_SESSION."p_startym"), VALUEOF(NQ_SESSION."p_endym")).
    Now I've presentation variables StartMonth and EndMonth in bi answers report, whose value i want to pass to p_startym and p_endym. What should be the syntax of Bi answers column? Please reply.
    Thanks

  • Calling a package function inside a sql

    Hi friends!!!
    First of all happy Christmas! And them please help! :)
    We have a query calling a package function:
    SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR ('0000000000000000');There is a primary key just with one column DW025H_NR and the problem is that is not accessing by INDEX UNIQUE SCAN,
    it's accessing by TABLE ACCESS FULL.
    May be the problem is that we are calling a procedure inside the query?
    I have been able to run that query accessing by primary key from my computer but a workmate hasn't!
    We both are connecting the same data base 10.2.0.4 and using Oracle SQL Developer!
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 5343K| 1406M| 15670 (7)| 00:02:43 |
    |* 1 | VIEW | DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
    |* 2 | FILTER | | | | | |
    | 3 | TABLE ACCESS FULL| DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
    Predicate Information (identified by operation id):
    1 - filter("DW025H_NR"="MPPCI"."ENCRIPTAPAN"('0000000000000000'))
    2 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
    SYS_AUDIT('OPS$SISINFO','DW025H','CMINFOGR001',3) ELSE NULL END IS
    NULL)
    The correct path would be:
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 276 | 3 (0)| 00:00:01 |
    |* 1 | FILTER | | | | | |
    | 2 | TABLE ACCESS BY INDEX ROWID| DW025H | 1 | 276 | 3 (0)| 00:00:01 |
    |* 3 | INDEX UNIQUE SCAN | PK_DW025H | 1 | | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
    SYS_AUDIT('OPS$SISINFO','DW025H ','CMINFOGR001',3) ELSE NULL END IS NULL)
    3 - access("DW025H_NR"="MPPCI"."ENCR"('0000000000000000'))
    Please any ideas!?!?!
    Thanks a lot!
    José
    Edited by: jamv on Dec 20, 2011 10:50 AM

    Hello
    Have a read of this and try to pull together the information in it and post it up here. That will help immensely with getting to the root of your problem...
    HOW TO: Post a SQL statement tuning request - template posting
    In the mean time:
    From the execution plan you have extra predicates that aren't present in the query you supplied, so that's either not the SQL or you have something like VPD switched on.
    Anyway, there could be lots of reasons for the difference in execution plan. Sorry if this is very basic and possibly patronising question but it's always worth checking the basics I think - are you both definitely connecting to the same database? If so, have a look in v$sqlarea for this SQL statement and find the SQL_ID, use this to query v$sql and look at the child_number column.
    select
        sql_id
    from
        v$sqlarea
    where
        sql_text like '%SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR%(''0000000000000000'')%'
    and
        sql_text not like '%v$sqlarea%'
    select child_number from v$sql where sql_id='<enter the sql id returned by the query above>'as an example...
    XXXX> select /* my sql statement*/ rownum id from dual;
            ID
             1
    1 row selected.
    Elapsed: 00:00:00.10
    XXXX> select sql_id from v$sqlarea where sql_text like '%my sql statement%'
    and sql_text not like '%v$sqlarea%';
    SQL_ID
    a6ss4v79udz6g
    1 row selected.
    Elapsed: 00:00:03.56
    XXXX> select child_number from v$sql where sql_id='a6ss4v79udz6g'
      2  /
    CHILD_NUMBER
               0
    1 row selected.   If you have more than one row in v$sql there could be differences in the optimiser environment. The supplied like shows you how to gather the information that should help find what the differences are if any.
    Also as a side note if you're calling PL/SQL functions from SQL, you can take advantage of subquery caching to help reduce the number of calls (depending on your version). As it stands, your function is most likely going to be called for every row - when there is only a single row returned, that's not necessarily a problem but for multiple rows, the overhead can quickly grow. If there's no way to get rid of the function call, select the function from dual instead i.e.
    SELECT * FROM DW025H WHERE DW025H_NR= (SELECT MPPCI.ENCR%('0000000000000000') FROM dual);This also (as I learnt a couple of weeks ago) works when you're using columns in the table your selecting from as parameters to the function.
    HTH
    David

  • Calling PL/SQL function from AM

    Dear All,
    I have created a java method at AM level which returns a value in a method defined in controller, can any one help me that how i can execute database function from AM ?.
    Regards,
    Haroon.

    Check my reply in this thread too.
    Re: Calling Database Procedures in OAF Page
    Thanks
    AJ

  • Calling a java function from xquery

    Hello,
    I'm pretty new to ODSI and xquery, so forgive me if what I'm asking is too trivial, but I need to find a way to call a java function from inside xquery. I know xquery can do this through external functions, but can't find any example on how the query prolog declaration should be, nor how the function should look like. Could someone enlighten me?
    Thanks,
    Pedro Ivo

    You can do this 2 ways that I know of (Mike probably has more ideas too)
    1. Register an inversion function:
    [How to use an inversion function|http://download.oracle.com/docs/cd/E13167_01/aldsp/docs32/dsp32wiki/Using%20Inverse%20Functions%20to%20Improve%20Query%20Performance.html]
    2. Create a physical data service based on a java function. I have used this approach for both custom JDBC database operations and straight Java processing, with pretty good results.
    Good luck,
    Jeff
    Edited by: jhoffmanme on Apr 14, 2010 9:57 AM

  • HR Offcycle Payroll(Customer Specific Function(

    Hi,
    I am working on SAP 4.7, i have developed an customer specific HR payroll function, its attached in the payroll schema, in the routine i have updated some HR infotypes. Now in normal payroll run it works fine but, in offcyle it has two buttons 'start payroll' which runs the schema, and 'save' which saves the changes, what i need is to save the changes when SAVE button is pressed not the START PAYROLL button, i have looked couldnt seem to find an exit at save.
    Thanks.
    Regards
    Khusro Habib

    During the Start Payroll process, when the schema calls my customer specific function. I filled an internal table PSOPER, then when the SAVE button is pressed system reads the data from this infotype to update it depending on the field OPERA of this internal table
    PSOPER-OPERA = 'U'. means update
    code:
    data gv_ocrsn type t52ocr-ocrsn.
    field-symbols <prelp> type c.
    "gs_s9000 structure of type P9000.
    get parameter id 'OCR' field gv_ocrsn. "This tells me if offcycle is being run
    if gv_ocrsn eq '0095' or gv_ocrsn eq '0090'.
    "all data is in gs_s9000.
    gs_s9000-infty = '9000'.
    assign gs_s9000 to <prelp> casting.
    MOVE <PRELP> TO PSOPER.
    PSOPER-opera  = 'U'.
    append psoper.
    unassign <PRELP>.
    clear gv_ocrsn.

Maybe you are looking for

  • Window s 8 consumer problem with hp laserjet p1005

    hello everyone today my second day with consumer preview  my printer was working will with developer preview but now i installed the software of hp full package and the printer where installed then i am trying to printing any page at give's me a side

  • Help needed in debugging the BADI: BBP_CREATE_REQ_BACk

    Hi, I  need help in debugging a BADI which causing an error ' SE142 please enter quantity in line 3000111'. This happens only when number items in the cart are more than four and only for Service category items for which we have this BADI, if the ite

  • EXIT_SAPLVEDA_001 : Delivery block at line item : Error - No LIFSP field

    Hello EDI Experts, I have a problem. I am trying to place a delivery block @ line item level. (VBEP-LIFSP) I am using the structure dxvbep. But it's giving me an error say the object zxvbep does not have any component "LIFSP" How should I place a del

  • Can anyone help before i throw iphone out the window.....

    My iphone wont slide open...ive tried to reboot it no avail..restored factory setting still wont open...also on front screen in square box is message saying waiting for activation may take some time...Anyone got any ideas...Thanks.

  • External SSD boot from cloned rMBP

    I have ordered refurbished 2.5 mac mini from Apple store. I have a cloned Samsung Evo 250 external 3.0 usb drive from my rmbp. Can I boot the mini from the cloned drive?