steps to work with Concurrent program in Oracle apps - concurrency

If I create the PL/SQL procedure in oracle SQl Developer, then how to access that PL/SQL procedure in Oracle Application. Also I need the steps to work with the concurrent program in oracle application so that when I run the executable file in the oracle Application, I should get the output in the oracle SQL developer for the executed procedure in the Oracle Application.

CREATE OR REPLACE PACKAGE sample AS
procedure demo(errbuf out NOCOPY varchar2,
retcode out NOCOPY varchar2);
END sample;
/
CREATE OR REPLACE PACKAGE BODY sample AS
procedure demo(errbuf out NOCOPY varchar2,
retcode out NOCOPY varchar2)
is
begin
--
-- If you want to write some output call:
--
FND_FILE.put_line(FND_FILE.output,'Starting processing:');
--
-- NOTE:
-- to write to log use FND_FILE.log instead of FND_FILE.output
--
--
FND_FILE.put_line(FND_FILE.output,'Done!');
commit;
-- Return 0 for successful completion.
errbuf := '';
retcode := '0';
exception
when others then
errbuf := sqlerrm;
retcode := '2';
end demo;
END sample;
Login-to Oracle applications
1. Define Executable
NAVIGATE:
Concurrent ->
Program ->
Executable:
Executable: sample_demo
Short name: asample_demo
Application: Application Object Library ---change to your requirement
Description: Demonstration of APPS pl/sql concurrent program
Exe Method: PL/SQL Procedure
Exe File Name: sample.demo
2. Define Program
NAVIGATE:
Concurrent ->
Program ->
Define:
Program: Demonstration of APPS pl/sql concurrent program
Short Name: PACKAGE_PROCEDURE
Application: Application Object Library
Executable: asample_demo
3. Add Program to the SYSADMIN Responsibility REPORT Group
NAVIGATE:
Security ->
Responsibility ->
Requests
Query for "System Administrator Reports" Group --using F11 and Ctrl+F11
In the Requests detail-form add the following row:
Type: Program
Name: Demonstration of APPS pl/sql concurrent program
You can now run this pl/sql package.procedure through APPS Concurrent Manager.
4. Run Program from Standard Request Submission
Go to SRS(Standard Request Submission) submit your program
:-)

Related

Checks not running on every file (when running -a) even though they are parsed

Summary of the problem
I've setup a repository with the checks I developed, designed to be used exclusively in an another repository.
The problem I've been facing is that when I run pre-commit run -a -v the checks don't go through every file, and time to time they even change!
A little more details
I've run the [identity][1] check and it prints every file in the repo, meaning the files are read by pre-commit (per my understanding)
When I execute pre-commit run the file in staging are correctly parsed
Why do i think that the checks don't run on every file?
I always print something to the standard output for every check, and when I run it verbosely it only prints 5 to 7 lines, meaning it checked only those.
If I try and edit a file (breaking a check) whose not on the short list, the check still passes through
Some code
The structure of the folder containing the files to be checked
./
articles/
some_name/
file.md
file.png
and_so_on.jpeg
team/
some_other_name/
file.md
propic.jpg
Summary of the .pre-commit-hooks.yaml
- id: team-check-name
name: blabla
description: blabla
entry: team-checkname
files: 'team/.*/'
types: [markdown]
language: python
- id: article-check-name
name: blabla
description: blabla
entry: article-checkname
files: 'articles/.*/'
types: [markdown]
language: python
Essentially the checks supposed to run on articles/.*/ start with article- and they all have this property: files: 'articles/.*/'.
Similarly every check supposed to run on team/.*/ starts with team- and they all have files: 'team/.*/'
Summary of the .pre-commit-config.yaml
repos:
- repo: https://github.com/repourl
rev: commit_hash
hooks:
- id: team-check-name
- id: article-check-name
But as you can see, I don't override any settings so it shouldn't interfere
the hook tools you've written are incorrect -- they only process sys.argv[1] rather than positional arguments
your code uses a lot of global variables so it's not a straightforward refactor -- typically you'd either use argparse to collect nargs='*' or loop over sys.argv[1:] (if you don't have any options)
as to why this is the convention -- it's very wasteful to start a linter process over and over to lint a single file (often times executable startup cost dwarfs the actual linting / formatting process)
disclaimer: I wrote pre-commit

sas error: hpspit was unable to open the rules file for output

I am getting the below error when i am running 'proc hpsplit' in sas to create a decision tree.
sas error: hpspit was unable to open the rules file for output
My code is -
proc hpsplit data=sashelp.hmeq maxdepth=7 maxbranch=2;
target BAD;
input DELINQ DEROG JOB NINQ REASON / level=nom;
input CLAGE CLNO DEBTINC LOAN MORTDUE VALUE YOJ / level=int;
criterion entropy;
prune misc / N <= 6;
partition fraction(validate=0.2);
rules file='hpsplhme2-rules.txt';
score out=scored2;
run;
But if I change the statement 'rules file' declaration to the below -
rules file="%sysfunc(pathname(work))/rule.txt";
It runs fine in this case but then i am unable to view the rule.txt file.
Please suggest a way i can view the file or any other way i can proceed.
rules file='hpsplhme2-rules.txt'; will not necessarily write to work; it depends on what your default directory is in the current session. It's usually not WORK in my experience. If you're running SAS in DM mode it's whatever is in the bottom right of the window (for my installation the default is my User directory, i.e. C:\Users\myusername). But it can be anywhere, just depends on where your admin set it up to be, and if you executed any cd commands in the code.
The answer here is to fully qualify your path name. If you're running this on a server, make sure that path is a path you can write to from the server (not "c:\something" probably).
It could be as simple as
options noxwait noxsync xmin;
%sysexec
start
"Preview output"
"%sysfunc(pathname(WORK))\temp.txt"
;
If simple does not work the solution depends on your SAS client and the SAS host security policies.

In Inno Setup installer, uninstall installation made by InstallShield LE

Since the InstallShield LE isn't supported by VS 2017 I'm trying to use Inno Setup instead.
But how can I uninstall previous installations made by InstallShield LE before installation starts using Inno Setup script.
There are multiple versions of the application installed at different users (not on the same computer).
Since the Product Code changes between versions, the GUID in Uninstall registry key can be different and because of that it is hard to find in the uninstall part of registry.
You can use the code from Inno Setup: How to automatically uninstall previous installed version?
While code in the answers is for uninstalling a previous versions installed by Inno Setup, it's mostly generic enough to work with any previous uninstall system.
To make it work with InstallShield, you need to know a Product Code of the release you want to uninstall. If you need to be able to remove any release, you can lookup the Product Code of the actually installed release using the Upgrade Code. For that, you can use a WMI query:
How to find the UpgradeCode and ProductCode of an installed application in Windows 7.
In Inno Setup Pascal Script the code can be like:
const
InstallShieldUpgradeCode = '{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}';
function InitializeSetup(): Boolean;
var
WbemLocator, WbemServices, WbemObjectSet: Variant;
Query: string;
ProductCode: string;
begin
WbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
WbemServices := WbemLocator.ConnectServer('.', 'root\CIMV2');
Query :=
'SELECT ProductCode FROM Win32_Property ' +
'WHERE Property="UpgradeCode" AND Value="' + InstallShieldUpgradeCode + '"';
WbemObjectSet := WbemServices.ExecQuery(Query);
if not VarIsNull(WbemObjectSet) and (WbemObjectSet.Count > 0) then
begin
ProductCode := WbemObjectSet.ItemIndex(0).ProductCode;
{ Start uninstall here }
end;
Result := True;
end;
Though note that the query can take tens of seconds.
When I wrote the sample script and the related blog post, it was quite clear that you should query the registry to detect previous installed software,
function InitializeSetup(): Boolean;
var
oldVersion: String;
uninstaller: String;
ErrorCode: Integer;
begin
if RegKeyExists(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F768F6BA-F164-4599-BC26-DCCFC2F76855}_is1') then
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F768F6BA-F164-4599-BC26-DCCFC2F76855}_is1',
'DisplayVersion', oldVersion);
if (CompareVersion(oldVersion, '6.0.0.1004') < 0) then
begin
if MsgBox('Version ' + oldVersion + ' of Code Beautifier Collection is already installed. Continue to use this old version?',
mbConfirmation, MB_YESNO) = IDYES then
begin
Result := False;
end
else
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F768F6BA-F164-4599-BC26-DCCFC2F76855}_is1',
'UninstallString', uninstaller);
ShellExec('runas', uninstaller, '/SILENT', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := True;
end;
end
else
begin
MsgBox('Version ' + oldVersion + ' of Code Beautifier Collection is already installed. This installer will exit.',
mbInformation, MB_OK);
Result := False;
end;
end
else
begin
Result := True;
end;
end;
Your InstallShield based installer should also insert a GUID based subtree to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\, so just analyze what has been there and take necessary actions to uninstall it.
A more recent blog post can be found here.

Calling PLsql script with an anonymous PL SQL block from SOCI

I'm searching for a way to call an anonymous PLsql block through SOCI. The data transfer takes place through a refcursor that was previously created as a variable in the script:
variable rc refcursor
declare
v_obj_id number(4,0) := 1;
v_obj_def varchar(30);
v_obj_type number := 1;
begin
open :rc for
select v_obj_id, OBJ_DEF_ID
from MY_OBJECT_DEFS
where OBJECT_TYPE = v_obj_type;
end;
I need to read the refcursor from my application to retrieve the data. I tried to execute the above through a soci::statement but it gives me the error: ORA-24333: zero iteration count. The PLsql script works fine when executed in SqlPlus.
How can I make the connection between the statement and the
refcursor rc? Should I use some other SOCI construct (other than statement) for this purpose?
I understand there are two instructions in the above
script; (i. the refcursor creation, ii. the anonymous PLsql block
itself). I'm not sure whether its possible to call multiple
instructions in a single SOCI statement. Can this be confirmed?
Following is the what I tried. The sSQL contains the above PLsql script:
dbConn.open("...");
int iObjId;
std::string iObjDefId;
soci::indicator ind_iObjId = soci::i_ok,
ind_iObjDefId = soci::i_ok;
soci::statement stmt(dbConn);
stmt.alloc();
stmt.prepare(sSQL);
stmt.exchange(soci::into(iObjId, ind_iObjId));
stmt.exchange(soci::into(iObjDefId, ind_iObjDefId));
stmt.define_and_bind();
stmt.execute(false);
while (stmt.fetch())
{
if (soci::i_ok == ind_iObjId)
std::cout << "Obj ID: " << iObjId << std::endl;
if (soci::i_ok == ind_iObjDefId)
std::cout << "Obj Def ID: " << iObjDefId << std::endl;
}
EDIT: I'm using Oracle 11g
The statement variable rc refcursor is neither SQL nor PL/SQL but part of Oracle's SQL*Plus command-line utility and compatible third party products. I don't know C++ but presumably you would need to define a ref cursor object in the host program.
If this is not feasible, and you are on Oracle 12.1 or later, it's possible that you could use an implicit result set construction, along the lines of
declare
rc sys_refcursor;
begin
open rc for select * from dual;
dbms_sql.return_result(rc);
end;
as discussed in Is it possible to output a SELECT state from a PL/SQL block?

Crystal Reports seems to have an 80 section per group limit

Crystal Reports seems to have an 80 section per group limit
Environment:
Microsoft Windows XP
Professional
Version 2002
Service Pack 3
Crystal Reports XI (Release 1)
Calling the Crystal Reports Engine crpe32.dll version 11.0.0.1445
Via Crystal VCL 11 libraries
Via Borland C++Builder 6 Enterprise Suite Version 6.0 (Build 10.166)
I found the report containing 86 sections (in one group)
ran just fine using the Crystal Reports XI exe found at
C:\Program Files\Business Objects\Crystal Reports 11\crw32.exe
However, when I called the same report from an executable compiled
using Borland C++Builder -> VCL calls -> crpe32.dll
IT DID NOT PRINT.
I spent many frustrating hours debugging the exe.
I used the divide and conquer debugging approach and devised
a state machine that would do the following while logging every
state along the way:
Load the Engine via LoadEngine;
Open the Engine via OpenEngine;
Open the PrintJob via OpenJob;
Close the PrintJob via CloseJob;
Close the Engine via CloseEngine;
Unload the Engine via UnloadEngine;
I found that the report errored out at OpenJob
with Crpe1->Status() status crsJobFailed
Crpe1->LastErrorNumber() was "505: No print destination specified"
Here's the play by play (I output this to a file):
LoadEngine() started
LoadEngine() completed. The handle to CRPE32.DLL is: 728956928
EngineOpen() started
EngineOpen() completed. Engine is already opened.
JobIsOpen() started.
JobIsOpen() completed. The PrintJob is open.
Execute() started
Status() crsJobFailed
Execute() failed.
Error state.
LastErrorNumber 505: No print destination specified.
C:\REPORTS\ProblemReport.rpt
Please first call PEOutputToWindow or PEOutputToPrinter!
Execute <PEStartPrintJob>
Finished state.
Back to the report:
Deleting some /*comment*/ sections from the report brought the number of
sections down to 78 and voila ... the report printed out just fine from the
executable compiled on Borland C++Builder -> VCL calls -> crpe32.dll
My conclusion:
Avoid creating over 80 sections in a group.
As a workaround, you can add another group having
the same GROUP BY column (essentially, repeat the
same group) and create all the extra sections needed
in the new group (the repeated group).
It's the equivalent of writing the following SQL
SELECT
column1
column1
FROM table
GROUP BY
column1,
column1;
Has anyone else had this problem?
If yes, what solution have you devised?