Problem with HP-UX extended procedures that use C++ Standard library
I am experiencing a problem with using the C++ standard library on HP-UX inside my extended procedures.
Here is the definition for the library and procedures:
-bash-3.2$ more nuhash2.sql
CREATE OR REPLACE LIBRARY xp_nuencryption_l
AS
'/home/jchamber/datasecure/lib/libxp_nuencryption.sl';
CREATE OR REPLACE PACKAGE xp_nuencryption
AS
PROCEDURE xp_nuhash2;
END xp_nuencryption;
CREATE OR REPLACE PACKAGE BODY xp_nuencryption
IS
PROCEDURE xp_nuhash2
IS EXTERNAL
LIBRARY xp_nuencryption_l
NAME "xp_nuhash2"
LANGUAGE C;
END xp_nuencryption;
Here is the PL/SQL test program:
-bash-3.2$ more testnuhash2.sql
SET SERVEROUTPUT ON SIZE 1000000
DECLARE
BEGIN
xp_nuencryption.xp_nuhash2 ();
END;
Here is the implementation of the extended procudure - notice how we are using the C++ Standard library:
-bash-3.2$ more xp_nuhash2.cpp
#include <string.h>
#include <iostream>
#include <fstream>
class MyException {
public:
MyException() {}
int func(std::ofstream& fout )
fout << "func: About to throw exception in func()" << std::endl;
throw MyException();
extern "C"
void xp_nuhash2 ()
std::ofstream fout("/home/jchamber/xp_nuhash2.txt");
try {
fout << "xp_nuhash2: About to call func()" << std::endl;
func(fout);
catch (MyException& ex) {
fout << "xp_nuhash2: caught MyException" << std::endl;
fout << std::flush;
fout.close();
Here is how we build the library on HP-UX:
# compile
aCC -g -AA DA2.0W DS2.0 +z -c xp_nuhash2.cpp -o xp_nuhash.o
#link using aCC
aCC -g -AA DA2.0W DS2.0 +z -b -o /home/jchamber/datasecure/lib/libxp_nuencryption.sl xp_nuhash.o \
/usr/lib/pa20_64/libstd_v2.a \
/usr/lib/pa20_64/libCsup_v2.a
chatr +dbg enable /home/jchamber/datasecure/lib/libxp_nuencryption.sl
Here is how we test:
SQL> @nuhash2
Library created.
Package created.
Package body created.
SQL> @testnuhash2
DECLARE
ERROR at line 1:
ORA-28576: lost RPC connection to external procedure agent
ORA-06512: at "JCHAMBER.XP_NUENCRYPTION", line 0
ORA-06512: at line 3
Now, if i use classic C++ (aCC -AP) it works. The trouble is, we have a lot of code that uses the Standard C++ library and we don't have the time to port it back to classic C++.
The problem seems to be with an incompatibility with the standard C++ library. What is the magic potion of linker and/or compiler switches that would enable my extended procedures to use the standard C++ library?
Here is the environment we are using:
Oracle 9i (64-bit)
HP UX 11.11
Regards
I am experiencing a problem with using the C++ standard library on HP-UX inside my extended procedures.
Here is the definition for the library and procedures:
-bash-3.2$ more nuhash2.sql
CREATE OR REPLACE LIBRARY xp_nuencryption_l
AS
'/home/jchamber/datasecure/lib/libxp_nuencryption.sl';
CREATE OR REPLACE PACKAGE xp_nuencryption
AS
PROCEDURE xp_nuhash2;
END xp_nuencryption;
CREATE OR REPLACE PACKAGE BODY xp_nuencryption
IS
PROCEDURE xp_nuhash2
IS EXTERNAL
LIBRARY xp_nuencryption_l
NAME "xp_nuhash2"
LANGUAGE C;
END xp_nuencryption;
Here is the PL/SQL test program:
-bash-3.2$ more testnuhash2.sql
SET SERVEROUTPUT ON SIZE 1000000
DECLARE
BEGIN
xp_nuencryption.xp_nuhash2 ();
END;
Here is the implementation of the extended procudure - notice how we are using the C++ Standard library:
-bash-3.2$ more xp_nuhash2.cpp
#include <string.h>
#include <iostream>
#include <fstream>
class MyException {
public:
MyException() {}
int func(std::ofstream& fout )
fout << "func: About to throw exception in func()" << std::endl;
throw MyException();
extern "C"
void xp_nuhash2 ()
std::ofstream fout("/home/jchamber/xp_nuhash2.txt");
try {
fout << "xp_nuhash2: About to call func()" << std::endl;
func(fout);
catch (MyException& ex) {
fout << "xp_nuhash2: caught MyException" << std::endl;
fout << std::flush;
fout.close();
Here is how we build the library on HP-UX:
# compile
aCC -g -AA DA2.0W DS2.0 +z -c xp_nuhash2.cpp -o xp_nuhash.o
#link using aCC
aCC -g -AA DA2.0W DS2.0 +z -b -o /home/jchamber/datasecure/lib/libxp_nuencryption.sl xp_nuhash.o \
/usr/lib/pa20_64/libstd_v2.a \
/usr/lib/pa20_64/libCsup_v2.a
chatr +dbg enable /home/jchamber/datasecure/lib/libxp_nuencryption.sl
Here is how we test:
SQL> @nuhash2
Library created.
Package created.
Package body created.
SQL> @testnuhash2
DECLARE
ERROR at line 1:
ORA-28576: lost RPC connection to external procedure agent
ORA-06512: at "JCHAMBER.XP_NUENCRYPTION", line 0
ORA-06512: at line 3
Now, if i use classic C++ (aCC -AP) it works. The trouble is, we have a lot of code that uses the Standard C++ library and we don't have the time to port it back to classic C++.
The problem seems to be with an incompatibility with the standard C++ library. What is the magic potion of linker and/or compiler switches that would enable my extended procedures to use the standard C++ library?
Here is the environment we are using:
Oracle 9i (64-bit)
HP UX 11.11
Regards
Similar Messages
-
Multiple record insert problem in Oracle Procedure that uses a cursor
Dear X-pert guies,
I have a oracle procedure that use a cursor, I repeatedly make query on 1st table using cursor value and insert that queried value(of 1st table) to 2nd table
y_summary. y_summary has composite primary key :PK_Y_SUM (BILL_DATE, TRUNK_MGR, IDD_FLAG, PK_FLAG, PREFIX).*
when i run the procedure explicit2('201001'); the it gives me the error:::: begin explicit2('201001'); end;_
ORA-00001: unique constraint (PRM.PK_Y_SUM) violated_
ORA-06512: at "PRM.EXPLICIT2", line 413_
ORA-06512: at line 1_
but when i remove the composite primary key from y_summary table then, the procedure runs ok and make so many duplicate entries in y_summary.
but i want the single record to be inserted for single time in y_summary ,so You guies are honorly requested to make the required help .
the structure of y_summary Table and Procdure code is given below.
Table:
-- Create table
create table Y_SUMMARY
BILL_DATE VARCHAR2(10) not null,
TRUNK_MGR VARCHAR2(20) not null,
IDD_FLAG VARCHAR2(10) not null,
PK_FLAG NUMBER(2) not null,
OUTCALLS NUMBER(20,2),
OUTDUR NUMBER(20,2),
PREFIX VARCHAR2(10) not null
tablespace TBS_PRM_D01
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
initial 64K
minextents 1
maxextents unlimited
-- Create/Recreate primary, unique and foreign key constraints
alter table Y_SUMMARY
add constraint PK_Y_SUM primary key (BILL_DATE, TRUNK_MGR, IDD_FLAG, PK_FLAG, PREFIX)
using index
tablespace TBS_PRM_D01
pctfree 10
initrans 2
maxtrans 255
storage
initial 64K
minextents 1
maxextents unlimited
Procedure:
create or replace procedure explicit2( month_val in varchar2) is
cursor explicit_cur is select dest_code from y_table where dest_code like '44%' order by dest_code desc;
dummy varchar2(100);
lv_length Number(9);
sqlstr varchar2(2500);
rec_count1 number;
rec_count2 number;
rec_count3 number;
begin
open explicit_cur;
LOOP
fetch explicit_cur into dummy;
EXIT WHEN explicit_cur%NOTFOUND;
rec_count1 :=0;
rec_count2 :=0;
rec_count3 :=0;
lv_length := length(dummy);
sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_1 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
execute immediate sqlstr into rec_count1;
sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_2 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'',
''ITAX1B'',''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
execute immediate sqlstr into rec_count2;
sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_1 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'',
''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''012'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
execute immediate sqlstr into rec_count3;
if(rec_count1>0) then
sqlstr := 'insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
select '|| month_val||' ,substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''00'',''1'' from y_table_data1 t where t.fee_dur_1_1 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||''''|| ' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
execute immediate sqlstr;
commit;
sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_1 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
execute immediate sqlstr;
commit;
end if ;
if(rec_count2>0) then
sqlstr :='insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
select '|| month_val||' ,substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''00'',''0'' from y_table_data1 t where t.fee_dur_1_2 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''00'' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
execute immediate sqlstr;
commit;
sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_2 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
execute immediate sqlstr;
commit;
end if;
if(rec_count3>0) then
sqlstr :='insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
select '|| month_val||',substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''012'',''0'' from y_table_data1 t where t.fee_dur_1_1 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''012'' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
execute immediate sqlstr;
commit;
sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_1 <> 0
and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
and t.service_code = ''012'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
execute immediate sqlstr;
commit;
end if;
end loop;
close explicit_cur;
end explicit2;
Edited by: user10951541 on 25.4.2010 12.08Dear concern
Really sorry not to make format listing because i am amature to this blog.
my anwser to your way .
1. I have Tested my SQL statements manually in SQL*Plus. this runs ok
2. "Cursor loops, such as the one you have coded here, have been obsolete in Oracle since version 8i 12+ years ago.
Look up BULK COLLECT and FORALL in the docs and use them instead."
I am trying to make use of the BULK COLLECT and FORALL statement in proper location.
3. "Your procedure never performs a commit so no work actually takes place" i need to get the anwser why........................?
4. "On what basis was the decision made to use the default PCTFREE and PCTUSED values of 10 and 40?"
is there any problem if default is used..? if any suggestion........pls
5." You did not format your listing using the CODE tags as explained in the FAQ making your listing unreadable ... so I've not read it.
Please read the FAQ and use the proper way to post code so we can understand it. Then perhaps we can help you further. " really sorry not to make understandable to you..? but i will try from next post..
I really will try to be synced..
My aim is to make query to Table A using the cursor value like( '4422','442','4411','441','44') and get some data in accordance of these values.Then i put the data into another Table B. same time i need to delete the record from Table A containing the prefix value in accordance for example- i compute value for '4422' from Table A and put the computed value to Table B .Then i delete the record from Table A where prefix is '4422' .so that computed value for the next prefix '442' should contain the computed value for 442[0-1] and 442[3-9] .Same way it will be happened for ('4411','441','44'....bla...bla).
Thanks in advance.. -
Question
I have problem since I download fire fox 4 it doesn't remember my windows live ID, only the last one with are 4 different people that use the computerSuch a feature is stored in a cookie. Firefox only keeps one set of cookies for all open tabs. So only the last user is remembered.
You can look this extension if you want to sign on with different identities at the same time:
* Multifox: http://br.mozdev.org/multifox/ (for Firefox 4 use this link: Firefox 4? Try Multifox 2 Beta 1!) -
Issue with a stored procedure that uses a sys refcursor to output dataset..
Hi All:
I create a stored procedure that uses an in out sys ref cursor:
create or replace procedure FIRE_SALES_100_CALLS_REPORT
( p_cursor in out sys_refcursor)
IS
BEGIN
--Insert into the temp table the records for the rep sales
EXECUTE IMMEDIATE '
INSERT INTO TMP_SALES_CNT_BY_USER
TOTALPRODUCTSSOLD,
NUMBEROFCALLS,
SALESPER100CALLS,
SERVICEORDERNUM,
PRODUCT,
LOGIN,
FST_NAME,
LAST_NAME,
NAME,
POSITIONHELD,
CURRENTPARPARTYID,
QUERY_DATE,
CREATED_BY
SELECT e.TotalProductsSold,
e.NumberOfCalls,
((e.TotalProductsSold/e.NumberOfCalls)*100) AS SalesPer100Calls,
e.ServiceOrderNum,
e.Product,
e.login,
e.fst_name,
e.last_name,
e.name,
e.PositionHeld,
e.CurrentParPartyID,
e.query_date,
e.created_by
FROM (
SELECT COUNT(o.order_num) over ( partition by u.login
order by u.login) AS TotalProductsSold,
SUM(NVL(x.n_inbound,1) + NVL(x.n_outbound,1)) over (partition by u.login
order by u.login) AS NumberOfCalls,
o.order_num AS ServiceOrderNum,
pi.name as Product,
u.login,
c.fst_name,
c.last_name,
postn.name,
c.pr_held_postn_id as PositionHeld,
p.par_party_id as CurrentParPartyID,
NVL(x.query_date,NVL(o.last_upd, null)) AS query_date,
o.created_by
FROM firestg.SEB_S_order o
INNER join firestg.seb_s_order_item oi ON o.row_id = oi.order_id
INNER join firestg.seb_s_prod_int pi ON oi.prod_id = pi.row_id
INNER join firestg.SEB_s_contact c on c.Row_Id = o.created_by
INNER join firestg.SEB_s_user u on u.row_id = o.created_By
INNER join firestg.SEB_s_party p on p.row_id = c.pr_held_postn_id
INNER join firestg.SEB_s_postn postn on postn.row_id = c.pr_held_postn_id
LEFT OUTER JOIN (
SELECT taw.QUERY_DATE,
vaw.n_inbound,
vaw.n_outbound,
oaw.object_name, oaw.object_id
FROM GEN_T_AGENT_WEEK taw
INNER JOIN GEN_V_AGENT_WEEK vaw ON taw.time_key = vaw.time_key
INNER JOIN GEN_O_AGENT_WEEK oaw ON oaw.object_id = vaw.object_id) x
ON u.cti_acd_userid = x.object_name
WHERE NVL(x.query_date,NVL(o.last_upd, null)) BETWEEN (TRUNC (next_day (sysdate, ''SUN''))-14)
AND (TRUNC (next_day (sysdate, ''SUN''))-8)
AND o.status_cd IN (''Complete''))e';
--Lookup the first level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_1ST, LOGIN_1ST,FST_NAME_1ST,LST_NAME_1ST,TITLE_1ST) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.currentparpartyid)
WHERE CurrentParPartyID IS NOT NULL';
--Lookup the second level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_2ND, LOGIN_2ND,FST_NAME_2ND,LST_NAME_2ND,TITLE_2ND) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_1ST)
WHERE a.ParPartyID_1ST IS NOT NULL';
--Lookup the third level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_3RD, LOGIN_3RD,FST_NAME_3RD,LST_NAME_3RD,TITLE_3RD) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_2ND)
WHERE a.ParPartyID_2ND IS NOT NULL';
--Lookup the fourth level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_4TH, LOGIN_4TH,FST_NAME_4TH,LST_NAME_4TH,TITLE_4TH) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_3RD)
WHERE a.ParPartyID_3RD IS NOT NULL';
--Lookup the fifth level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_5TH, LOGIN_5TH,FST_NAME_5TH,LST_NAME_5TH,TITLE_5TH) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_4TH)
WHERE a.ParPartyID_4TH IS NOT NULL';
-- If there was no 1st place then the rep is a VP
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.last_name || '', '' || a.fst_name,
a.vp_login = a.login
WHERE a.login_1st IS NULL';
--If there is no second place then the rep has a VP and is a Director
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_1st || '', '' || a.fst_name_1st,
a.vp_login = a.login_1st,
a.director = a.last_name || '', '' || a.fst_name,
a.director_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NULL';
--IF there is no third place then the rep has a VP, Director & is a Manager
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.vp_login = a.login_2ND,
a.director = a.lst_name_1st || '', '' || a.fst_name_1st,
a.director_login = a.login_1st,
a.manager = a.last_name || '', '' || a.fst_name,
a.manager_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NULL';
--If there is no fourth place then the rep has a VP, Dir, Manager, and is a Supervisor
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_3RD || '', '' || a.fst_name_3RD,
a.vp_login = a.login_3RD,
a.director = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.director_login = a.login_2ND,
a.manager = a.lst_name_1st || '', '' || a.fst_name_1st,
a.manager_login = a.login_1st,
a.supervisor = a.last_name || '', '' || a.fst_name,
a.supervisor_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NOT NULL
AND a.login_4th IS NULL';
--If there is no fifth plance then the rep has a VP, Dir, Mgr, Supervisor, and is a Team Lead
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_4TH || '', '' || a.fst_name_4TH,
a.vp_login = a.login_4TH,
a.director = a.lst_name_3RD || '', '' || a.fst_name_3RD,
a.director_login = a.login_3RD,
a.manager = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.manager_login = a.login_2ND,
a.supervisor = a.lst_name_1st || '', '' || a.fst_name_1st,
a.supervisor_login = a.login_1st,
a.teamlead = a.last_name || '', '' || a.fst_name,
a.teamlead_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NOT NULL
AND a.login_4th IS NOT NULL
AND a.login_5th IS NULL';
--If there is a fifth place then the rep has a VP, Dir, Mgr, Supervisor, Team Lead and is a rep
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_5TH || '', '' || a.fst_name_5TH,
a.vp_login = a.login_5TH,
a.director = a.lst_name_4TH || '', '' || a.fst_name_4TH,
a.director_login = a.login_4TH,
a.manager = a.lst_name_3RD || '', '' || a.fst_name_3RD,
a.manager_login = a.login_3RD,
a.supervisor = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.supervisor_login = a.login_2ND,
a.teamlead = a.lst_name_1st || '', '' || a.fst_name_1st,
a.teamlead_login = a.login_1st
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NOT NULL
AND a.login_4th IS NOT NULL
AND a.login_5th IS NOT NULL';
open p_cursor for
SELECT tsc.vp,
tsc.director,
tsc.manager,
tsc.supervisor,
tsc.teamlead,
(tsc.last_name || ', ' || tsc.fst_name) AS Rep,
tsc.product,
tsc.totalproductssold,
tsc.numberofcalls,
tsc.salesper100calls
FROM TMP_SALES_CNT_BY_USER tsc;
END FIRE_SALES_100_CALLS_REPORT;
The table I use is a Global temp table.
This runs just fine in oracle but when I try to build a data foundation in Business Objects I get the error that says you cannot insert/update/delete in a READ ONLY Transaction.
I really need some advice on what to do since I really dont have access to a scheduled script and table that would store my data ahead of time.Well, AFAIK, BO is a reporting tool, so it si read-only by nature. I do not know if it possible to "tell" BO table is GTT and it is OK to write to it. You need to post this in BO forum.
SY. -
Hello,
we have a Livelink Server database running with two replicas on two nodes as Always On Group, both instances running extended protection in "allowed" mode.
Our company security policy demands setting the extended protection to "required".
Are there any known problems with a "required Extended Protection" / "Always On" / "Livelink Server" combination?
Environment:
OS: Windows Server 2008 R2 Enterprise X64 SP1
DB: SQL Server 2012 (11.0.5556.0)
Thx & BR
AchimHi Achim,
According to my knowledge, there are no known problems with a "required Extended Protection" / "Always On" / "Livelink Server" combination.
Extended Protection helps to prevent an authentication relay attack by using service binding and channel binding. We need to note that when Extended Protection is set to
Required, only connections from protected applications on protected operating systems are accepted. This setting is the most secure but connections from operating systems or applications that do not support Extended Protection will not be able
to connect to SQL Server. For more details, please review the following article.
Connect to the Database Engine Using Extended Protection
https://msdn.microsoft.com/en-us/library/ff487261(v=sql.110).aspx
Thanks,
Lydia Zhang
If you have any feedback on our support, please click
here.
Lydia Zhang
TechNet Community Support -
Call procedure that uses REF CURSOR?
Can someone tell me how to call a procedure that uses a REF CURSOR?
Procedure is something like this:
PROCEDURE my_proc
P_PROG_ID IN VARCHAR2,
P_CRITERIA IN VARCHAR2,
P_TASKCURSOR OUT MYREFCUR
IS
blah, blah blah
I tried this to call the procedure:
exec my_proc(variable1,variable2,variable3)
but I don't know how to define variable3.
Can someone help me out?Based on the parameters for the procedure, it looks like you have a cursor (myrefcursor) defined in a package somewhere. So, in sqlplus, you would need to do it in an anonymous block, something like:
DECLARE
l_cur package_name,myrefcur;
variables to hold cursor fields
BEGIN
my_proc('ID', 'Criteria', l_cur);
LOOP
FETCH l_cur INTO variables to hold cursor fields
EXIT WHEN l_cur%NOTFOUND;
Do something with variables
END LOOP;
CLOSE l_cur;
END;If you are on Oracle 9 or higher, assuming that myrefcursor is weakly typed,
you could change the definition of the procedure to:
PROCEDURE my_proc (p_prog_id IN VARCHAR2,
p_criteria IN VARCHAR2,
P_TASKCURSOR OUT SYS_REFCURSOR)then you could call it in sql plus like:
-- Define the variables
var var1 VARCHAR2(100);
var var2 VARCHAR2(100);
var cur SYS_REFCURSOR;
-- Assign Vlaues to the IN parameters
EXEC :var1 := 'ID'; :var2 := 'Criteria';
EXEC my_proc(:var1, :var2, :cur);
-- See the contents of the cursor
print curHTH
John -
Problem with field GL Account is that it shows concatenated Chart of Accoun
Hello . Please help me. We have sap BI olap universe . problem with field GL Account is that it shows concatenated Chart of Accounts. But user want to trim the chart of account and show only account in list of values in webi report.
So What code I can put in Universe to remove this " 9000/" WHICH IS Chart of acct from GL Account
example List of values shows
9000/99030
9000/99070
I want to show as below
99030
99070
I tried replace function in universe it does not work. Pls help.
Thanks
soniyaHi,
You can do it in Web Intelligence using the function Right().
Depending on the SAP BW version you have it is possible to build such calculated expression in universe on uniquename or name:
<EXPRESSION>RIGHT[0CALMONTH].currentmember.uniquename,5)</EXPRESSION>
OR
<EXPRESSION>RIGHT([0CALMONTH].currentmember.name,5)</EXPRESSION>
You have to replace 0CALMONTH by the unique definition of GL Accounts and you also need to use the object referencing GL Accounts in your query in addtion to the calculated expression.
Regatds
Didier -
How to Execute Remote procedures that use DBLinks?
Using Oracle 10g (RAC Linux) to remote connect Windows 10g to dblink to AS/400 <
<I have created a procedure that I execute remotely by issuing the following:
CALL GLOBAL.REFRESH_STAGING@KRONOSLINK();
The procedure errors as
Error at line 2
ORA-20001: ERROR OCCURED
ORA-06512: at "GLOBAL.REFRESH_STAGING", line 47
ORA-06512: at line 1
The procedure runs without error from the host database. The problem is when the procedure makes a call to the dblink.
I unsuccessfully attempted to capture the error message.
Question: Is it possible to execute remote procedures that use dblinks? If so, How is that accomplished.
Question: What is the proper way to handle exceptions in this case?
Bonus: What can be done to improve this procedure? (Suggestions, like adding return on the procedure).
CREATE OR REPLACE PROCEDURE GLOBAL.REFRESH_STAGING IS
NOOBJECT EXCEPTION;
OBJECTEXIST EXCEPTION;
PRAGMA EXCEPTION_INIT(NOOBJECT, -00942); -- Exception handling for ORA-00942 - table or view does not exist
PRAGMA EXCEPTION_INIT(OBJECTEXIST, -00955); -- Exception handling for ORA-009555 - name is already used by an existing object
sT LONG := '';
sS LONG := '';
sST LONG := '';
cursor csrO is
SELECT
SCHEMANAME,
TABLENAME
FROM GLOBAL.STAGING_TABLES;
csrR csrO%ROWTYPE;
BEGIN
FOR csrR IN csrO
LOOP
sT := csrR.TABLENAME;
sS := csrR.SCHEMANAME;
sST := sS || '.' || sT;
BEGIN
EXECUTE IMMEDIATE 'drop table global.' || sT || ' purge';
EXCEPTION
WHEN NOOBJECT THEN
NULL;
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_CALL_STACK);
DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_ERROR_STACK);
RAISE_APPLICATION_ERROR (-20001, 'ERROR OCCURED');
END;
BEGIN
EXECUTE IMMEDIATE 'create table global.' || sT || ' nologging as select * from ' || sST || '@thebosslink';
COMMIT;
EXCEPTION
WHEN OBJECTEXIST THEN
NULL;
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_CALL_STACK);
DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_ERROR_STACK);
DBMS_OUTPUT.PUT_LINE(SQLCODE || ' - ' || SQLERRM);
RAISE_APPLICATION_ERROR (-20001, 'ERROR OCCURED');
END;
END LOOP;
END REFRESH_STAGING;
Thanks,
blevelsSET LINESIZE 500;
COLUMN DB_LINK FORMAT a20
COLUMN HOST FORMAT a20
COLUMN USERNAME FORMAT a20
COLUMN OWNER FORMAT a10
COLUMN TABLE_NAME FORMAT a20
select db_link,username, host from all_db_links where db_link = 'KRONOSLINK';
select privilege from dba_sys_privs where grantee = 'SYSTEM';
select owner, table_name from dba_tab_privs where grantee='SYSTEM';
DBLINK_ USERNAME HOST
KRONOSLINK SYSTEM ORCL
1 row selected.
PRIVILEGE
GLOBAL QUERY REWRITE
CREATE MATERIALIZED VIEW
CREATE TABLE
UNLIMITED TABLESPACE
SELECT ANY TABLE
5 rows selected.
OWNER TABLENAME_
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCEXP
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCVID
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS INCFIL
SYS DBMS_ALERT
SYS DBMS_SYS_ERROR
SYS DBMS_RULE_EXIMP
SYS DBMS_AQ
SYS DBMS_AQADM
SYS DBMS_AQ_IMPORT_INTER
NAL
SYS DBMS_AQELM
SYS DBMS_TRANSFORM_EXIMP
SYS SYS_GROUP
SYS DBMS_DEFER_IMPORT_IN
TERNAL
SYS DBMS_REPCAT
WMSYS WM$UDTRIG_INFO
SYS SET_TABLESPACE
SYS CHECK_UPGRADE
SYS AVINASH
SYS AVINASH
SYS AVINASH1
SYS AVINASH1
SYS DB_PMP
SYS DB_PMP
SYS DIR_TESTCASE
SYS DIR_TESTCASE
SYS EXPORT_FULL_DIR
SYS EXPORT_FULL_DIR
SYS PUMP
SYS PUMP
SYS LOGS
SYS LOGS
SYS DPUMP_DIR2
SYS DPUMP_DIR2
SYS AVIS
SYS AVIS
SYS DPDIR_LCLLGS
SYS DPDIR_LCLLGS
67 rows selected.
Edited by: user10860953 on Jan 28, 2010 10:43 AM -
How to call a stored procedure that use a type defined in a package?
Hi all,
this is stored procedure:
GET_GIORNATAEVENTO( in_nome_servizio IN VARCHAR2,
out_dati_aggiornati OUT TAB_VARCHAR2);
TAB VARCHAR2 is defined in the package specification:
TYPE tab_varchar2 IS TABLE OF VARCHAR2(5) INDEX BY BINARY_INTEGER;
and this is the name of the package: PKG_SERVIZI_MMSPUSH.
This is my php script:
<?php
// Connect to database...
$c=OCILogon("venus_vfl", "venus_vfl", "venvi");
if ( ! $c ) {
echo "Connessione non riuscita: " . var_dump( OCIError() );
die();
echo "<br>PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO</br> ";
echo "<br> </br>";
// Call database procedure...
$in_servizio = "MOTO";
$s = OCIParse($c, "begin PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO(:bind1, :bind2); end;");
OCIBindByName($s, ":bind1", $in_servizio);
OCIBindByName($s, ":bind2", $out_esito);
OCIExecute($s,OCI_DEFAULT);
echo "OUT_DATI_AGGIORNATI= " . $out_esito;
// Logoff from Oracle
OCILogoff($c);
?>
How to test stored procedure to get the output parameter?
Thanks in advance.Thanks,
but I need to test stored procedures that uses type defined in the package.
e.g.
if I have s.p.
PROCEDURE get_risultati_squadra
( in_squadra IN VARCHAR2,
out_serie OUT tab_varchar2_5,
out_tiporisultato OUT tab_varchar2_5,
out_n_giornata OUT tab_varchar2_5,
out_squadre OUT tab_varchar2_200,
out_risultato OUT tab_varchar2_10,
out_marcatore OUT tab_varchar2_50,
out_punti OUT tab_varchar2_3,
out_rimbalzista OUT tab_varchar2_50,
out_rimbalzi OUT tab_varchar2_3,
out_esito OUT tab_varchar2_2);
I have to define every type external to the package, in this case five new TYPE !!
Is there another way to solve this problem?
Thanks -
Can anyone please help me, I'm having problems with sound while watching video clips using flash player & Internet Explorer
There's a good chance that this is a known issue. We'll have a Flash Player 18 beta later this week that should resolve this at http://www.adobe.com/go/flashplayerbeta/
-
Can anyone, help me please?
I have a problem with my iphone 4 Facetime, that since the new ios 7 system has been installed, I cannot use the FACETime? I don't know where to turn? I have contacted a retailer here in Isreal, and I've contacted the Cell come company and I've contacted the repair shop... each one pushes me off on someone else.
I cannot make any FACETIME calls.... anywhere................ helpHmm, I see from the Apple Support webpage it seems you cannot call them directly from Israel, that's not good.
Okay, so FaceTime stopped working once you upgraded to iOS 7 is that the situation? It doesn't work over either cellular or WiFi networks? I assume you have checked the Settings>FaceTime>FaceTime switch is on and that you have your correct Apple ID in there as well?
What happens when you launch the FaceTime app and attempt to make a FaceTime call, what message(s) do you get? -
Problem with MAIL, when select names that start with "E" the mail freeze. Can't fix it.
Now I checked the materials that I got from AT&T Yahoo and
port 25 is used as the outgoing mail port, 110 for incoming.
This is for the POP type account provided by AT&T, not necessarily for an email account and SMTP server not provided by AT&T.
Sounds like AT&T blocks using an SMTP server that is outside of their network or not provided by AT&T on Port 25.
Try the following first.
Go to Mail > Preferences > Accounts and under the Account Information tab for your .Mac account preferences at the SMTP server selection, select the Server Settings button below for the .Mac SMTP server.
Enter 587 in place of 25 in the Server Port field and when finished, select OK to save the changed setting.
If this doesn't work, we will go to plan B. -
I downloaded Firefox 7 and when I click on the browser icon nothing happens, the browser does not load on desktop.I had no problems with Firefox 4 I had been using for several years and liked very much
Most people have no problems with installing firefox as an upgrade, but there are quite a few things that can cause problems. Please have a look at the articles
* [[software Update Failed]] <-- clickable link (blue ) --
* [[firefox will not start]]
* [[firefox does not work]]
Post back after you read them and say what you tried. Have you ensured you used an admin account, possibly needing to check the UAC setting, and that security software is not blocking the changes. You should certainly try starting in firefox's [[safe mode]] either from a menu/icon option or by holding the shift key as you attempt to run firefox.
Is the browser icon you see on the desktop, and a firefox icon ? -
hi, i have a macbook air and i've been having problems with the camera when i'm using skype. i know im no the 1st one and i'd like to know when apple or someone 'll do something about this.
Try reinstalling Combo Update.
http://support.apple.com/kb/DL1676
Best. -
I have a problem with my PC mobile device that the keyboard stop working and the mouse also
I have a problem with my PC mobile device that the keyboard stop working and the mouse also
All I can suggeset is:
Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
or
Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
Have you looked at the AMDS topic of:
iOS: Device not recognized in iTunes for Windows
Do you have han image capture programs linstalled like for a camers or scanner?
Maybe you are looking for
-
Hi All, I want to add a footer for table in WDA. I am not using ALV. My footer will give the total of the items in the table. However, i am not able to add a footer. It also doesnt appear if i make footer visible. Please advise. Thanks, Prisford Pere
-
Updated to Mountain Lion and now I get a Green Flicker
Help Please... I updated to Mountain Lion and ever since then when I export media from Final Cut X I am getting random green flashes in my video clips. I shoot with a DSLR (60D), full 1920x1080 HD, H.264 codec. I have never had this problem before.
-
hi, hope my help can come in time... its pretty urgent as my final presentation is on this coming friday(singapore time)... i had coded a class where i can connect to the public UDDI. now i want to get the WSDL document location. but i could not get
-
Quality of movie when "shared"
I'm a little concerned about the quality of my movie once it's been compressed for the Web or Web streaming: I have several still clips, plus title frames in my project. The still and particularly the type in the titles wind up very fuzzy and difficu
-
Failure to start SOA managed server after SOA 11.1.1.5 install
Installed SOA Suite 11.1.1.5, setup jdk_16025x64, XE, RCU, WLS, SOA (Disks1-5), setup WLS DOMAIN, etc. - no problems. Startup the Admin Server - no problems - on a Win7x64 box. When startup the soa_server1 managed server seems to start up okay then s