3 Replies Latest reply on Aug 21, 2013 6:42 AM by Abbas Mehdi

    EXEC_SQL Package  With Ora-306500 error

    Abbas Mehdi


          v_db varchar2(255);

          v_conn EXEC_SQL.ConnType;

          v_cur EXEC_SQL.CursType;

          al_btn number;


          --v_db := 'a/a@ODBC:health'; --'test/test@ODBC:UG2000';

          v_db := 'test/test@ODBC:UG2000';

          v_conn := EXEC_SQL.OPEN_CONNECTION(v_db);

          if EXEC_SQL.IS_CONNECTED(v_conn) then

          al_btn := show_alert('success');

          else al_btn := show_alert('failure');

          end if;



      Hi all ,


      I am getting this error when i try to execute the above statments.



        • 1. Re: EXEC_SQL Package  With Ora-306500 error
          Christian Erlinger
             v_db := 'test/test@ODBC:UG2000';

          Are you trying to connect to a ODBC datasource? I don't think this is possible via exec_sql. If your datasource is an oracle database then simply connect via SQL*Net; if it is another database create a database gateway and use it:


          Oracle Database Search Results: database gateway



          • 2. Re: EXEC_SQL Package  With Ora-306500 error

            You can connect via ODBC using exec_sql.open_connection.


            HaiderAli, you have to give version information, the OS you are using, the exact error message etc.

            Maybe it works on your local PC, but not on the server. If you are trying to connect from the server, make sure you can access the data source from this server.


            There is certainly one thing wrong: the spec for using open_connection is:


            FUNCTION EXEC_SQL.Open_Connection

                (Username     IN VARCHAR2,

                 Password     IN VARCHAR2,

                 Data source  IN VARCHAR2)

            RETURN EXEC_SQL.ConnType;


            There are 3 parameters, not one. Look in the Help! Very simple.

            (The Help is not too clear, I must admit. In the description they are talking about parameter Connstr, which is not in the definition of the procedure).


            Message was edited by: InoL

            • 3. Re: EXEC_SQL Package  With Ora-306500 error
              Abbas Mehdi

              this problem has been solved.


              in oracle installation 6i we have option to install for ODBC to view below mentioned attachment...