Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Not able to call dll through PL /SQL

Not able to call dll through PL /SQL

Scheduled Pinned Locked Moved Database
c++databasehelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neeraj Sinha
    wrote on last edited by
    #1

    Hi, I am trying to call one dll inside pl/sql, which I have prepared though vc++. The dll works fine when I call it from any other vc++ applciation and hence tested but it's not working in the pl/sql Although I tried to test my pl/sql procedure with some windows default dll calling them from the procedure, in that case it worked fine. Can you please help me with any hint. I have not used lib file of my dll any where. Could this be the reason? Thank you

    With Regards Neeraj Sinha

    M W 2 Replies Last reply
    0
    • N Neeraj Sinha

      Hi, I am trying to call one dll inside pl/sql, which I have prepared though vc++. The dll works fine when I call it from any other vc++ applciation and hence tested but it's not working in the pl/sql Although I tried to test my pl/sql procedure with some windows default dll calling them from the procedure, in that case it worked fine. Can you please help me with any hint. I have not used lib file of my dll any where. Could this be the reason? Thank you

      With Regards Neeraj Sinha

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Disclaimer: I'm no expert on Oracle. Generally, when you can't call a function in a DLL from another programming language, it's due to decorated function names, also called 'name-mangling'. The C++ compiler encodes the types of the function's parameters in the name it records in the DLL, because the linker and OS loader match functions by name only, there is no space for parameter types. The types are needed to support overloading. If you open a Visual Studio command prompt (2003 and later; for VC6 open a command prompt and run C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat) and run dumpbin /exports on your DLL, you will probably see that the names start with a ? and end with @@ and a bunch of letters and @ symbols. That means they're decorated names. To force undecorated names, the simplest thing to do is to tell the C++ compiler that you want C compatibility. You do this by adding extern "C" to the start of the function declaration. You should also check which calling convention Oracle requires, to ensure that the stack is set up correctly for calling the function, and cleaned up correctly when it returns.

      DoEvents: Generating unexpected recursion since 1991

      1 Reply Last reply
      0
      • N Neeraj Sinha

        Hi, I am trying to call one dll inside pl/sql, which I have prepared though vc++. The dll works fine when I call it from any other vc++ applciation and hence tested but it's not working in the pl/sql Although I tried to test my pl/sql procedure with some windows default dll calling them from the procedure, in that case it worked fine. Can you please help me with any hint. I have not used lib file of my dll any where. Could this be the reason? Thank you

        With Regards Neeraj Sinha

        W Offline
        W Offline
        Wendelius
        wrote on last edited by
        #3

        Workflow in short: - create the procedure in vc++ - remember to export the procedure explicitly using DLLEXPORT - build the dll - place it in oracle_home/bin folder - connect to oracle - create a library XYZ pointing dll using CREATE LIBRARY statement - create PL/SQL front end using CREATE FUNCTION and defining EXTERNAL LIBRARY XYZ For more information refer to Oracle Database Platform Guide Hope this helps, Mika

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups