Cannot execute stored function.

Hi Guys,
Please can someone tell me why a Package function when executed in SQL Developer returns the right value but, when called from VS 2008, it returns nothing. The function returns a VARCHAR2 and I can execute this procedure from SQL Developer without any problem. but when I call it from within my application, it returns nothing and no error is generated. Please what am I doing wrong?
FUNCTION VALIDATE_USERS( myUserName IN MHMS_USER.USERNAME%TYPE, myPassword IN MHMS_USER.PASSWORD%TYPE) RETURN VARCHAR2 AS
varUsername MHMS_USER.USERNAME%TYPE;
varPassword MHMS_USER.PASSWORD%TYPE;
varAccountStatus MHMS_USER.STATUS%TYPE;
varResult VARCHAR2(30);
BEGIN
SELECT MU.USERNAME, MU.PASSWORD, MU.STATUS
INTO varUsername, varPassword, varAccountStatus
FROM MHMS_USER MU
WHERE MU.USERNAME = myUsername;
IF varUsername = myUsername AND varPassword = myPassword AND varAccountStatus = 'LOCK' THEN
varResult := 'LOCK';
RETURN varResult;
ELSIF varUsername = myUsername AND varPassword = myPassword AND varAccountStatus = 'UNLOCK' THEN
varResult := 'VALID';
RETURN varResult;
ELSIF varUsername <> myUsername OR varPassword <> myPassword AND varAccountStatus = 'UNLOCK' THEN
varResult := 'INCORRECT LOGIN';
RETURN varResult;
END IF;
EXCEPTION WHEN NO_DATA_FOUND THEN
varResult := 'INVALID';
RETURN varResult;
END VALIDATE_USERS;
Dim iv As OracleParameter
Dim cmd As New OracleCommand("Validate_Users", cn)
Dim AccountStatus As String
cn.Open()
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New OracleParameter("varUsername", OracleDbType.Varchar2, 10, ParameterDirection.Input)).Value = txtUsername.Text
cmd.Parameters.Add(New OracleParameter("varPassword", OracleDbType.Varchar2, 20, ParameterDirection.Input)).Value = txtPassword.Text
cmd.ExecuteNonQuery()
iv = cmd.Parameters.Add(New OracleParameter("RetVal", OracleDbType.Varchar2, 20, ParameterDirection.ReturnValue))
AccountStatus = (cmd.Parameters("RetVal").Value.ToString())

Hi,
You need to add the return value first, and before you execute. Try this ..
iv = cmd.Parameters.Add(New OracleParameter("RetVal", OracleDbType.Varchar2, 20, ParameterDirection.ReturnValue))
cmd.Parameters.Add(New OracleParameter("varUsername", OracleDbType.Varchar2, 10, ParameterDirection.Input)).Value = txtUsername.Text
cmd.Parameters.Add(New OracleParameter("varPassword", OracleDbType.Varchar2, 20, ParameterDirection.Input)).Value = txtPassword.Text
cmd.ExecuteNonQuery()Hope it helps,
Greg

Similar Messages

  • Executing stored function using Native SQL

    In SAP documentation, I can see how to execute an Oracle stored procedure in an external database using:
    EXEC SQL.
      EXECUTE PROCEDURE procname
    ENDEXEC.
    I want to execute a stored FUNCTION within a package.  I have tried executing it using the syntax for PROCEDURE above and get a "ORA-06550 wrong type or number of arguments" error.  Since the function has one argument in and one argument out, I think I am counting the number of arguments correctly.  Has anyone executed from within ABAP an Oracle function stored in an external database?
    Thanks
    Janice Ishee

    Janice - from help.sap.com:
    Stored Procedures
    The command EXECUTE PROCEDURE proc allows you to call a procedure stored in the database. When you call it, you can pass a list of host variables as parameters. When yuo call a procedure, you must specify for each parameter whether it is an input parameter ( IN), output parameter (OUT) or changing parameter (INOUT).
    Example
    Calling a Procedure:
    DATA Y TYPE I VALUE 300.
    DATA Z TYPE I.
    EXEC SQL.
    INSERT INTO AVERI_CLNT (CLIENT, ARG1, ARG2, ARG3)
    VALUES ('000', 9, 2, 47)
    ENDEXEC.
    EXEC SQL.
    CREATE OR REPLACE PROCEDURE PROC1 (X IN NUMBER) IS
    BEGIN
    UPDATE AVERI_CLNT SET ARG3 = ARG3 + X;
    END;
    ENDEXEC.
    EXEC SQL.
    CREATE OR REPLACE PROCEDURE PROC2 (X IN NUMBER, Y OUT NUMBER) IS
    BEGIN
    SELECT ARG3 INTO Y
    FROM AVERI_CLNT
    WHERE CLIENT = '000' AND ARG1 = 9 AND ARG2 = 2;
    UPDATE AVERI_CLNT SET ARG3 = ARG3 - X;
    END;
    ENDEXEC.
    EXEC SQL.
    EXECUTE PROCEDURE PROC1 ( IN :Y )
    ENDEXEC.
    EXEC SQL.
    EXECUTE PROCEDURE PROC2 ( IN :Y, OUT :Z )
    ENDEXEC.
    IF SY-SUBRC <> 0 OR Z <> 347.
    WRITE: / 'Wrong result for EXECUTE PROCEDURE:', Z.
    ENDIF.
    EXEC SQL.
    DROP PROCEDURE PROC1
    ENDEXEC.
    EXEC SQL.
    DROP PROCEDURE PROC2
    ENDEXEC.
    Rob

  • SAPBobsCOM Recordset cannot execute Stored Procedure

    I have a query stored in a SQL 2005 Stored Procedure, and when want to retrieve my procedure with the Recordset.doQuery() command, this error message appears :
    System.Runtime.InteropServices.COMException (0xFFFFF930) at SAPbobsCOM.IRecordset.DoQuery(String QueryStr) at [ blah2..... (it refers to my code line) ]
    My code is :
    Dim oRec As SAPbobsCOM.Recordset
    oRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    Try
            oRec.DoQuery("EXEC PO_LIst2")
    Catch ex As Exception
            MsgBox(ex.GetBaseException.ToString)
    End Try
    And when I change my code to be like this :
    Dim oRec As SAPbobsCOM.Recordset
    oRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    Try
            oRec.DoQuery("Select * From OPOR")
    Catch ex As Exception
            MsgBox(ex.GetBaseException.ToString)
    End Try
    I don't get any error....
    For all of the code I use SQL Server 2005, Visual Studio 2008, and SAPBobsCOM version 8.8.
    Have anyone experience this?? Why the recordset can't execute my stored procedure??
    Edited by: Rinaldi Sugiono on Jun 18, 2010 1:44 PM

    I would search the forums for SAPBobsCOM to find a more appropriate forum, since the BusinessOne components are outside of scope for this forum.
    Sincerely,
    Ted Ueda

  • Named parameters in stored function

    Hi,
    I am trying to execute stored function from java in oracle . I am using Oracle 9.2.0.1.0 and the newest JDBC drivers, ie. for 10g which are compatible. I have flicked through JDBC Named Parameters example but it only addresses stored procedures.
    The problem I have is that I do not know what name the return value of stored procedure has.
    stored function parameter names:
    1. ????
    2. test1 Mode: IN
    3. test2 Mode: IN
    ?=call test_function(?,?);
    When I am trying to set values as indexes everything works perfect.
    CallableStatement cs = .....
    cs.registerOutParameter(1, Types.VARCHAR);
    cs.setString(2, "a");
    cs.setString(3, "b");
    cs.execute();
    String returnedValue = cs.getString(1);
    However, when I am trying to use named parameters the code looks like this:
    CallableStatement cs = .....
    cs.registerOutParameter(1, TYPES.VARCHAR);
    cs.setString("test1", "a");
    cs.setString("test2", "b");
    and the question is what is the name of return parameter.
    I have tried to put the same name as the name of stored function but is reports error.
    Instead I had to first getmetadata from oracle and in case of stored functions utilize it, unfortunatelly getting metadata has perfomance issues and I heard that oracle 10g is even slower in getting metadata.
    If anyone knows the answer to my question, please answer.
    Thank you in advance,
    Mateusz Szczap
    Java Programmer
    NCDC
    [email protected]
    http://www.ncdc.pl

    Hi,
    I am trying to execute stored function from java in oracle . I am using Oracle 9.2.0.1.0 and the newest JDBC drivers, ie. for 10g which are compatible. I have flicked through JDBC Named Parameters example but it only addresses stored procedures.
    The problem I have is that I do not know what name the return value of stored procedure has.
    stored function parameter names:
    1. ????
    2. test1 Mode: IN
    3. test2 Mode: IN
    ?=call test_function(?,?);
    When I am trying to set values as indexes everything works perfect.
    CallableStatement cs = .....
    cs.registerOutParameter(1, Types.VARCHAR);
    cs.setString(2, "a");
    cs.setString(3, "b");
    cs.execute();
    String returnedValue = cs.getString(1);
    However, when I am trying to use named parameters the code looks like this:
    CallableStatement cs = .....
    cs.registerOutParameter(1, TYPES.VARCHAR);
    cs.setString("test1", "a");
    cs.setString("test2", "b");
    and the question is what is the name of return parameter.
    I have tried to put the same name as the name of stored function but is reports error.
    Instead I had to first getmetadata from oracle and in case of stored functions utilize it, unfortunatelly getting metadata has perfomance issues and I heard that oracle 10g is even slower in getting metadata.
    If anyone knows the answer to my question, please answer.
    Thank you in advance,
    Mateusz Szczap
    Java Programmer
    NCDC
    [email protected]
    http://www.ncdc.pl

  • Cannot call ANY stored functions from my Java program

    My problem is that I cannot call ANY stored procedure from my Java
    program. Here is the code for one of my stored procedures which runs
    very well in PL/SQL:
    PL/SQL code:
    CREATE OR REPLACE PACKAGE types AS
    TYPE cursorType IS REF CURSOR;
    END;
    CREATE OR REPLACE FUNCTION list_recs (id IN NUMBER)
    RETURN types.cursorType IS tracks_cursor types.cursorType;
    BEGIN
    OPEN tracks_cursor FOR
    SELECT * FROM accounts1
    WHERE id = row_number;
    RETURN tracks_cursor;
    END;
    variable c refcursor
    exec :c := list_recs(11)
    SQL> print c
    COLUMN1 A1 ROW_NUMBER
    rec_11 jacob 11
    rec_12 jacob 11
    rec_13 jacob 11
    rec_14 jacob 11
    rec_15 jacob 11
    Here is my Java code:
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    class list_recs
    public static void main(String args[]) throws SQLException,
    IOException
    String query;
    CallableStatement cstmt = null;
    ResultSet cursor;
    // input parameters for the stored function
    String user_name = "jacob";
    // user name and password
    String user = "jnikom";
    String pass = "jnikom";
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    try { Class.forName ("oracle.jdbc.driver.OracleDriver"); }
    catch (ClassNotFoundException e)
    { System.out.println("Could not load driver"); }
    Connection conn =
    DriverManager.getConnection (
    "jdbc:oracle:thin:@10.52.0.25:1521:bosdev",user,pass);
    try
    String sql = "{ ? = call list_recs(?) }";
    cstmt = conn.prepareCall(sql);
    // Use OracleTypes.CURSOR as the OUT parameter type
    cstmt.registerOutParameter(1, OracleTypes.CURSOR);
    String id = "11";
    cstmt.setInt(2, Integer.parseInt(id));
    // Execute the function and get the return object from the call
    cstmt.executeQuery();
    ResultSet rset = (ResultSet) cstmt.getObject(1);
    while (rset.next())
    System.out.print(rset.getString(1) + " ");
    System.out.print(rset.getString(2) + " ");
    System.out.println(rset.getString(3) + " ");
    catch (SQLException e)
    System.out.println("Could not call stored function");
    e.printStackTrace();
    return;
    finally
    cstmt.close();
    conn.close();
    System.out.println("Stored function was called");
    Here is how I run it, using Win2K and Oracle9 on Solaris:
    C:\Jacob\Work\Java\Test\Vaultus\Oracle9i\FunctionReturnsResultset>java
    list_recs
    Could not call stored function
    java.sql.SQLException: ORA-00600: internal error code, arguments:
    [ttcgcshnd-1], [0], [], [], [], [], [], []
    at
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
    at
    oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:490)
    at
    oracle.jdbc.driver.OracleStatement.getCursorValue(OracleStatement.java:2661)
    at
    oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4189)
    at
    oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4123)
    at
    oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:541)
    at list_recs.main(list_recs.java:42)
    C:\Jacob\Work\Java\Test\Vaultus\Oracle9i\FunctionReturnsResultset>
    Any help is greatly appreciated,
    Jacob Nikom

    Thank you for your suggestion.
    I tried it, but got the same result. I think the difference in the syntax is due to the Oracle versus SQL92 standard
    conformance. Your statament is the Oracle version and mine is the SQL92. I think both statements are acceptable
    by the Oracle.
    Regards,
    Jacob Nikom

  • Can I Execute a function whose name is stored in a string variable?

    Can I execute a function whose name is stored in a string variable?
    Like
    Depending on the condition I will stroed the name of the function in a string variable. Then using that string variable i want to execute the function.
    String str=��
    iVal an int can take ne value
    Switch(iVal)
    Case 1:
    str=�test1()�;
    Case 2:
    str=�test2()�;
    I want whatever function name is in str to be executed.
    ----------------------------------------------------------------------------------

    For just executing a method or two, reflection might be easier than beanshell (or it might not). For executing entire scripts, beanshell will be preferable over reflection.
    (I assume beanshell uses reflection under the hood, but I've never bothered to peek.)

  • Execute a stored function from command line

    Hello,
    I have a db stored function and I need to execute it from command line. I've tried by this way:
    (I need to connect with sys credentials)
    sqlplus sys/mypwd@mydb AS SYSDBA @myfile.sql
    and myfile.sql is:
    exec myschema.sf_test;
    but I get this error:
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00221: 'sf_test' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    You can use exec command for the execution of a procedure with out bind variable, but for a function always use bind variable.
    Function should return a value, so you must have to assign the function return value to a variable.
    like given below(or simply query the function using select statement)
    Method 1
    ======
    variable v1 number;
    exec :v1 := t_func;
    Method 2
    ======
    declare
    x1 NUMBER;
    begin
    x1 := t_func;
    end;
    SQL> create function t_func return number
    2 as
    3 begin
    4 return 0;
    5 end;
    6 /
    Function created.
    SQL> exec t_func;
    BEGIN t_func; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00221: 'T_FUNC' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Method 3
    ======
    SQL> select t_func from dual;
    T_FUNC
    0
    Regards
    JJ

  • Executing DML-ing stored function from EntityManager

    Hi,
    Is there some way of getting the result from a DML-ing stored function from the EntityManager? I can use a native query and just select the function from dual if it doesn't do any DML but when it does, it is not permitted. I can't use getDelegate() to get the raw connection either :-/
    Edited by: nickarls on Sep 25, 2007 2:19 AM
    Edited by: nickarls on Sep 25, 2007 2:20 AM
    Hmmm. the *** should be "ing". Probably looks like a curse

    anyone, anyone?

  • View + stored function + synonym for other user

    Dear All!
    I've got a quite strange problem which I cannot decide whether it's caused by my lack of knowledge on the appropriate topic or by an Oracle bug. I'm already after some heavy googling on the topic and I was unable to track any valuable answers neither in forums nor in the Oracle documentation. I'll try to be as short and specific as possible.
    Database: Oracle 10g
    Result of "SELECT BANNER FROM V$VERSION":
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE     10.2.0.4.0     Production"
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    I have two users in the database for a single Web application: UAPP01, which is the owner of application DB objects and UAPP02 which is the application user connecting to the DB. The application runs for quite many years by now and DB structure layout has always been following a simple logic: for each DB object used by the app. (tables, views, packages and stored procedures/functions) and found in the UAPP01 there exists a synonym in the UAPP02 schema. For the privileges to be set correctly a role is created: RL_MY_APPL which is granted the necessary privileges on objects of UAPP01 (CRUD on tables, SELECT on views, EXECUTE on procedures, etc..). This role is granted to UAPP02.
    In the previous days I was about to extend the DB with a view that invokes a stored function. This pattern has already occured in the DB previously so I kept following existing conventions: I've created the stored function and the view in the UAPP01 schema, granted SELECT on the view to RL_MY_APPL and created the synonym for it in the UAPP02 schema. This is where the entire functionality began to act strange. I'll try to explain with a simplified example that was sufficient to reproduce the problem:
    REM ========================================
    REM Execute below code as UAPP01 user.
    REM ========================================
    REM Test function.
    CREATE OR REPLACE FUNCTION testfunction(p_param NUMBER) RETURN NUMBER IS
    BEGIN
    RETURN p_param *2;
    END;
    REM Testview version 1. causing trouble.
    CREATE OR REPLACE VIEW testview AS
    WITH testdata AS
    SELECT /*+ materialize*/ LEVEL AS d
    FROM dual CONNECT BY LEVEL <= 100
    SELECT a, b, c, SUM(d) AS sum_d
    FROM
    SELECT FLOOR(dbms_random.VALUE(1, 100)) a, FLOOR(dbms_random.VALUE(1, 100)) b, FLOOR(dbms_random.VALUE(1, 100)) c, testfunction(d) AS d
    FROM testdata
    GROUP BY CUBE(a, b, c)
    REM Testview version 2. not causing trouble.
    CREATE OR REPLACE VIEW testview AS
    SELECT a, b, c, SUM(d) AS sum_d
    FROM
    SELECT FLOOR(dbms_random.VALUE(1, 100)) a, FLOOR(dbms_random.VALUE(1, 100)) b, FLOOR(dbms_random.VALUE(1, 100)) c, testfunction(d) AS d
    FROM
    SELECT LEVEL AS d FROM dual CONNECT BY LEVEL <= 100
    GROUP BY (a, b, c)
    REM Synonym.
    CREATE OR REPLACE SYNONYM UAPP02.testview FOR UAPP01.testview;
    REM Grants.
    GRANT SELECT ON testview TO RL_MY_APPL;
    When creating TESTVIEW with the 1 ^st^ version I cannot query it using the UAPP02 user, I'm constantly getting the error: ORA-00904: : invalid identifier. However, when I use the 2 ^nd^ version everything runs perfectly. What is common in the two cases is that both versions use the TESTFUNCTION function. I have not granted the EXECUTE rights on TESTFUNCTION to the RL_MY_APPL since it was never needed previously (for other views using stored functions) and as far as I know it's not necessary (as both the view and the function are owned by UAPP01). The strange thing in the above behaviour is that the function is used by both versions, however only one of them fails. This is where I thought it's not a granting issue, otherwise neither of the versions would have worked and I think I would have received a different error stating that UAPP02 lacks the necessary privileges on underlying objects of the view.
    As I further digged into the problem by examining the EXPLAIN PLAN output for the two versions I found that version 1. leads to a TEMP TABLE TRANSFORMATION and to MULTI TABLE INSERTs, whereas version 2. simply executes the query without doing such things. In my setup I presume the MULTI TABLE INSERTs were caused by the GROUP BY CUBE. When I simply removed the CUBE and used only GROUP BY the TEMP TABLE TRANSFORMATION remained in place but the MULTI TABLE INSERTs disappeared. As a result of this small modification the view again began to work when I executed it through the synonym and using the UAPP02 user.
    With the original DB objects of our application the behaviour is even more strange: the error comes up if I select from the view and filter for a column that is grouped in the query whereas it works correctly if I filter for the aggregated columns. However, I couldn't reproduce this with the above simplified example.
    No problem occurs with any of the versions if I query the view using the UAPP01 user.
    This hectic behaviour made me suspect that the TEMP TABLE TRANSFORMATION + MULTI TABLE INSERT + synonym + stored function combo appears to bring a strange Oracle bug to the surface...
    As a final note: when executing GRANT EXECUTE ON TESTFUNCTION TO RL_MY_APPL everything works fine in all cases. I know I could simply live with this but I'd really like to get to the bottom of this. Although this extra GRANT appears to solve the problem I don't really trust it. I'd really like to avoid the bug emerging again in Production in case this extra GRANT were not sufficient due to some unknown misteries.
    Excuse me, the post has become a bit lengthy. Thanks in advance for anyone who's willing to read through and answer it!
    Regards,
    Krisztian Balazs Szaniszlo

    The error is thrown at run-time and only for the UAPP02 (second) user.
    The problem is that the appearance of errors is independent of whether the query contains the call to the stored function or not.
    So far I thought that if I use a stored function indirectly, like in this setup: UAPP02.synonym -> UAPP01.view -> UAPP01.stored function, then I don't need the grant. Of course, I understand that if I had used it directly, like :UAPP02.synonym -> UAPP01.stored function then I'd need the GRANT EXECUTE.
    Shall I just ignore the strange behaviour and go on by adding GRANT EXECUTE privilege on all the functions used indirectly through views? It seems to solve the problem, but this behaviour is disturbing me quite and I fear the real root cause of the problem can emerge later in a different fashion.

  • Calling a stored function in Oracle 8.1.5 which has out parameters

    Hi,
    The issue is, I am unable to call or execute a Oracle8.1.5 stored function which has 1 return value and 1 out parameter from neither from .NET nor from VB6.
    If I use MSDAORA.1 : wrong number or types of arguments in call to function displays even though everything is perfect.
    If i use OraOLEDB.Oracle.1 provider (even though my client and server are 8.1.5,i used this) it says Provider cannot be found. It may not be properly installed. as it is not 8.1.7 or higher. I want to use 8.1.5 only. Kindly give me a solution for this.
    If i use 8.1.7 client for the server 8.1.5 my stored function is executing and returning the out parameter perfectly in .NET using MSDAORA.1. But I have to use 8.1.5 client and servers only. Please Help me.
    Thanks a lot in advance
    Krishna Mohan
    Hyderabad

    Functions normally have only 'in' parameters and return a single out value. Writing a function with an out parameter is risky, at best.
    Rewrite the function, and make it a procedure instead. Then I would bet the problem will no longer exist.

  • Data Federator:  Insufficient memory : Operator 'HashJoin' cannot execute

    Hi,
    I'm using: SAP BusinessObjects Data Federator Designer XI 3.0 Service Pack 3 - 12.3.0.0 (Build 1011241842)
    I have a virtual view on top of sql server 2007 and teradata.  I am using a view on sql server 2007 that joins against several tables and querying a single table from Teradata.
    When I try to query the view I get the error:  [Data Federator Driver] [Server] Insufficient memory : Operator 'HashJoin' cannot execute because it cannot allocate the minimal number of memory pages. Please contact the system administrator to change system parameter settings. (0)
    This happens when I try to query the view from data federator or from an odbc connection.
    I tried playing with the configuration settings for core.queryEngine.hash.maxPartitions  and
    core.queryEngine.hashJoin.nbPartitions  and nothing seemed to work in terms of changing/increasing the numbers.  The help guide also gave no help:  http://help.sap.com/businessobject/product_guides/boexi3SP3/en/xi3_sp3_df_userguide_en.pdf
    I was using a very similiar query against a materialized view on Oracle and Teradata before and that worked.  But I'd prefer not to have to materialize the view in Sql Server.
    Any thoughts as to how this can be fixed?
    Thanks,
    Kerby

    <rant>The strange thing with this forum is no people, really no people, ever do anything to resolve their own problems, even though this forum has a search function, and sites with FAQs and assistance are floating around over the Internet. Why is a mystery, as nobody uses them, and most DBAs only know how to hit copy-and paste, to add to the clutter on OTN again.</rant>
    The usual steps to troubleshoot an ora-1031 apply.
    This means
    - verify whether the local administrator is in the ora_dba group and sqlnet.authentication_services in sqlnet.ora has been set to (NTS)
    - in absence of these, there should a password file be present in %ORACLE_HOME%\database, named pw%SID%.ora
    These belong to the common documented requirements, and these requirements shouldn't be repeated everywhere.
    Sybrand Bakker
    Senior Oracle DBA
    Experts: Those who do read documentation.

  • Macro Error while executing planning functions or saving data

    Dear All,
    I am getting following error in BEx Analyzer while executing planning function or pressing a save button.
    Note: Excel is 2007 version.
    Cannot run the macro "XXXXXX.xlsx". The macro may not be available in this workbook or all macros may be disabled.
    I changed the settings in Macro Settings (Office Button -> Excel Options -> Trust Center -> Trust Center Settings-> Macro Settings) eventhough it is showing that above message.
    selected ->
    Enalble all macros
    Trust access to VBA project object model.
    If anybody faced this issue kindly reply to this.
    Best Regards,
    SG

    Hello everybody,
    i am facing exactlythe same issue! I am currently running GUI Patch Level 14 and BI Add on Patch Level 10.
    I have also adjusted all necessary settings in Excel Options like Activate all Macros and Trust VBA Coding.
    Does anybody have another Solution.
    As mentioned before Gui Patch 13 and BI Add On Patch 10 obviously arent the solutiuon.
    Best regards
    Janos

  • Using Stored Function with a datagridview

    Hi All,
    I have a problem using a stored function in a datagridview control. My problem is, when the user adds a new row to the grid, the stored function is called to insert the next item number in a grid column. For some reason I cannot figure out why this isn’t just working. The stored function is working alright, as I can call it from SQL Plus or PL/SQL and get the return value back but my problem is inserting it into the grid as the user creates a new row. Can some please help.
    Function NextItemNum RETURN NUMBER
    IS
    varItemNum NUMBER(8);
    Begin
    SELECT MAX(ITEM_NUM) + 1
    INTO varItemNum
    FROM ORDERITEMS;
    IF varItemNum IS NULL THEN
    varItemNum = 1
    END IF;
    RETURN varItemNum;
    END NextItemNum;
    /* Code to insert into datagridview */
    ig = myOrdersInsertCommand.Parameters.Add(New OracleParameter("pVal", Client.OracleDbType.Int32, 8, ParameterDirection.ReturnValue))
    myOrdersInsertCommand.ExecuteNonQuery()
    ItemNum = (myOrdersInsertCommand.Parameters("pVal").Value.ToString())
    For Each r As DataGridViewRow In OrderItemsDataGridView.Rows
    ORDER_ITEMSTableAdapter.InsertOrderItems(r.Cells(0).Value, r.Cells(1).Value, r.Cells(2).Value, r.Cells(3).Value, r.Cells(4).Value, r.Cells(5).Value, r.Cells(6).Value)
    Next

    Firstly, thank you for the help. I have attempted to code the advice you gave but it still does not seem to compile properly. Can you suggest what is wrong with my code please?
    Here is the code I am trying to configure:
    forceDriver.h
    static int32 CVICALLBACK static_callback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void* callbackData);
    int32 EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples);
    int32 DoneCallback(TaskHandle taskHandle, int32 status, void *callbackData);
    forceDriver.cpp
    DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,2500,0,&forceDriver::static_callback,panel));
    **START TASK**
    int32 forceDriver::EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples)
           panel->(member_function);
    int32 CVICALLBACK forceDriver::static_callback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void* callbackData)
    forceDriver* static_object = static_cast<forceDriver*>(callbackData);
    return static_object->EveryNCallback(taskHandle, everyNsamplesEventType, nSamples);
    where panel is the object I have created. 

  • Execute stored-prozedure in sql-statement in jdbc-adapter for sender

    Hello,
    in the sql-statement i call a stored procedure which makes following:
    - doing a selcet
    - update one field
    - give a recordset back
    In the update-field i write:
    But in the adapter monitoring i become a sql-exception:
    Error: SQLException during query 'EXECUTE st_enum_EAI_lokation': java.sql.SQLException: [SQLServer 2000 Driver for JDBC]No ResultSet set was produced.
    I´m using sql-server.
    So there is no resultset coming back...
    The reason for the stored-procedure is that it is not allowed to make changes in a productive data-base directly by an update.
    What´s the problem?
    Thanks in advance,
    Frank

    Currently, the jdbc sender adapter cannot execute Oracle's stored procedure.  Oracle's stored procedure cannot return a resultset, which is required by the jdbc sender adapter.
    An adapter user-module is available for a sender adapter to execute Oracle's stored procedure.
    If you are interested, I can send it to you.
    Regards

  • Oracle OLEDB driver can't execute stored procedure in Oracle 8

    Hello, I have a problem when execute a Delphi program, occurs the next error:
    'ORA-06574: Function LEOCLAVEROL references package state, cannot execute remotely'
    LEOCLAVEROL is a function PL/SQL, with a process included in it compiled in Borland C, the function is called from a SELECT (ADOQuery) in a Delphi program.
    Scenario
    User:
    Windows XP
    Oracle Client 8i Ver 8.1.7.0
    Driver= OraOLEDB.Oracle.1
    Provider=MDAC ADO Ver 2.7
    Server:
    Oracle8 Release 8.0.5.2.1 runing Windows NT 4 Service Pack 6
    (The process is OK with Oracle 8i !!!!)
    Anybody help me?
    Thanks
    Osky

    Hello, I have a problem when execute a Delphi program, occurs the next error:
    'ORA-06574: Function LEOCLAVEROL references package state, cannot execute remotely'
    LEOCLAVEROL is a function PL/SQL, with a process included in it compiled in Borland C, the function is called from a SELECT (ADOQuery) in a Delphi program.
    Scenario
    User:
    Windows XP
    Oracle Client 8i Ver 8.1.7.0
    Driver= OraOLEDB.Oracle.1
    Provider=MDAC ADO Ver 2.7
    Server:
    Oracle8 Release 8.0.5.2.1 runing Windows NT 4 Service Pack 6
    (The process is OK with Oracle 8i !!!!)
    Anybody help me?
    Thanks
    Osky

Maybe you are looking for