OTL call for oracle function

Hi,
I created a Oracle function like get_employee_id() which will return the employee id if the name and department exists.
If not exists it will insert the record and return the emp_id.
get_employee_id(name,department)
if name and department exists id will be returned
else record will be inserted and emp id will be returned.
emp_id is a sequence which will be triggered to auto increment.
Problem is::
Not getting a correct way to access get_employee_id() from OTL interface.
I am trying like
query << "BEGIN :3<int> := get_employee_id(:1<char[128]>,:2<char[1024]>); END;" ;
otl_stream oos(1, query.str().c_str(), db());
oos << emp_name ;
oos << emp_dept ;
while(true){
oos >> emp_id ;
if(!oos) break ;
Please let me know what is the correct way of accessing this.Thanks for the help in advance.
Edited by: jagdish1206 on Nov 6, 2012 3:21 AM

Sorry. I posted this in wrong Forum.
Posted in "C++ Call Interface (OCCI) : forum".
Thanks,
Jagdish.

Similar Messages

  • Reference for writing COBOL prog with DB2 with ATMI calls for Oracle Tuxedo

    Hi..
    Am using IBM COBOL for AIX 2.0.0 on Oracle Tuxedo10g R3..
    And for database IBM DB2 Version 8.2..
    I have to write a program in Cobol with queries and with ATMI calls for Tuxedo..
    I need some reference manuals for this or some sample program..
    I also need the connectivity from cobol-DB2 to Tuxedo..
    Can anyone send me link for the same?
    The tutorial CSIMPAPP and STOCKAPP was really helpful..
    Am searching for the similar kind..
    Thanks in advance..
    Edited by: user8103349 on Mar 19, 2009 8:43 PM

    Hi,
    Hopefully someone has some DB2 COBOL code to share. But in any case, using Tuxedo with COBOL and DB2 should be very similar to simply writing normal DB2 COBOL programs. The major difference is that Tuxedo will take care of making the connection to the database and should normally be allowed to perform all transaction management.
    From a configuration standpoint you'll need to add the appropriate line in the Tuxedo RM file that lists how Tuxedo needs to link DB2 XA libraries into the application. The connection information is provided in the OPENINFO string passed along to the TMS that you need to build for DB2 with the buildtms command, and finally you'll need to build your servers with the -r switch to tell Tuxedo which XA libraries need to be linked into the application.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Calling an Oracle function of BOOLEAN return type

    I am facing a situation, where I have defined an overloaded function in one package (2 variants) which both return a type BOOLAN value under Oracle 9i R1.
    I am having trouble to setting up an CallableStatemnt to call one of this functions from Java. Whenever I set the parameter with a BIT or NUMBER data type, I get an exception with java.lang.boolean during my
    callablestatement.setobject( index, parameter, OracleTypes.BIT );
    or
    callablestatement.setobject( index, parameter, OracleTypes.NUMBER );
    I have no problem calling the function from SQLPlus, but doing so from Java raises the exception. I have found no exact match in OracleTypes or java.sql.Types for a BOOLEAN data type.
    In your response do you mean to modify the Function to return a NUMBER instead of a BOOLEAN, or do you mean to set the parameter as Types.NUMBER in the calling java code?
    Thanks,
    Fedro

    look at BOOLEAN type mapping using JPublisher
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96658.pdf

  • Calling an Oracle Function

    Hi,
    i'm trying to call a Function from a BPEL Process
    I have the following TYPE on the Oracle DB
    BALANCETYPE AS OBJECT
         "ACCT_EXT_ID" VARCHAR2(144),
         "TRANS_TYPE" VARCHAR2(240),
         "TRANS_REFERENCE" VARCHAR2(180),
    "FROM_DATE" VARCHAR2(15),
         "TO_DATE" VARCHAR2(15),
         "STATEMENT_DATE" VARCHAR2(15),
         "PAYMENT_DUE_DATE" VARCHAR2(15),
         "DEBIT_AMOUNT" NUMBER(18,4),
         "CREDIT_AMOUNT" NUMBER(18,4),
         "AMOUNT" NUMBER(18,4),
         "BALANCE_AMOUNT" NUMBER(18,4),
         "ORIG_TRANS_REF" VARCHAR2(180),
         "PAYMENT_TRACKING_ID" NUMBER(10,0)
    I have a convertion function
    create or replace FUNCTION fnc_convertBalance (cbalance SYS_REFCURSOR,collname VARCHAR2,objname VARCHAR2) RETURN BALANCE
    AS
         LANGUAGE JAVA
         NAME 'ResultSetConverter.convert(java.sql.ResultSet, java.lang.String, java.lang.String) return java.sql.Array';
    And i have a my own function that calls the original SP
    FUNCTION bpm_art_rpt_account_balance(v_nif IN VARCHAR2,
    v_phone IN VARCHAR2,
    v_acct_ext_id IN VARCHAR2,
    v_acct_no IN NUMERIC,
    v_invoice_ref IN VARCHAR2)
    RETURN BALANCE
    IS
         cursor_billing SYS_REFCURSOR;
         balanceobjct BALANCE := NULL;
    BEGIN
         art_rpt_account_balance(v_nif,v_phone,v_acct_ext_id,v_acct_no,v_invoice_ref,cursor_billing);
         balanceobjct := fnc_convertBalance(cursor_billing, 'BALANCE','BALANCETYPE');
    return balanceobjct;
    END bpm_art_rpt_account_balance;
    When i call this function from the Oracle DB with a DB GUI everything works fine, but when i call it from a BPEL Process i get the following error
    ORA-00932: inconsistent datatypes: expected OUT Conversion failed&#0; got ORA-06512: at "ARBOR.FNC_CONVERTBALANCE", line 0 ORA-06512: at "ARBOR.BPM_ART_RPT_ACCOUNT_BALANCE", line 12 ORA-06512: at line 1
    Any ideas ?
    Thanks

    Note that ResultSetConverter.convert(java.sql.ResultSet, java.lang.String, java.lang.String) returns a java.sql.Array. I don't know what BALANCE is (you left out its definition), but it appears to be a single object (i.e. a java.sql.Struct), which is wrong. The purpose of the ResultSetConverter API is to convert a Ref Cursor into something the adapter can handle (i.e. a java.sql.Array), which you may then use to process the array elements.

  • Call a Oracle function in a JSP

    Hello sir,
    Is there a way to call a function written in Oracle to be called in a JSP?
    Krish Reddy

    try your luck at here...
    http://www.dbforums.com/showthread.php?t=653256

  • Entry level pre requisites for oracle functional consultant

    Hi
    I have done by B.E(Computer Science ) with M.B.A
    (marketing&systems).
    Currently I am working for a distribution division that deals with
    HP PRODUCTS in a leading IT firm in DUBAI as a marketing executive
    I would like to climb up the corporate ladder into segments like
    business intelligence, Management information systems or designing a
    business structure etc that require expertise in terms of both technical and management like that of a functional consultant
    what are the pre requisites or certifications that should be taken
    to direct my career towards these fields .
    Kindly advise since I would like to direct my career in the right field
    thanks

    Hi, I need to choose a product to monitor server accesses and also database accesses, but to monitor our databases I should start audit on them (so I need to stop and start our database) and collect many transactions just to let that tool to read the DBA_AUDIT_TRAIL table, get those informations over the net, insert them into the tool's database (another Oracle database) and then delete them from our databases... !!!
    I've read this thread and also this one ( Oracle Audit Vault vs Third Party Tools )
    It seems that with Audit Vault I need to enable audit on all our databases and then it will collect audit informations from a central machine, is it right ? Is there no way to collect those informations, reading them from archivelog or in another way ? How much does audit impact over performances on a OLTP database ?
    Instead Database Vault seems to provide ONLY :) strong access control, but it seems it doesn't use AUDIT table... is this right ?
    What are pros and cons comparing these products ?

  • ADF test appmodule generates illegal java method call for Oracle binds

    I'm on the latest (likely) release of JDeveloper 10.1.3.
    ADF Business Components     10.1.3.36.73
    Java™ Platform     1.5.0_06
    Oracle IDE     10.1.3.36.73
    Struts Modeler Version     10.1.3.36.73
    UML Modelers Version     10.1.3.37.32
    Versioning Support     10.1.3.36.73
    Using ADF wizards, I've created a readonly view and modified the sql with a named bind variable.
    The sql is
    SELECT RaDocumentation.RA_DOC_ID,
    RaDocumentation.RA_DOC,
    RaDocumentation.MIME_TYPE
    ,dbms_lob.getlength(RaDocumentation.RA_DOC) bloblength
    FROM RA_DOCUMENTATION RaDocumentation
    where ra_doc_id = :blobKey
    Then I defined blobKey in the bind variables section to be type integer with default value of 0. When I run TEST on the appmodule, which only has this view defined in it, a prompt screen appears to ask for a new value for blobKey. When I press enter, an error screen appears saying
    Business Component Browser - java.lang.NoSuchMethodError
    oracle.jdbc.OraclePreparedStatement.setObjectAtName(Ljava/lang/String;Ljava/lang/Object;)V
    This JDeveloper application is generated "out-of-the-box", in that I did not change any defaults, etc from that which comes defaulted in standard JDeveloper 10.1.3. I did apply the most recent JDeveloper patches from Oracle's download site.
    Any suggestions as to the problem?

    I appreciate your help, but the problem is not yet solved.
    Below is the JDev log generated upon execution of the Browser. I do not see anything unusual.
    The log is the execution of JDev 10.1.3 after what I think is complete removal of all incarnations of anything relating to JDeveloper. All versions of JDev were deleted, all jdevhome directories. I found a OpenBaseJDBC.jar in the java extensions subdirectory and removed it.
    I then downloaded again the production JDev 10.1.3, executed it (it created its jdevhome directory in my home directory), and I updated with the required patch only (patch 5?), and restarted. Created application with a readonly view using a bind variable. Same error appeared. I did not find any suspect .jar files in the java directory.
    ----- JDev log output --
    /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -classpath /Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/jlib/bc4jtester.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/jdev-cm.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/lib/xmlparserv2.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/help4.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/share.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/jewt4.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/oracle_ice.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/ojmisc.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/sunrsasign.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar:/MyDeveloper/JDeveloperApplications/Model/classes:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/lib/adfshare.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/lib/bc4jmt.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/lib/collections.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/lib/bc4jct.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/commons-el.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/jsp-el-api.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jlib/oracle-el.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/lib/adfm.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/jlib/adfui.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/lib/adfbinding.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jdbc/lib/ojdbc14dms.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jdbc/lib/orai18n.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/jdbc/lib/ocrs12.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/diagnostics/lib/ojdl.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/lib/dms.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/lib/bc4jdomorcl.jar:/Applications/JDeveloper.app/Contents/Resources/jdev/BC4J/jlib/bc4jdatum.jar: oracle.jbo.jbotester.MainFrame -X 10E38CE209A -H jar:file:/Applications/JDeveloper.app/Contents/Resources/jdev/jdev/doc/studio_doc/ohj/bc4j_f1.jar!/bc4j_f1.hs
    2006-10-11 14:16:44.546 java[717] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x13703, name = 'java.ServiceProvider'
    See /usr/include/servers/bootstrap_defs.h for the error codes.
    2006-10-11 14:16:44.547 java[717] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)
    BC4J Tester exit code(0)
    -- JDev log output end --

  • Oracle Function call from JDBC Adapter

    Hi,
      Is it possible to call Custom Oracle Function from JDBC Adapter? 
    I know we can call stored procedure but I need to call Oracle function. Please explain how?
    Regards,
    Shweta.

    You'll need to provide a column alias for the function call:
    select func(val) as alias from dual

  • Calling Oracle Function in PHP

    Hi,
    I'm calling a oracle function in php, the function has 1 IN parameter and 1 OUT parameter. The OUT parameter is BOOLEAN type.How to bind php variable for BOOLEAN type?
    Thanks.
    srinath.

    I think you're going to have to use it as a string and use string comparison.
    ~Jer

  • Problem calling Oracle function from Access 2007 / ADO

    Hopefully, I'm posting this in the correct forum. I'm also posting on an Access forum as I'm not entirely sure where the issue lies.
    I'm calling an Oracle function from Access 2007 using an ADO Command object.
    The function takes three input parameters and has a return value and an output parameter. The output parameter is a BLOB, and the return value is varchar2 (either "T" or "N") based on the outcome of the function.
    If I pass correct values to the function, I get the following error message (errs out on the command.execute line):
    Run-time error '-2147467259 (80004005)':
    [Oracle][ODBC][Ora]ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 1
    Here's the function:
    FUNCTION GET_ITEMREV_ATTACH(P_ORGANIZATION_ID IN NUMBER,
    P_INVENTORY_ITEM_ID IN NUMBER,
    P_REVISION IN VARCHAR2,
    X_DRAWING OUT BLOB) RETURN VARCHAR2 IS
    RESULT VARCHAR2(1);
    BEGIN
    RESULT := 'T';
    BEGIN
    SELECT L.FILE_DATA
    INTO X_DRAWING
    FROM FND_ATTACHED_DOCUMENTS AD,
    MTL_ITEM_REVISIONS_B IR,
    FND_DOCUMENTS_TL D,
    FND_LOBS L
    WHERE AD.ENTITY_NAME = 'MTL_ITEM_REVISIONS' AND
    AD.PK1_VALUE = IR.ORGANIZATION_ID AND
    AD.PK2_VALUE = IR.INVENTORY_ITEM_ID AND
    AD.PK3_VALUE = IR.REVISION_ID AND
    AD.CATEGORY_ID = 1001216 AND
    D.DOCUMENT_ID = AD.DOCUMENT_ID AND
    D.LANGUAGE = 'US' AND
    L.FILE_ID = D.MEDIA_ID AND
    IR.ORGANIZATION_ID = P_ORGANIZATION_ID AND
    IR.INVENTORY_ITEM_ID = P_INVENTORY_ITEM_ID AND
    IR.REVISION = P_REVISION;
    EXCEPTION
    WHEN OTHERS THEN
    RESULT := 'N';
    END;
    RETURN(RESULT);
    END GET_ITEMREV_ATTACH;
    Here's the VB code I'm using to call the function:
    Private Sub Command8_Click()
    Dim CMD As New ADODB.Command
    Dim conn As ADODB.Connection
    Dim Param1 As ADODB.Parameter
    Dim Param2 As ADODB.Parameter
    Dim Param3 As ADODB.Parameter
    Dim ParamBlob As ADODB.Parameter
    Dim ParamReturn As ADODB.Parameter
    Set conn = New ADODB.Connection
    With conn
    .ConnectionString = "Driver={Oracle in OraHome92};Dbq=OAPLY;UID=***;PWD=*******"
    .CursorLocation = adUseClient
    .Open
    End With
    Set CMD = New ADODB.Command
    Set CMD.ActiveConnection = conn
    CMD.CommandText = "immi_attach_pub.get_itemrev_attach"
    CMD.CommandType = adCmdStoredProc
    Set ParamReturn = CMD.CreateParameter("RESULT", adVarChar, adParamReturnValue, 1)
    CMD.Parameters.Append ParamReturn
    Set Param1 = CMD.CreateParameter("P_ORGANIZATION_ID", adInteger, adParamInput, 1, 6)
    CMD.Parameters.Append Param1
    Set Param2 = CMD.CreateParameter("P_INVENTORY_ITEM_ID", adInteger, adParamInput, 4, 5207)
    CMD.Parameters.Append Param2
    Set Param3 = CMD.CreateParameter("P_REVISION", adVarChar, adParamInput, 2, "04")
    CMD.Parameters.Append Param3
    Set ParamBlob = CMD.CreateParameter("X_DRAWING", adLongVarBinary, adParamOutput, 200000)
    CMD.Parameters.Append ParamBlob
    CMD.Execute , , adExecuteNoRecords *** this is where the error occurs
    conn.Close
    MsgBox CMD.Parameters("RESULT")
    End Sub
    I've tried using different data types for the varchar2 parameters (adVarChar, adBSTR, adChar) with no difference.
    If I pass a bogus value for Param3...."'04'"...the function returns "N" indicating that it actually executed something. But, when I pass the correct value "04", it returns the above mentioned error.
    I can execute the function in PL/SQL just fine, so I'm thinking there's something wrong with the parameters, datatype, or other definitions on the Access side.
    Does anyone have any thoughts? I'm at a dead end with this. Sorry for the long post. Thank you.

    I tried your code with 11107 ODBC/client/database (but with a NULL output blob for convenience sake) and got no errors.
    If you're using 92 ODBC/client, you may want to try upgrading to something more current, or at least getting the latest patch(9208) to see if that helps. Since it works for me I'm guessing it may be a resolved bug in that version.
    Hope it helps,
    Greg

  • Calling ORACLE Functions from within CF Builder report

    Hi, I have an ORACLE function that I would like to call from within my CF REPORT.
    I know there is a section in the report builder where you can write coldfusion code to perform tasks, but I would rather simply call the ORACLE function for each detail row in the report
    I do not want to call this function from within my main ORACLE query that I use for the report, so please don't suggest that.
    Thanks so much.
    -Jim

    6.0.5 is not certified against 10g database, so I suggest to upgrade to 6.0.8.26 (6i patch 17) first to see if the problem is gone.

  • Hibernate: Oracle function call

    Hi,
    I want to call a oracle function through Hibernate.
    Can you please tell me steps how i can achieve the same.
    What ever i have read, i am mentioning below. Please let me if i am wrong
    1. Create a class TestFunction.java having getter setter methods
    2. Create TestFunction.hbm.xml which will be having following code
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"     "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>   
    <sql-query name="callFunction" callable="true">     
    <return class="TestFunction">               
    </return>     
    { call TestFunctionSQL(?,   :Name, :Age) } 
    </sql-query>
    </hibernate-mapping>I just copy pasted the code from some website and modified as per my need. Please let me know if anything is wrong above.
    3. I need to put the entry of TestFunction.hbm.xml in hibernate-cfg.xml
    4. I need to put the code in java to call teh stored proc. I dont have any idea how to do that.
    Please help
    ~Aman

    Before beginning : sorry if my answer isn't relevant but you asked no clear question
    I don't know a lot about it, even if all looks fine to me...
    the way to call a named query in hibernate is:
    List l =session.getNamedQuery("callFunction")
        .setString("param1", param1)
        .setString("param2, param2)
        .setMaxResults(50)
        .list(); // named parameters are betterSEE: http://www.hibernate.org/hib_docs/v3/reference/en/html/querysql.html
    specially $16.2 and $16.2.2
    //extract
    For Oracle the following rules apply:
    * A function must return a result set. The first parameter of a procedure must be an OUT that returns a result set. This is done by using a SYS_REFCURSOR type in Oracle 9 or 10. In Oracle you need to define a REF CURSOR type, see Oracle literature.

  • Call Oracle function using PI

    Can we call a Oracle function using PI? If yes then what should be the structure i.e. shoule that be built like a select ? or SQL_DML or ? Stored Procudure ?
    Sample structure with example will help

    Sure, is possible. You can use an JDBC Adapter (receiver or sender type).
    Take a look here:
    JDBC ADAPTER
    http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/content.htm
    JDBC RECEIVER
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    JDBC MESSAGE FORMAT
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    The option to use is an your chose, in according to your requirement.
    Usually, I use a StoredProcedure, except for very simple requirements.

  • RoR Calling Oracle Function/Procedure

    Hello,
    Has anyone got experience of calling an Oracle Function or Procedure from RoR?
    thanks
    David

    Hello for calling function/procedure at RoR in Oracle I write muself classes and use they.
    Module:
    module SQLStatement
    class NoTypeResult < StandardError
    end # class
    class SQLProc
    attr_accessor :name, :arguments
    def initialize( args = nil )
    @name = args[:name] unless args[:name].nil?
    @arguments = args[:arguments] unless args[:arguments].nil?
    @conn = ActiveRecord::Base.connection.raw_connection
    end # def initialize
    def exec( args = nil )
    unless args.nil? || ( !args.is_a? Hash )
    args.each { |k, v| @arguments[k.to_s.intern] = args[k] }
    end # unless
    func_args = ''
    @arguments.each { |k, v| func_args += "#{func_args == '' ? '' : ', '}#{k.to_s} => :#{k.to_s}"}
    sql = "BEGIN {#@name}( #{func_args} );END;"
    cursor = @conn.parse( sql )
    @arguments.each do |k, v|
    cursor.bind_param( ":#{k.to_s}", v )
    end # each
    cursor.exec()
    end # def exec
    end # class SQLProc
    class SQLFunc < SQLProc
    attr_reader :result
    attr_accessor :result_type
    def initialize( args = nil )
    @result_type = args[:result_type] unless args[:result_type].nil?
    super( args )
    end # def
    def exec( args = nil )
    if @result_type.nil?
    raise NoTypeResult, 'No type for result setting', caller
    end # if
    unless args.nil? || ( !args.is_a? Hash )
    args.each { |k, v| @arguments[k.to_s.intern] = args[k] }
    end # unless
    func_args = ''
    @arguments.each { |k, v| func_args += "#{func_args == '' ? '' : ', '}#{k.to_s} => :#{k.to_s}"}
    sql = "BEGIN :result := #{@name}( #{func_args} );END;"
    cursor = @conn.parse( sql )
    @arguments.each do |k, v|
    cursor.bind_param( ":#{k.to_s}", v )
    end # each
    cursor.bind_param( ":result", nil, @result_type )
    cursor.exec()
    @result = cursor[':result']
    cursor
    end # def exec
    end # class
    end # module SQLStatment
    Example of use:
    function = SQLStatement::SQLFunc.new(
    :name => 'f_test_ins',
    :result_type => Fixnum,
    :arguments => {
    :login =>'asdf',
    :password => 'asdf',
    :email => '[email protected]'
    function.exec
    raise function.result.inspect

  • Call Oracle function from Stored Procedure

    Hi,
    I have function Which returning one number. I want to use that number in a procedure. How to call the Oracle Function from the Procedure
    Create procedure
    AS
    Begin
    Check number;
    Select Function1 into check from dual;
    It is giving error.
    Can anyone provide me example for this.
    Thanks in advance

    Put the Check Number; before begin
    SQL> create or replace procedure abc as
      2 begin
    3 val number;
      4  select abcd into val from dual;
      5  dbms_output.put_line(val);
      6  end;
      7  /
    Warning: Procedure created with compilation errors.
    Elapsed: 00:00:00.00
    SQL> show error
    Errors for PROCEDURE ABC:
    LINE/COL ERROR
    3/5      PLS-00103: Encountered the symbol "NUMBER" when expecting one of
             the following:
             := . ( @ % ;
             The symbol ":=" was substituted for "NUMBER" to continue.
    SQL> create or replace procedure abc as
      2 val number;
    3 begin
      4  select abcd into val from dual;
      5  dbms_output.put_line(val);
      6  end;
      7  /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec abc;
    100.22
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL>

Maybe you are looking for

  • ALERT: java/lang/ClassFormatError: Bad stack map.

    Hello friends. I need help. SOS. Where is wrong in this code? Problem is in comparision. Comenting this lines, all are ok.         if(time1==time2)             System.out.println("Equal");         else             System.out.println("Different");C�di

  • Can I run 2 versions of firefox? I need to run older version for one application

    My operating system is mac 10.6.8 and I need to be able to run firefox 3.6.19 for one application & the latest version of firefox for other applications. Can I have 2 versions of firefox on my computer and choose which one to run depending on my appl

  • Loading xml metadata into a clob column

    Hi, how can i load metadata for a custom report(OIM) into rep_xml_meta column (clob type) of rep table? can the metadata be taken in the form of simple text file?

  • Bug. Cropped fullscreen mode in Mac OS X

    I have saved my login and password for connection. Started app, connected to remote desktop, than I put it in native Mac OS X fullscreen mode. Quitted from app. After restarting it saved fullscreen mode when I double click on item. Than I receive thi

  • Can i open PAGES file on MS WORD 2003 (PC)?

    i type my documents on my iBook's PAGES and i wonder, would i be able to open all these docs on the conference room's PC laptop running windows XP (MS WORD 2003) without me carrying the iBook to work i plan to bring the file i saved with PAGES on a f