Running external applications from LabView
Here are some very basic functions that allow you to start, close, minumize, and maximize external applications.
Not much happening on the front panel, take a look at the block diagram. The string constants are the title of the application as it appears on the title bar when the application is running.
These functions use no other VIs as have been previously seen, BUT they do use the user32.dll which is normally in the windows system32 directory.
Best Regards
-Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
Attachments:
Read INI Polymorphic Type.zip 78 KB
Controlling Application Windows.vi 22 KB
Controlling Application Windows v80.vi 21 KB
Hi Elvis,
I took a look at that example and also found that it was built for SQL server, not necessarily Access. The difference is in the way it stores procedures. I have attached an example program that calls a stored procedure (or query) in Access on a sample database and gets called in LabVIEW. Please try this and let me know what you think! thanks
Jeremy L.
National Instruments
Jeremy L.
National Instruments
Attachments:
StoredProcedureAccess.zip 23 KB
Similar Messages
-
Does anyone know the best way to connect to an external (non-Oracle) application via SQL or PL/SQL?? I have to run external applications such as MS Word from within an Oracle application. There are several applications which may be used, so I plan to start with a page of options with selection of an option connecting to the external application. Any proven options will be considered.
This may be be very hard to accomplish...
If users are accessing an HTMLDB application, they persumably using a browser. Browsers, by design, aren't allowed to spawn external applications on the client machine-- imagine what would happen if I could put up a web site that opened an arbitrary application on your desktop. In theory, you could probably write an ActiveX/ Java component that could be embedded on pages from HTMLDB and will, with the right security settings, open up application windows. This would be a very complex development, deployment, and maintenance problem, though.
Perhaps if you explain why you want to spawn these applications, we could provide more assistance. It may be as simple as providing a link to a .XLS file stored in the database. When the user clicks on that and downloads the file, the server can identify the content-type of the file and the browser will open the file in whatever application is registered to support that file type.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
What is the easiest way to open an application from Labview?
I need to open an application from labview and depending on a user's selection, load one out of a group of files for the application that is opened. I need to know what is the best or easiest way to open an application and load a file that is used by the application based on a selection.
Here is the response that I got from Cognex when I asked them about how to do this. Do you understand what they are talking about?
In order to do something like this you will probably want to look into the Display Control/SDK for In-Sight. The Display Control gets installed along with In-Sight Explorer and includes a control that can be used in an environment like Labview to communicate with In-Sight sensors while the SDK is an enhanced version of the Display Control that gives you more control and functionality. I am not very familiar with the Labview environment so I will give some code snippets in VB.Net and hopefully you can adjust them as necessary. Specifically I see 3 possible avenues to do this:
1) Using the Display Control you have access to many of the dialog boxes that are used in In-Sight Explorer including the Load Job dialog box. You can spawn this dialog box through a line of code similar to cvsInSightDisplay1.Edit.OpenJob.Execute(). I am not certain if the Labview environment will be able to spawn and display this dialog though. 2) With the addition of the SDK (additional purchase) you can directly access sensor properties including the job. There is a method called LoadJobFile to load jobs from on the sensor and LoadJobFileLocally to load jobs from the host machine. A typical line of code might be cvsInSightDisplay1.InSight.File.LoadJobFile("myjob1.job").3) If Labview cannot handle the dialogs and the SDK is not an option for you then you may still be able to do this using Native Mode commands. Native Mode commands are sent through a socket on the telnet port (typically port 23). Keep in mind that you will need to handle the username/password prompt and response when you first open the socket before issuing any Native Mode commands. The command to load a job file from the sensor would be the Load File command which would be a string similar to "LF myjob1.job". The Native Mode commands are documented in the In-Sight Explorer help file. -
Is it possible to run an application from a user or container login script?
Is it possible to run an application from a user login script or a container login script?
A "Force Run" application object works fine if the user's workstation is setup to auto-load "Application Window" or "Application Explorer" but in this case I'd like to run an application when someone does a manual login (ie. they right-click red "N" and choose "Novell Login...")
Using a User Package's "Scheduled Action Policy" and the Event=Login also does not work when a user logs in manually. This type of Event seems to only apply when the user first logs into the workstation, not at a manual login.
Thanks,
Marc> Is it possible to run an application from a user login script or a
container login script?
Yes, see the documentation:
http://www.novell.com/documentation/...a/a7q6999.html
Regards
Rolf Lidvall
Swedish Radio (Ltd) -
How to run two applications from same application server
hi,
i am working on oracle application server 10g , is it possible to run 2 applications from one application server by using different url ? but same report server name .
if i can do so plz tell me how ?
regardshi,
offcourse,you can do this you.you can deploy n no of applications on a single application server.
and even you can run all the reports on a single report server
to the below location.
$ORACLE_HOME/forms/server
create a new enviroment file(for eg fd.env) using the default.env as follows and make the following FORM_PATH and REPORTS_PATH changes in the fd.env
FORMS_PATH=/oraApp/Ora_bi/forms:/oraApp/backup_29_11_2010_0.12/fd/pll:/oraApp/backup_29_11_2010_0.12/fd/forms
REPORTS_PATH=/oraApp/backup_29_11_2010_0.12/fd/reports
similarily create another env file (eg appr.env) and make the above changes in it.
Now make the following changes in formsweb.cfg
for example:
[xyz]
envFile=appr.env(env file name)
form=xyz.fmx(your start form)
lookandfeel=oracle
separateFrame=false
userid=appraisal/[email protected]
splashscreen=NO
logo=NO
background=NO
color=automatic
render=yes
archive=frmall.jar
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar,ofasIcons.jar,icons.jar,OfasPrint.jar,newicons.jar(these jar file are the images files of your applications..needs to be stored in $ORACLE_HOME/forms/java.
imagebase=codebase
term=frmpcweb.res
baseHTML=webutilbase.htm
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
WebUtilArchive=frmwebutil.jar,jacob.jar
[fd]
envFile=fd.env
form=fd.fmx
lookandfeel=oracle
separateFrame=true
userid=fdmmfsl/fdmmfsl@mmfdlive
splashscreen=NO
logo=NO
background=NO
color=automatic
render=yes
archive=frmall.jar
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar,icons.jar
imagebase=codebase
term=frmpcweb.res
baseHTML=webutilbase.htm
baseHTMLjinitiator=webutiljini.htm
This depends on your application which your deploying
now for about accessing the seperate application then
use as follows
1st application
http://ip address:7778/forms/frmservlet?config=xyz
2nd application
http://ip address:7778/forms/frmservlet?config=fd
you can even deploy 2 war files on one application server...and you can even make these 2 war files to access the same report server
If you require any other help then do let me know
Regards
Fabian D'souza -
Can you Launch External Applications From Within InDesign Ebook?
Hi all,
I was wondering if it is possible to open an external application from within an ebook (created with InDesign) e.g. click on a link and have an external ssh client open up for instance?
Thanks in advance for any advice.
Regards,
RGIt's possible to include hyperlinks in an InDesign file and export them in an EPUB file. Since I'm not familiar with working with SSH clients (in fact, I just had to Google it to have a clue what you're talking about), is this something that can be invoked in a standard URL format? If so, you could probably include it.
The next issue is whether the link would work. The link couldn't be used directly in any eBook reader I know of, but at least the iBook on an iPad or iPhone would switch to to Safari to let you follow a URL to its destination. But I don't think that's possible on most eBooks. -
How do you pass an ActiveX Variant from an external application to LabVIEW?
Background: I created a LabVIEW ActiveX server. I can access it with my external application (Matlab). I have a control variable in my LabVIEW executable. I want to use Active X to set the value of my control variable from my external application.
Documentation: The only reference in the documentation for this task is in the Using ActiveX with LabVIEW in the LabVIEW 2009 help. It simply says "Use the variant control and indicator to pass data to or from ActiveX controls." I also went through all the ActiveX examples in the example finder and did not find any vis that passed variables using ActiveX.
Questions:
What should my control variable look like in LabVIEW? Should it be a refnum, a variant, or a data type? Does it have to be wired to a vi connector?
Do I need to do any magic on this variable, such as change its properties?
How do I pass the value from my external application to the variable in my LabVIEW executable?
Thank you.Hello Lyn,
The control variable should be a refnum and it would have to be wired to Automation Open with the correct reference.
Here are some great examples of using ActiveX Server in LabVIEW
LabVIEW Executable Used as ActiveX Server in LabVIEW
http://decibel.ni.com/content/docs/DOC-9647
Calling ActiveX Code from LabVIEW
http://decibel.ni.com/content/docs/DOC-9073
Andy Chang
National Instruments
LabVIEW Control Design and Simulation -
How to run an external application from PL/SQL code?
Hi,
I want to call an application like "Notepad" from PL/SQL code in a Windows2000 server. Is there any way to do that?
Thanks, best regards.
Paulo.declare
r varchar(4000);
begin
dbms_java.set_output(10000);
system_util.runshell('sh /ora9/runBackup.sh', r);
dbms_output.put_line(r);
end;
System_util package is
CREATE OR REPLACE PACKAGE System_Util IS
*System: Generic
*Package Name: System_util
*Description: This is an open source package which holds regular used
* methods by developers and dba's.
*Created by: Rae Smith
*Created Date: 27/06/2001
*Notes: This ia an free open source package that holds no warranty and
* therefore no-one connected to the development of this package
* can be made reasponsible for any outcomes by it's use.
MODIFICATION LOG**************************************************************
*DETAILS DATE VERS CHANGED BY
*===============================================================================
*Created 27-06-2001 1.0 Rae Smith
/********************************* Public Methhods ***************************************/
--- getDir returns the first directory value held in the init.ora file
FUNCTION getDir RETURN VARCHAR2;
--- getPrev.. returns the prevoise day from a gievn date
FUNCTION getPrevSat(pDate IN DATE) RETURN DATE;
FUNCTION getPrevSun(pDate IN DATE) RETURN DATE;
FUNCTION getPrevMon(pDate IN DATE) RETURN DATE;
FUNCTION getPrevTue(pDate IN DATE) RETURN DATE;
FUNCTION getPrevWed(pDate IN DATE) RETURN DATE;
FUNCTION getPrevThu(pDate IN DATE) RETURN DATE;
FUNCTION getPrevFri(pDate IN DATE) RETURN DATE;
--- isNumber returns TRUE or FALSE depending on a datatype passed
FUNCTION isNumber(pnumber IN VARCHAR2) RETURN BOOLEAN;
FUNCTION isNumber(pnumber IN NUMBER) RETURN BOOLEAN;
FUNCTION isNumber(pnumber IN DATE) RETURN BOOLEAN;
--- The writeFile allow you to write data to a file
--- writeFile has 2 Versions
--- v1 pass in the file name and the text to write to a file.
--- v2 pass in the file name, dbms_sql.varhar2s object
--- and the amount of rows to procces at a time
--- This enables you to write to afile in batch mode
PROCEDURE writeFile(pName IN VARCHAR2, pText IN VARCHAR2);
PROCEDURE writeFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER);
--- The appendFile methods allow you to append data to a file
--- This also has the inteligents to create the file if ts does not exist.
--- appendFile has 2 Versions
--- v1 pass in the file name and the text to write to a file.
--- v2 pass in the file name, dbms_sql.varhar2s object
--- and the amount of rows to procces at a time
--- This enables you to write to afile in batch mode
PROCEDURE appendFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER);
PROCEDURE appendFile(pName IN VARCHAR2, pText IN VARCHAR2);
--- The clearFile clears the data from a file.
PROCEDURE clearFile(pName IN VARCHAR2);
--- checkSyntax is a quick syntax checker for sql statements the is a limit to
--- the size used in the statement. If you have a error with
--- a statement then pass in the statement watch as it displays
--- the point where the error arose.
PROCEDURE checkSyntax(pSql IN VARCHAR2);
--- isEmpty this returns TRUE or FALSE
FUNCTION isEmpty(pValue IN VARCHAR2) RETURN BOOLEAN;
--- getTimeInMins returns the time in minutes for a specified date
FUNCTION getTimeInMins (pDate IN DATE) RETURN NUMBER;
--PROCEDURE get_time_in_mins (pDate IN DATE);
--- incDate returns a specified date incremented by value
FUNCTION incDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE;
--- decDate returns a specified date decremented by value
FUNCTION decDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE;
--- getTime returns the time in milliseconds
FUNCTION getTime RETURN NUMBER;
--- daysDiff returns the amount of days between two values
FUNCTION daysDiff(pHigh IN DATE, pLow IN DATE) RETURN NUMBER;
--- difference returns the diffeence between two numbers always
--- taking the lowest away from the highest
FUNCTION difference(pAnum IN NUMBER,pBnum IN NUMBER)RETURN NUMBER;
--- total returns the value of two numbers added together
FUNCTION total(pAnum IN NUMBER, pBnum IN NUMBER)RETURN NUMBER;
--- numberToWords returns the string for a number passed in
FUNCTION numberToWords(pNumb IN NUMBER) RETURN VARCHAR2;
--- runShell allows you to run operating commands from pl/sql
--- Only available with 8i
--- PROCEDURE runShell(pCmnd IN VARCHAR2, pErrMsg IN OUT VARCHAR2);
/**************************** Public Vaiables *******************************/
--- Public variable that holds the operating system directory
--- that the can be written to from withing the database.
vDir VARCHAR2(50);
END;
CREATE OR REPLACE PACKAGE BODY System_Util IS
FUNCTION getDir RETURN VARCHAR2
IS
BEGIN
RETURN vDir;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...System_Util.getDir');
RAISE;
END getDir;
/**** Private module to get the first directory for utl_file to use ****/
PROCEDURE getDir
IS
CURSOR cDir(p1 IN VARCHAR2)
IS
SELECT DECODE(INSTR(value, ','), 0, value, SUBSTR(value, 1, INSTR(value, ',')-1)) dir
FROM v$parameter
WHERE name = p1;
BEGIN
FOR rDir IN cDir('utl_file_dir') LOOP
vDir := rDir.dir;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...System_Util.getDir');
RAISE;
END getDir;
FUNCTION getPrevDate(pDate IN DATE, pDay IN VARCHAR2) RETURN DATE
IS
BEGIN
RETURN NEXT_DAY(pDate - 7, pDay);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevDate;
FUNCTION getPrevSat(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'saturday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevSat;
FUNCTION getPrevSun(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'sunday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevSun;
FUNCTION getPrevMon(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'monday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevMon;
FUNCTION getPrevTue(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'tuesday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevTue;
FUNCTION getPrevWed(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'wednesday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevWed;
FUNCTION getPrevThu(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'thursday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevThu;
FUNCTION getPrevFri(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'friday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevFri;
FUNCTION isNumber(pNumber IN VARCHAR2) RETURN BOOLEAN
IS
BEGIN
IF TO_NUMBER(pNumber)> 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END isNumber;
FUNCTION isNumber(pNumber IN NUMBER) RETURN BOOLEAN
IS
BEGIN
IF TO_NUMBER(pNumber) > 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END isNumber;
FUNCTION isNumber(pNumber IN DATE) RETURN BOOLEAN
IS
BEGIN
IF TO_NUMBER(TO_CHAR(pNumber, 'YYYYMMDD')) > 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END isNumber;
PROCEDURE writeFile(pName IN VARCHAR2, pText IN VARCHAR2)
IS
vFtype utl_file.file_type;
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName,'w');
UTL_FILE.PUT_LINE(vFtype,pText);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
UTL_FILE.FCLOSE(vFtype);
RAISE;
END writeFile;
PROCEDURE writeFile(pName IN VARCHAR2, pText IN VARCHAR2, pFtyp IN OUT utl_file.file_type)
IS
vFtype utl_file.file_type;
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName,'w');
UTL_FILE.PUT_LINE(vFtype,pText);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
UTL_FILE.FCLOSE(vFtype);
RAISE;
END writeFile;
PROCEDURE writeFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER)
IS
vFtype utl_file.file_type;
vText VARCHAR2(2000);
vCnt BINARY_INTEGER;
vRem BINARY_INTEGER;
vRowcnt PLS_INTEGER := 0;
BEGIN
vRem := MOD(pText.COUNT, pRows);
vFtype := UTL_FILE.FOPEN(vDir, pName, 'w');
vCnt := pText.FIRST;
LOOP
EXIT WHEN vCnt IS NULL;
vRowcnt := vRowcnt + 1;
IF vCnt = pText.LAST THEN
vText := vText||pText(vCnt);
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF MOD(vCnt, pRows) = 0 THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF vRowcnt = vRem THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
ELSE
vText := vText||pText(vCnt)||'\n';
END IF;
vCnt := pText.NEXT(vCnt);
END LOOP;
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...SYSTEM_UTIL.WRITE_FILE');
UTL_FILE.FCLOSE(vFtype);
RAISE;
END writeFile;
PROCEDURE appendFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER)
IS
vFtype utl_file.file_type;
vText VARCHAR2(2000);
vCnt BINARY_INTEGER;
vRem BINARY_INTEGER;
vMode VARCHAR2(2) := 'a';
vRowcnt PLS_INTEGER := 0;
BEGIN
vRem := MOD(pText.COUNT, pRows);
vFtype := UTL_FILE.FOPEN(vDir, pName, vMode);
vCnt := pText.FIRST;
LOOP
EXIT WHEN vCnt IS NULL;
vRowcnt := vRowcnt + 1;
IF vCnt = pText.LAST THEN
vText := vText||pText(vCnt);
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF MOD(vCnt, pRows) = 0 THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF vRowcnt = vRem THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
ELSE
vText := vText||pText(vCnt)||'\n';
END IF;
vCnt := pText.NEXT(vCnt);
END LOOP;
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
IF vMode = 'a' THEN
writeFile(pName, pText, pRows);
ELSE
RAISE;
END IF;
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...SYSTEM_UTIL.APPENDFILE');
UTL_FILE.FCLOSE(vFtype);
RAISE;
END appendFile;
PROCEDURE appendFile(pName IN VARCHAR2, pText IN VARCHAR2)
IS
vFtype utl_file.file_type;
vMode VARCHAR2(2) := 'a';
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName, vMode);
UTL_FILE.PUTF(vFtype, pText);
UTL_FILE.FFLUSH(vFtype);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
IF vMode = 'a' THEN
writeFile(pName, pText);
ELSE
RAISE;
END IF;
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...SYSTEM_UTIL.APPENDFILE');
UTL_FILE.FCLOSE(vftype);
RAISE;
END appendFile;
PROCEDURE clearFile(pName IN VARCHAR2)
IS
vFtype utl_file.file_type;
vText VARCHAR2(2000);
vCnt BINARY_INTEGER;
vRem BINARY_INTEGER;
vRowcnt PLS_INTEGER := 0;
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName, 'w');
UTL_FILE.PUTF(vFtype,'');
UTL_FILE.FFLUSH(vFtype);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...System_Util.CLEARFILE');
UTL_FILE.FCLOSE(vFtype);
RAISE;
END clearFile;
PROCEDURE checkSyntax(pSql IN VARCHAR2)
IS
sqlCur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
errPos PLS_INTEGER;
sqlStmt VARCHAR2(2000);
BEGIN
sqlStmt := pSql;
DBMS_SQL.PARSE(sqlCur, sqlStmt, DBMS_SQL.NATIVE);
EXCEPTION
WHEN OTHERS THEN
errPos := DBMS_SQL.LAST_ERROR_POSITION;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
DBMS_OUTPUT.PUT_LINE(sqlStmt);
DBMS_OUTPUT.PUT_LINE(' ');
DBMS_OUTPUT.PUT_LINE(LPAD('^', errPos, '-'));
DBMS_SQL.CLOSE_CURSOR(sqlCur);
END checkSyntax;
FUNCTION isEmpty(pValue IN VARCHAR2) RETURN BOOLEAN
IS
BEGIN
IF pValue IS NULL OR pValue = '' OR pValue = ' ' THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END isEmpty;
FUNCTION getTimeInMins (pDate IN DATE) RETURN NUMBER
IS
vHours NUMBER;
vMins NUMBER;
vRetval PLS_INTEGER;
BEGIN
vHours := TO_NUMBER(TO_CHAR(pDate,'HH24'));
vMins := TO_NUMBER(TO_CHAR(pDate,'MI'));
vRetval := ((60 * vHours) + vMins);
RETURN vRetval;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getTimeInMins;
PROCEDURE getTimeInMins (pDate IN DATE)
IS
vHours NUMBER;
vMins NUMBER;
vRetval PLS_INTEGER;
BEGIN
vHours := TO_NUMBER(TO_CHAR(pDate,'HH24'));
vMins := TO_NUMBER(TO_CHAR(pDate,'MI'));
vRetval := ((60 * vHours) + vMins);
DBMS_OUTPUT.PUT_LINE('The time IN minutes IS: '||vRetval);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getTimeInMins;
FUNCTION incDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE
IS
BEGIN
RETURN (TO_DATE(TO_CHAR(pDate + pInc, 'DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YYYY HH24:MI:SS'));
EXCEPTION
WHEN OTHERS THEN
RAISE;
END incDate;
FUNCTION decDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE
IS
BEGIN
RETURN (TO_DATE(TO_CHAR(pDate - pInc, 'DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YYYY HH24:MI:SS'));
EXCEPTION
WHEN OTHERS THEN
RAISE;
END decDate;
FUNCTION getTime RETURN NUMBER
IS
BEGIN
RETURN dbms_utility.get_time;
END getTime;
FUNCTION daysDiff(pHigh IN DATE, pLow IN DATE) RETURN NUMBER
IS
vHighdate DATE;
vLowdate DATE;
BEGIN
IF pHigh > pLow THEN
vHighdate := TO_DATE(TO_CHAR(pHigh, 'YYYYMMDD'), 'YYYYMMDD');
vLowdate := TO_DATE(TO_CHAR(pLow, 'YYYYMMDD'), 'YYYYMMDD');
ELSIF pLow > pHigh THEN
vHighdate := TO_DATE(TO_CHAR(pLow, 'YYYYMMDD'), 'YYYYMMDD');
vLowdate := TO_DATE(TO_CHAR(pHigh, 'YYYYMMDD'), 'YYYYMMDD');
END IF;
RETURN (vHighdate - vLowdate);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END daysDiff;
PROCEDURE dateCheck(pDateFrom IN OUT DATE, pDateTo IN OUT DATE)
IS
/* Declare the variable to hold the "from" date */
vDateFrom DATE;
BEGIN
/* If either date_from or date_to is null then set to todays date **
** using the sysdate **
** today's DATE AND IN the correct format */
pDateFrom := NVL(pDateFrom, SYSDATE);
pDateTo := NVL(pDateTo, SYSDATE);
/* Check that the from date is not greater than the to date if so **
** use the system_util.incDate to Increment the date by 1 day */
IF (pDateFrom > pDateTo) THEN
vDateFrom := pDateFrom;
pDateTo := System_Util.incDate(1, vDateFrom);
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
/* calculates the difference of two numbers always taken the high from the low*/
FUNCTION difference(pAnum IN NUMBER, pBnum IN NUMBER)RETURN NUMBER
IS
vTotal NUMBER;
BEGIN
IF (pAnum > pBnum )OR (pAnum = pBnum)THEN
vTotal := (pAnum - pBnum);
ELSIF (pAnum < pBnum) THEN
vTotal := (pBnum - pAnum);
END IF;
RETURN (vTotal);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END difference;
/* calculates the Total of two numbers*/
FUNCTION total(pAnum IN NUMBER, pBnum IN NUMBER)RETURN NUMBER
IS
vTotal NUMBER;
BEGIN
vTotal := (pAnum + pBnum);
RETURN (vTotal);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END total;
FUNCTION numberToWords(pNumb IN NUMBER) RETURN VARCHAR2
IS
vRetval VARCHAR2(255);
vNumb PLS_INTEGER;
BEGIN
vNumb := pNumb;
vRetval := REPLACE(TO_CHAR(TO_DATE(vNumb,'j'),'jsp'),'-',' ');
RETURN (vRetval);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
/*************** Only Available on 8i ********************************\
FUNCTION Catcherr(pStr IN VARCHAR2) RETURN VARCHAR2
IS
LANGUAGE JAVA
NAME 'catchErr.run(java.lang.String) return String';
PROCEDURE runShell(pCmnd IN VARCHAR2, pErrMsg IN OUT VARCHAR2)
IS
BEGIN
pErrMsg := Catcherr(pCmnd);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END runShell;
BEGIN
getDir;
END; -
Running LV application from remote panel which measures FP through different LAN
My LabVIEW application is running in a PC and it takes measurements from the FieldPoint modules which are connected via the FP-1601 network module.
I want to view and execute the application from another PC using remote panel option. The master PC has two LAN connections, one seperate connection for the FieldPoint module and the second one to connect with other PCs.
But the application returns error while initializing the FP modules when executed from remote panel.
Will the application be able to communicate and take measurements from the FieldPoint module in this case? Please explain.
Thanks for the help and awaiting earlier response.
Thank you,
RajeswariIn principle this I believe this is a TCP/IP routing issue.
If your fieldpoint unit is connected to one card lets say
Card 01 Host 10.0.0.1 255.255.255.0 ---- Fieldpoint 10.0.0.2 255.255.255.0
Card 02 Host 168.95.0.1 255.255.0.0 ---- Lan 168.95.x.x 255.255.0.0
The routing in the host takes care of which card is used for which network segment.
My guess is that you have not seperated the network segments as shown above.
Is this correct ? -
Run External application without Exiting main application
Hi,
I am trying to implement a function that executes the external program from within my java application. I am using windows xp. I had googled for this and found some code but so far I am able to run the application in a condition if my main application exits. Instead I want to run the application without exiting my main application. How can I do that:
Code I am using is:
========================
try{
Runtime.getRuntime().exec("external program");
System.exit(0);
catch (Exception err){
err.printStackTrace();
System.exit(-1);
=========================
my problem is I cannot run the external program without the line "System.exit(0)". If I remove that line, the external program only starts after I exit my main java application. Is there a way to run the external application without leaving the main application?
By the way I am using the latest version of JDK 6 update 2 and Netbeans 5.5.1
ThanksI tried and I tried and I couldn't make the same problem occur unless I specfically had a long task execute BEFORE calling the runtime command. See the code below:
I tried a bunch of things, including having a GUI run before the Runtime call, after the runtime call. Neither affected the movie from being played.
I tried with different versions of the runtime command, none of it made a problem.
I tried running the application with a long task that would keep the main thread busy for a while AFTER I launched mplayer - no problem.
The only thing that made the app work the way you describe was when I built the long task that keeps the main thread active for a while BEFORE I launched mplayer (which is the state of the code as I pasted it below).
So my guess is that you have a single threaded application and you add the call to mplayer at the very end of your program's execution - thus it doesn't get called until the last thing. My suggestions:
1) Move the call to the Start of your code, not the end
2) Move your other work to a new thread so that it can be kicked off without holding the main thread in check.
package movies;
import inheritance.BaseWindow;
import java.util.*;
import java.io.*;
class StreamGobbler extends Thread
InputStream is;
String type;
OutputStream os;
StreamGobbler(InputStream is, String type)
this(is, type, null);
StreamGobbler(InputStream is, String type, OutputStream redirect)
this.is = is;
this.type = type;
this.os = redirect;
public void run()
try
PrintWriter pw = null;
if (os != null)
pw = new PrintWriter(os);
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line=null;
while ( (line = br.readLine()) != null)
if (pw != null)
pw.println(line);
System.out.println(type + ">" + line);
if (pw != null)
pw.flush();
} catch (IOException ioe)
ioe.printStackTrace();
public class MyMainClass
public static void main(String args[]) throws InterruptedException
//This is just a GUI as a test
BaseWindow bw = new BaseWindow();
bw.show();
//Keep App Running for a while
int count = 0;
while (count < 200) {
Thread.sleep(20);
count++;
System.err.println(count);
if (args.length != 1)
System.out.println("USAGE java movies.MyMainClass \"<movie to play>\"");
System.exit(1);
try
Runtime rt = Runtime.getRuntime();
//String[] cmds = new String[] { "cmd", "/c", "C:\\Mplayer\\mplayer.exe", args[0]};
//String[] cmds = new String[] { "C:\\Mplayer\\mplayer.exe", args[0]};
//Process proc = rt.exec(cmds);
Process proc = rt.exec("C:\\Mplayer\\mplayer.exe "+args[0]);
// any error message?
StreamGobbler errorGobbler = new
StreamGobbler(proc.getErrorStream(), "ERROR");
// any output?
StreamGobbler outputGobbler = new
StreamGobbler(proc.getInputStream(), "OUTPUT");
// kick them off
errorGobbler.start();
outputGobbler.start();
//Keep App Running for a while
// int count = 0;
// while (count < 2000000) {
// Thread.sleep(200);
// count++;
// System.err.println(count);
// any error???
int exitVal = proc.waitFor();
System.out.println("ExitValue: " + exitVal);
} catch (Throwable t)
t.printStackTrace();
}I will restate myself:
"I was not able to repeat the problem, except as described, as long as I took the hints mentioned in the article I posted into account and actually put them into action."
Of course, as soon as I ignored those hints, I was able to reproduce the error described above quite easily in all the different tests I made... But I guess the OP implemented those fixes, right? He did say he read the article...
Message was edited by:
stevejluke -
Running external program from Form6i
I have a Form 6i, client server application and from there I launch a window based help system, using Host command.
Is it possible to run both the form application and the help program togather at the same time. As at the moment I need to close the help program to start using my Form based application.
Regards
EVAHi,
I had a similar query and got the following reply and it looks better. Attaching it for ur reference and hope it will help u.
Thx.
R. Magesh.
Magesh
unregistered posted May 15, 2001 08:25 AM
Hi,
Thx. for ur reply but I am already using the same host command and it is working fine. But we do have some problems in using the host command like u need to close the external application or o/s based application before working back in forms and also that I would like to use a generic html tag which can be opened in any default browser defined for the system rather than mentioning or invoking explorer explicitly. I am looking for any new builtin available in FORMS6I which can support web integration with the application.
Thx.
R. Magesh
quote:
Originally posted by Fan Liu ([email protected]):
try this:
http:
host('explorer http://www.oracle.com');
email:
host('explorer mailto:[email protected]');
IP: Logged
Duncan Mills ([email protected])
unregistered posted May 15, 2001 09:14 AM
If you want to start a Host type command Asynchronously then you can use DDE.APP_BEGIN or the WinExec call in the D2KWUTIL library.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Eva Maria Villoria ([email protected]):
I have a Form 6i, client server application and from there I launch a window based help system, using Host command.
Is it possible to run both the form application and the help program togather at the same time. As at the moment I need to close the help program to start using my Form based application.
Regards
EVA <HR></BLOCKQUOTE>
null -
Run external executable from script
Hi,
it's possible launch an external executable (Es. .\smsclient.exe "3201234567" "SMSClient.exe Tested on %date% at %time%") from script .aef (not from CAD)?Hi Anthony,
i have developed a Java class how you said me. I receive the sms, if run application from Eclipse. But if I invoke this class from script .aef not operate. For an simply example i have also created an Notepad example but not open pop up with notepad but also in this case if I run application from Eclipse all correctly function.
Above there is my script and java source for Notepad example.
Have you any suggestion?
***************************************SCRIPT testNOTEPAD.AEF********************************
Start
Do
testpackage.Notepad AA = new testpackage.Notepad();
End
In console i read this output:
Begin Debugging C:\UCCX_Script_Esempi\TestNotepad.aef...
when i stop debug:
Done Debugging C:\UCCX_Script_Esempi\TestNotepad.aef.
but Nptepad.exe not running
*******************************************JAVA SOURCE ********************************************
package testpackage;
import java.io.*;
public class Notepad {
public static void Main(String args[]) {
try {
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("notepad.exe");
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line=null;
while((line=input.readLine()) != null) {
System.out.println(line);
int exitVal = pr.waitFor();
System.out.println("Exited with error code "+exitVal);
} catch(Exception e) {
System.out.println(e.toString());
e.printStackTrace(); -
Getting error while running external application
Hi Everyone,
I am using JDeveloper 11.1.1.4. I am trying to run an external application for accessing ZOHO Mail. For this first i created an external application with the details of Login url, Username & Password. Then I embeded this external application to jsf. While running this file i am getting message like " user anonymous not authorized to access external application ZohoMail " in browser. Did i do wrong anything ? ? Please provide information regarding this issue.
Thanks in advance.
Regards,
SEWSupportHi,
I created a web application and right click on the project --> new --> General --> ExternalApplications --> ExternalApplication.
In the ExternalApplication registration I declared application name then in step2 I entered LoginURL as http://mail.zoho.com/biz/index.do, Username as LOGIN-ID and Password as PASSWORD. Then i clicked on next --> next --> Finish.
After that i created one jsf page and drag and drop that external application into jsf.
Then run that jsf file, While running the error message is getting in browser.
Thanks,
SEWSupport -
SQLE_COMMUNICATIONS_ERROR while running SFA application from Visual Studio
Hi,
I am trying the SFA (Sales Force Automation) example.
I am using the Windows Mobile 6.0 emulator from Visual Studio to run the application.
When I go to the "Configure" button, change the configuration values and try to Save, I am getting the following error.
=======
SQLE_COMMUNICATIONS_ERROR
iAnywhere.Data.UltraLite.ULException: SQLE_COMMUNICATIONS_ERROR at iAnywhere.Data.UltraLite.ULConnection.RuntimeError(IntPtr natKey, ULSQLCode code, Object p0, Object p1, Object p2) at iAnywhere.Data.UltraLite.ULConnection.RuntimeError(ULSQLCode code) at iAnywhere.Data.UltraLite.ULConnection.Synchronize() at SalesForceAutomation.SalesForceAutomationDB.Synchronize(String synchronizationGroup, SyncStatusListener listener) at SalesForceAutomation.SalesForceAutomationDB.Synchronize() at SalesForceAutomation.FormConfiguration.menuItem1_Click(Object sender, EventArgs e) at System.Windows.Forms.MenuItem.OnClick(EventArgs e) at System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam) at System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam) at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam) at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) at System.Windows.Forms.Application.Run(Form fm) at SalesForceAutomation.Program.Main() Details: StreamErrorCode = SOCKET_CONNECT StreamErrorSystem = 10061 StreamErrorParameters =
======
I am unable to sort out this.
Any help would be highly appreciated.
Thanks in advance.
Regards,
Ram.Hi,
Finally I fixed this issue.
I ran the SybaseServerSync.v35.CAB on the device emulator. Then tried the program. It worked. This helps establish the synchronization between the device and the SUP server. This CAB file can be located at the path <UnwiredServerInstallationLocation>\UnwiredPlatform\ClientAPI\RBS\WM\ServerSync.
Regards,
Ram. -
Closing Console window while running Java application from Batch file
Hi all,
I have made a small application using Java swings,now i have made a jar file of my application and calling this jar file through batch file,when user clicks on that batch file it runs "java -jar applicationname.jar" command,but problem is that when i run that file from batch file it opens Dos console window at baclk of the screen which looks weird for a desktop application,i dnt want that Dos console window visible at the backend while my application is running,i have searched regarding this on google but found nothing usefull,if anybody can please help regarding that it will be a great releif for me,i have been stuck on this problem from last two days.
Thanks.
Simerwarnerja wrote:
georgemc wrote:
warnerja wrote:
start java -jar applicationname.jar
That'll pop up another consoleI'm under the impression that the console window he is seeing is the one which cmd.exe opens when it is executing the batch file. And that batch file won't return until the java process has completed because he didn't start it in the background to let the batch file continue and terminate.
So I don't think just simply substituting java with javaw will do much good either. Still think he needs a "start" command in that batch file.
So now he can try:
start java -jar ...
or
start javaw -jar ...Fair point
Maybe you are looking for
-
Logs de XML não processado no NF-e incoming
Olá pessoal, Estou precisando saber alguma forma de descobrir o que aconteceu com um xml enviado pelo fornecedor e que não aparece no monitor "NF-e centro de trabalho fiscal". Hoje quando um xml não aparece eu fico sem saber se tem algum serviço para
-
Could someone help please? I've been using Installer to download some packages offered for IPhone. After several downloads, my existing Icons on the Iphone started to disappear as they were replaced by the new downloaded packegaes. The main problem i
-
How to make Adobe Flash Player run faster
how do you make adobe flash player run faster my child has a game and the game is running to slow to play/use some of the features please please help
-
Cast Exception from EJB returning Collection
Still can't understand why I'm getting a cast exception when I call an object method when the object has been returned in a Collection from an EJB. The object CountryModel is a serialised object, returned in a Collection from home.findAllCountries...
-
WebDynpro Exception: ADS: Request start time
I am running Interactive form through WebDynpro for ABAP in SE80 Tcode . while running i am stuck here. The following error text was processed in the system CRM : WebDynpro Exception: ADS: Request start time: Fri Jun 19 03:40:47 CDT 2009(200.101). Th