How use DLL from PL/SQL
Dear Mr/Mrs,
My system is
1.Oracle Database 10g express edition(with apex 3.2)
2.Windows 2003 server
3.GSM Modem(usb cable + Vendor Provided dll for developer)
4.Mobile SIM card
Now ,i want to send SMS from Database.
N.B: email to sms is not my intention
Thanks
Engr.M.K Chowdhury
Hi,
What's wrong with the last answer Re: Using DLL from apex ?
Regards
Peter
Similar Messages
-
Using MapViewer from PL/SQL vs Java
Hi group!
The MapViewer User's Guide has this to say about using MapViewer from PL/SQL:
"The usage model for the SDO_MVCLIENT package is almost identical to that of
MapViewer JavaBean-based API" etc etc .. "For usage and reference information about specific functions or procedures, see the description of the associated JavaBean-Based API. methods and interfaces in Chapter 4"
If I don't misunderstand the basic concept, in a Java Web App (using the MapViewer Bean) you create a MapViewer object for each HTTP-user-session, like so:
MapViewer mv = new MapViewer("http://my_corp.com:8888/mapviewer/omserver");
... which you would then store in the user's session object, so that the MapViewer Bean conveniently holds the map's state on the user's behalf.
To do the equivalent in PL/SQL, the User's Guide suggests:
"connect scott/tiger
call sdo_mvclient.createmapviewerclient(
'http://www.mycorp.com:8888/mapviewer/omserver') ;
The preceding example creates, in the current session, a unique MapViewer client
handle to the MapViewer service URL"
Does "current session" refer to the HTTP-user-session? While I've used PL/SQL before, I've not used the PL/SQL Web Toolkit. Is the session handling implicit here (and invisible?) or should the sdo_mvclient be subsequently stored in the PL/SQL equivalent of a (J2EE) HttpSession object?
YTPart of the answer will depend on how you plan to deploy the application. If you have a few, local clients you could go with the traditional client/server model. If you have a lot of clients and/or they are spread out over a relatively large area (like a campus setting), a web front-end will save you a lot of hassels down the road when it comes time to upgrade.
Regardless of the the front end, I can tell you that I have been greatly impressed with the throughput you can get by moving most of the code to PL/SQL packages. A few years ago we reworked a VB/Oracle app by moving a lot of the code out of VB and into packages, leaving the client to essentially call procedures and format the output. We had more than a 3x performance increase on the same hardware and our network utilization decreased noticably.
I am now in the process of replacing the client code with Java servlets/JSP, primarily because of the maintenance hassles I mentioned earlier. There are some limitations with an HTML page but most of these have been cosmetic so far.
We are still relying heavily on PL/SQL packages. The servlet code basically gets a request, calls a package to get the data, then hands the results to a JSP page. The JSP then formats the output and sends it to the client. We are little more than halfway through the re-write, but it appears performance will increase again. Not as noticably as before, but I will take what I can get. As you have seen, once something is rolled out it always ends up getting used more than you anticipated. Better to over-engineer now than have to patch it once it is live.
HTH -
Re: How to converting from PL/SQL query to T-SQL query
How to converting from PL/SQL query to T-SQL query... Its Urgent
Download the
SQL Server Migration Assistant for Oracle. It will convert whole Oracle databases, or single queries or PL/SQL stored procedures.
With caution that If your database is using Collation which is case sensitive SSMA will not work.SSMA doesnt guarantees 100% for conversion of Queries/stored proc /database if it fails to do so for some queries you will have to do it manually.
But you can try
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
i have to call VB dll from pl/sql.Can anybody help me ?
thanxThis is how default listener.ora file looks like on my system. By default it has settings for external procedure. Can u please tell me what text in red means? Do i have to chage these setting to run my example?
thanx.
LNRORAEVO =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = small)(PORT = 1521))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
SID_LIST_LNRORAEVO =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle9i)
([red]PROGRAM = extproc[red])
) -
Hi Every one
I have to call one microssoft dll from the pl/sql using form .
How can I do it.
PrashantThat likely means that the DLL call failed.
Some basics.
A DLL exposes an interface where it lists the names of the proc/func exposed (together with a number/ordinal for each).
The Win32 LoadLibrary() call is used to load a DLL. This returns a handle that is then used by subsequent calls to the DLL.
In order to make the actual call, the caller needs to know the address of the procedure/function in the DLL. The GetProcAddress() is the Win32 call I remember using to get the address to call (but I think it has been deprecated since).
Anyway, for the caller to call that proc/func in the DLL, it needs these steps:
- load that library
- get the "address" of that proc/func in the DLL
- make the call
The DLL is then executed - in the address space of the caller. Yes, the DLL's code segment is loaded once and shared amongst how ever many executables are using that DLL. But the DLL has no data segment - the data segment of the DLL lives in the address space of the caller.
Should the DLL do something dirty/wrong, it can crash the caller by corrupting its address space. Or the DLL call could simply fail, throw an exception and terminate unexpectedly.
This is the basics of the a DLL call - and also why Oracle wants to run that DLL call externally using the EXTPROC interface, so as not to risk that DLL compromising the memory space of the Oracle server process.
This makes it a tad more complex now as the Oracle server process makes a call to EXTPROC (an IPC/RPC call) - and the EXTPROC process makes the DLL call (as described above).
If that EXTPROC process crashes, the call that the Oracle server process made also terminates unexpectedly.
Why can the EXTPROC process crash? Well, there are more meaningful errors returned when the DLL fails to load in my experience. So I expect that your DLL was found and that the EXTPROC process did a successful LoadLibrary() call - and even made a successful GetProcAdress() (or whatever call).
But when the actual call to the DLL func/proc was made, an error resulted (incorrect parameter passing, invalid data types being passed, invalid memory being referenced, etc).
This error caused a fatal error and terminated the EXTPROC process. No meaningful error was therefore returned to the Oracle server process - so it throws the exception "lost RPC connection to external process".
Hope this was not too technical and you got the gist of it. -
How to determine from PL/SQL which processes are running
Hi,
I would like to find out which processes are runing. Is there any way how to determine this directly from PL/SQL? I know I can run external C libraries, but if there is another way, that would be great.
Thanks for help, DanRahul India wrote:
YOu might want to check these
http://www.dba-oracle.com/plsql/t_plsql_v$.htm
http://www.dba-oracle.com/t_plsql_monitoring.htm
Please DO NOT post links to commercial websites. It is a breach of the Terms of Use of the forums.
Such websites tend to provide snippits or excerpts of information in order to try and get people to purchase their products (books or whatever) or services.
There are plenty of good resources out there, including the Oracle documentation, other threads on these forums with similar questions and solutions, or expert's blogs or websites that are not trying to sell something. -
HOW TO LOGIN FROM PL/SQL?
I want to test some application logic that uses
wwctx_api.get_user and other session related information. Instead
of logging in from the web, I want to login from PL/SQL and
test the rest of my logic. How do I do that? I tried using
PORTAL30_SSO.wwsso_app_admin.ls_login. But it raised exceptions
since SYS.OWA_UTIL is failing.You can use WWCTX_API.SET_CONTEXT - this is documented in the
PLSQL PDK. -
Hello all,
I want to call a function located in an external DLL from a PL-SQL block. I execute the followin steps :
1. Create a database library pointing to the external DLL :
create or replace library libstk as 'C:\SUMMIT\libstkdte_s_trade1.dll'
2. Create the definition and the body package :
CREATE OR REPLACE PACKAGE dllcall IS
FUNCTION s_trade (
s_in VARCHAR2 )
RETURN VARCHAR2;
PRAGMA RESTRICT_REFERENCES(s_trade, WNDS);
end dllcall;
show errors
CREATE OR REPLACE PACKAGE BODY dllcall IS
FUNCTION s_trade (s_in IN VARCHAR2) RETURN VARCHAR2
IS EXTERNAL
NAME "s_trade"
LIBRARY libstk
PARAMETERS (s_in STRING,
RETURN STRING);
END dllcall;
show errors
set serveroutput on
3. Start the PL-SQL block calling the external function. And I got the foolowing error :
1 begin
2 dbms_output.put_line ( dllcall.s_trade ( '<Request> ' ||
3 '<CurveId>MYCURVE</CurveId> ' ||
4 '<Mode>02</Mode> ' ||
5 '<ExpCcy>GBP</ExpCcy> ' ||
6 '<AsOfDate>20001023</AsOfDate> ' ||
7 '<Entity>***SUMMIT-XML***</Entity> ' ||
8 '</Request>') );
9* end;
10
11 /
begin
ERROR à la ligne 1 :
ORA-06520: PL/SQL: Error loading external library
ORA-06522: Unable to load DLL
ORA-06512: at "V31.DLLCALL", line 0
ORA-06512: at line 2
The "Read - Execute permissions" of the DLL file was given to "Authentified users" .
What's wrong ?
TIA
PS : NT2K environment, DB 8.1.7
R. Charles EmileYes, a RPC was set up.
Listner.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Server1)(PORT = 1521))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = NMP)(SERVER = Server1)(PIPE = ORAPIPE))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\Oracle\Ora81)
(PROGRAM = extproc)
tnsnames.ora
extproc_connection_data =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(CONNECT_DATA = (SID = PLSExtProc))
Thanks
RCE -
How to integrate from MS SQL SERVER 2005 and Flatfile to Oracle 10g.
Hi
I am new to ODI. I am trying to load sample data from MS SQL Server 2005 and Flatfile to Oracle 10g.
1. I have created three models.
1-1. SQL2005 (SRC_CUSTOMER table)
1-2. Flatfile (SRC_AGE_GROUP.txt & SRC_SALES_PERSON.txt)
1-3. Oracle 10g (TRG_CUSTOMER table)
You may know I got those environments from the ODI DEMO environment.
2. I could able to reverse the tables also.
3. I have created an interface which contains source table (from MSSQL 2005), Flatfile and target table from ORACLE model.
4. I have imported the knowledge modules. But I am confusing in selecting the knowledge modules to source and target tables.
I've selected LKM File to SQL for flatfile model.
I've also selected LKM SQL to SQL for MSSQL 2005 model and IKM Oracle Incremental Update for the target table (ORACLE).
I've also implemented the interface that I created. It worked without errors. But there is no data in target table which is TRG_CUSTOMER.
I really would like to know what happened and what the problems are.
You can email me [email protected]
Thanks in advance
Jason Leewhat did give for SRC_AGE_GROUP SRC_CUSTOMER join condition
if it is
(SRC_CUSTOMER.AGE=SRC_AGE_GROUP.AGE_MIN) AND SRC_CUSTOMER.AGE=SRC_AGE_GROUP.AGE_MAX
give it as
(SRC_CUSTOMER.AGE>SRC_AGE_GROUP.AGE_MIN) AND SRC_CUSTOMER.AGE<SRC_AGE_GROUP.AGE_MAX -
Call Micrsosoft DLL from pl/sql
Hi
i have one dll microsoft VB. which returns some control chars.I have to call it from my PL/SQL code.How can I do it.Please help
PrashantYou must build an external library, declare it as a LIBRARY object inside Oracle, configure your lib paths, and configure your listener.
Once you've met the config procedures, next you have to create a wrap function to access your external funcion inside a PLSQL block.
Check this documents:
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14289/dcimethcj.htm#sthref250
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b15658/ldr_demo.htm#sthref565
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/manproc.htm#ADMIN00501
Step 1 - Make entry in the TNSNAMES.ORA.
======
Make the following entry in the TNSNAMES.ORA:
extproc_connection_data.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = extproc))
(CONNECT_DATA =
(SID = extproc)
Step 2 - Make the necessary entries in the LISTENER.ORA.
======
You can either add an entry to the existing listener or add another listener
process.
Option 1: Add an Entry to the Existing Listener
The information contained in each listener differs. Defining the
listener process is done in two parts. The first part is as follows:
LISTENER =
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL= IPC)
(KEY= V803)
(ADDRESS= <-Add this line.
(PROTOCOL= IPC) <-Add this line.
(KEY= extproc) <-Add this line.
(ADDRESS=
(PROTOCOL= TCP)
(Host= ###.#.#.#)
(Port= ####)
Step 3 - Start the listener process.
======
Any modifications to the existing listener require that you stop and
restart the listener to reload the new listener configuration. Adding a
second listener process, instead of modifying the current, only requires
the startup of the new listener process.
Step 4 - Create a sample DLL using the following code.
======
The following is a basic example of an external procedure. It is a good
way to test to ensure that the environment (mainly the listener) is configured
correctly.
Note: For the remaining steps, the DLL name should be MYEXTPROC.DLL.
#include <stdio.h>
int __declspec(dllexport) square(int x)
return(x*x);
Step 5 - Move the DLL to same server where the database is located.
======
The DLL can be placed in any directory. One approach would be to create an
EXTPROC directory under the ORACLE_HOME and use this to house all external
procedures.
Step 6 - Create the required library.
=======
Log into SQL*Plus and create a library to be associated with the external
procedure.
Note: The user must have CREATE LIBRARY privileges.
CREATE LIBRARY <mylib> AS <path\filename>;
SQL> CREATE LIBRARY SQUARE_LIB AS 'D:\ORANT\EXTPROC\MYEXTPROC.DLL';
Step 7 - Register the external procedure.
======
An external procedure is not called directly. Instead, you call the PL/SQL
subprogram that registers the external procedure. This can either be a
Function or a Stored Procedure.
CREATE OR REPLACE FUNCTION <FunctionName> (<parm1>...) RETURN <value> AS
EXTERNAL LIBRARY <mylib>
NAME "<Name Of Function In DLL>"
LANGUAGE C;
CREATE OR REPLACE PROCEDURE <ProcedureName> (<parm1>...) AS
EXTERNAL LIBRARY <mylib>
NAME "<Name Of Function In DLL>"
LANGUAGE C;
CREATE OR REPLACE FUNCTION square_of (X BINARY_INTEGER)
RETURN BINARY_INTEGER AS
EXTERNAL LIBRARY SQUARE_LIB
NAME "square"
LANGUAGE C;
Step 8 - Run the external procedure.
======
Use the following code to execute the external procedure:
CREATE OR REPLACE PROCEDURE EXTPROCTEST (X BINARY_INTEGER) AS
RetValue BINARY_INTEGER;
BEGIN
RetValue := square_of(X);
DBMS_OUTPUT.PUT_LINE(RetValue);
End;
EXECUTE EXTPROCTEST(15); -
Is possible use licence from ms sql 2014 std to ms sql 2012 standard ?
We have bought licenses for mssql 2014 standart, but i need install mssql 2012 server std (must be version 2012). Is possible downgrade from sql server 2014 to 2012 ?? Is there any alternative way, how to legally use mssql 2012 server with licence of
2014 ?
Thank youHi,
Yes downgrade rights are there but you must speak to Licensing specialist.
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP -
Error while invoking webservice using UTL_HTTP from PL/SQL Block
Hi All,
I am invoking a webservice (SOAP Request) from a PL/SQL block using UTL_HTTP package.
I am able to send the complete request and am getting the required instance on the BPEL Console, but the process is erroring out while getting response back.
and the PL/SQL Block is ending in error mentioned below:
ERROR at line 1:
ORA-29266: end-of-body reached
ORA-06512: at "SYS.UTL_HTTP", line 1321
ORA-06512: at "APPS.CSM_BPEL_TEST_PKG", line 34
ORA-06512: at line 1
Package is completing successfully if i test in local DB and local BPEL.
But giving above error in client's.
Can anyone let me know what is the cause of this.
Thanks in advanceI got it working by making process Synchronous.
But with asynchronous process it is still same error.
Thanks... -
Issue in using DLLs from a VC++ 6.0 MFC application
Hi,
I am using Labview 7.1 for creating VIs.I have created DLLs for accessing
these
VIs from a VC++ application. The VC++ 6.0 project is created using MFC app
wizard. When I try to execute the VC++ project in Debug configuration it
works
fine. When I try to execute the same in release configuration I get an
error as
shown in the attachment.
Attachments:
labviewWError.jpg 132 KBHi Mukund!
I found this response on another forum thread that looked like it could help you out:
==============================================================
MSVC++ error (system error 998)
This is actually a Microsoft issue. It has something to do with static and
dynamic linking of the MFC DLL. Our R&D engineers have verified this with projects created with no LabVIEW code at all (that is why we believe it to be solely a Microsoft issue). There are three options at this time:
1. Link with the DLL form of MFC.
2. Do not link with the .lib from the LV DLL, instead use LoadLibrary and GetProcAddress to dynamically load the DLL and call the function.
3. Use the VC delayload feature to make the LV DLL not get loaded until the first call is made into it. See VC help on "delayload" for information on setting this up.
Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
==============================================================
Hope this helps!
Travis H.
National Instruments
Travis H.
LabVIEW R&D
National Instruments -
How to connect from oracle sql developer ?
I've made one java class, to access UserRecord Data Base from sql developer.
My class file is :-
import java.sql.*;
import java.io.*;
public class SelectData{
public SelectData(){}
public void selectData(){
String url="jdbc:oracle:thin:@10.1.236.10:1521:dev92i";//connection url
Connection con= null; //connection create
Statement stat = null; //prepared statement create
ResultSet rs=null; //result set to hold result
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection(url,"scott","tiger");
stat = con.createStatement();
rs = stat.executeQuery("select Name from UserRecord");
while (rs.next()) { // Position the cursor
// Retrieve the first column value
System.err.println("Name= " +rs.getString("Name"));
// Retrieve the first column value
System.err.println("Pswd= " +rs.getString("Password"));
rs.close();
catch(SQLException e){
System.err.println(e.getMessage());
catch(ClassNotFoundException e){
System.err.println(e.getMessage());
catch(Exception e){
System.err.println(e.getMessage());
finally{
try{
if(con!=null)
con.close();
catch(Exception e){
System.err.println(e.getMessage());
public static void main(String args[]){
SelectData sd=new SelectData();
sd.selectData();
When i run this class file it gives error :-
"oracle.jdbc.driver.OracleDriver"
Plz help me out from this problem and suggest any configuration if required in oracle sql developer to run my programs.{color:#0000ff}hi,
add the jar for oracle jdbc to the libraries.
if you are using any IDE then just change the project properties adding the jar file.
if not edit the classpath of the envoirnment variables.
{color}{color:#ff0000}*manik*{color} -
Problem in using Timestamp from java.sql.*
AOA
i have declared a variable
private Timestamp entryDate = new Timestamp(8);while using it in my application. it inserts similar time stamp in database , like
01/01/1970 5:00:00 AM
How to get current time from it and how to insert it in databse.AOA
i have declared a variable
private Timestamp entryDate = new Timestamp(8);
Why? What does that 8 mean to you? Did you read the docs to see what it means to Timestamp?
>
while using it in my application. it inserts similar
time stamp in database , like
01/01/1970 5:00:00 AM
How to get current time from it and how to insert it
in databse.Did you read the docs for Timestamp? There's a constructor and/or a set method that takes a Date or a number of millis. You can get the current time in millis with System.currentTimeMillis. (I think that's the method name. Look at System's docs.)
As far as inserting it, you'll do something like this: TimeStamp ts = ...;
Connection con = DriverManager.getConection(...);
PreparedStatement ps = con.prepareStatement("insert into foo (bar) values (?)");
ps.setTimestamp(1, ts);
ps.executeUpdate(); Google for jdbc tutorial for more details.
Maybe you are looking for
-
I am using Adobe Elements 8.0 to make a dvd from a panasonic camcorder that records in Mp4 format. I am running a HP with 3.0 Ghz, 8 GB of ram with a HP BDDVDRW CH20L SCSI DVD, Windows 7, 64bit. After setting up the video to burn it either locks up
-
Satellite A100 - I cannot use the Lexmark X3330 printer
I have a Lexmark X3330 printer that is set as default however I can't print to it. The Pdf doc seems ok and recognises the printer but just does nothing when you press "print". All drivers have been updated - any suggestions?
-
My iPod touch is not restoring?
I was just trying to downgrade but i failed. So i went to restore to my new ios. my ipod is in dfu mode but iunes is saying that it is in recovery mode and it should restore. i have restored more than 5 times but everytime i am seeing an error please
-
IMovie assigns random dates (eg 2040) to events
I don't seem to have a problem importing video from my camcorder, and iMovie generally creates an event on the actual date of import. Occasionally iMovie saves the event under a completely random year(most recently 2040). Does anyone know how to reas
-
Iphone 6 plus can not receive or make calls
Intermittently, I can not eceive or make calls on my iPhone 6 plus. Callers tell me that they call me, they hear the phone ring a number of times and it goes to voice mail. I get the voice mail notification but my phone did not ring. When I try to