Dynamic prompting with stored procedures XI- urgent
Post Author: moleary77
CA Forum: Crystal Reports
I have a report that has 7 parameters and two stored procedures, I get the dynamic prompting to work wonders as stand alone dynamic parameters, however I need them to be cascading. How can I accomplish this while still using my stored procedures? Is there something I need to change within the stored procedure, I've looked all over in Crystal and I can't seem to figure it out. Please let me know! Below are my stored procs
set ANSI_NULLS ONset QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[gm_RPT_Appt_Parms]-- Add the parameters for the stored procedure hereASBEGIN-- SET NOCOUNT ON added to prevent extra result sets from-- interfering with SELECT statements.SET NOCOUNT ON;-- Insert statements for procedure hereDECLARE @PTABLE TABLE(COMPANY VARCHAR(10) NULL,BOOKCODE VARCHAR(22) NULL,FACILITY VARCHAR(47) NULL,PROV VARCHAR(21) NULL,LOGONID VARCHAR(15) NULL,DEPARTMENT VARCHAR(26) NULL)--GET COMPANIESINSERT INTO @PTABLE(COMPANY, BOOKCODE, DEPARTMENT ) SELECT DISTINCT COMPANY , BOOKCODE, DEPARTMENT FROM MWBOOK ORDER BY COMPANY , BOOKCODE, DEPARTMENT INSERT INTO @PTABLE(COMPANY, FACILITY ) SELECT DISTINCT COMPANY, FACILITY FROM CLFAC ORDER BY COMPANY, FACILITY INSERT INTO @PTABLE(COMPANY, PROV ) SELECT DISTINCT COMPANY , PROV FROM MWPROV ORDER BY COMPANY , PROV SELECT * FROM @PTABLE
END
set ANSI_NULLS ONset QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[gm_RPT_Appt_Data] -- Add the parameters for the stored procedure here @START DATETIME, @END DATETIME, @COMPANY VARCHAR(10), @BOOK VARCHAR(2056) = NULL, @USERCODE varchar(2056) = NULL, @FACILITY varchar(2056)= NULL, @PROV varchar(2056) = NULLASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements.DECLARE @VALUES VARCHAR(2000) SET NOCOUNT ON; IF(@BOOK IS NULL) BEGIN SET @VALUES = '' SELECT @VALUES = @VALUES + COALESCE(BOOKCODE + ',','') FROM MWBOOK WHERE COMPANY = @COMPANY SET @BOOK = @VALUES END IF(@FACILITY IS NULL) BEGIN SET @VALUES = '' SELECT @VALUES = @VALUES + COALESCE(FACILITY + ',','') FROM CLFAC WHERE COMPANY = @COMPANY SET @FACILITY = @VALUES END IF(@USERCODE IS NULL) BEGIN SET @VALUES = '' SELECT @VALUES = @VALUES + COALESCE(LOGONID + ',','') FROM CLUSER WHERE COMPANY = @COMPANY SET @USERCODE = @VALUES END
IF(@PROV IS NULL) BEGIN SET @VALUES = '' SELECT @VALUES = @VALUES + COALESCE(PROV + ',','') FROM MWPROV WHERE COMPANY = @COMPANY SET @PROV = @VALUES END SELECT mws.ANOTE, mwb.BOOKNAME, mwb.FACILITY, LEFT(mwa.PATIENTID, 50) AS PATIENT, mwa.ADATE, mwa.ADESC, mwa.ANOTE, mwa.USERCODE, mwa.BOOK, mwa.USERFLAG, mwa.ATIME, mwa.COMPANY, mwa.AKEYTIME, mwb.PROV FROM dbo.MWAPPTS mwa LEFT OUTER JOIN dbo.MWBOOK mwb ON mwa.COMPANY = mwb.COMPANY AND mwa.BOOK=mwb.BOOKCODE LEFT OUTER JOIN dbo.MWSCHED mws ON mwa.ADATE=mws.ADATE AND mwa.BOOK=mws.BOOK AND mwa.COMPANY = mws.COMPANY WHERE mwa.BOOK IN (SELECT ARRTEXT FROM DBO.SPLIT(@BOOK, ',')) AND mwa.USERCODE IN (SELECT ARRTEXT FROM DBO.SPLIT(@USERCODE, ',')) AND mwa.ADATE BETWEEN @START AND @END AND mwb.FACILITY IN (SELECT ARRTEXT FROM DBO.SPLIT(@FACILITY, ',')) AND mwa.COMPANY=@COMPANY AND (mwb.PROV IN (SELECT ARRTEXT FROM DBO.SPLIT(@PROV, ','))) ORDER BY MWA.ADATE, MWA.BOOK
END
Since your {?Project} parameter is part of a stored procedure, you have to think of it as part of the table.  In reality, it could "change" the result set so Crystal has always prompted them first. It's like in math with the order of operation between +-*/.Â
All "added" parameters (like the one you created within the report) must be prompted after the server-based prompts (stored proc).
- Kathryn Webster (Report Design Specialist)
Similar Messages
-
How to use optional prompts with stored procedure universe?
Hi Experts,
Iu2019m working on stored procedure universe in BO XI 3.0 SP2 FP2.5 with oracle at back end. My requirement is that I have to pass 5 optional prompts in the report and we have to pass these prompts through open document link. Please tell if this can be worked out on stored procedure universe?
Thanks in advance.Hi,
Try with OpenDoc syntax as follows.
http://<servername>:<port>/OpenDocument/opendoc/<plat
formSpecific>?iDocID=****&sIDType=CUID&sType=wid/rpt&lsM/lsS/lsRPROMPTNAME=[V1],[V2]&sDocName=reportname&sRefresh=Y/N
where
server name: cms server name
port: portno
<platformspecific>=: for java -> openDocument.jsp
for .net -> opendocument.aspx
idocid,sDocName & cuid -> we can get report properties ( goto info view -> select report -> right click -> properties i.e. doc id, cuid and report name)
sType -> type of report i.e webi or deski ...
lsS -> to pass single prompt value
lsM -> to pass multiplle values to prompt
lsR -> range of values ....
Note: Here prompt name should be same as the one which we used in the report. Use + if there is blank space.
Cheers,
Suresh Aluri. -
Dynamic Execution of Stored Procedure
Hi Everybody!
I have two questions for you. All my questions are pertaining PL/SQL programming with Oracle 8i. But before that, I would like to introduce a bit about the background.
We have .NET based application, which calls some 80 odd Oracle stored procedures one after one. The input parameters for all these stored procedure are same i.e. two IN parameters of Integer type and a OUT parameter of cursor type. The name of these stored procedures are listed in table (let say tblSPTable). We use to get the list of stored procedures from this table and execute them one after one.
Sooner or later we realized that, this way of calling the stored procedures is causing a performance issue. So, we thought of moving the call to all these stored procedures to a new stored procedure. We thought of giving a call to this new stored procedure, which will in turn execute all these stored procedures one after one (by using the tblSPTable), and return us the all the cursors at one shot. But here is where we got stuck:
How can I declare a OUT parameter for a list of cursors? Because I need to store the output of all the 80 odd calls in different cursors and have to get it back. I have tried to declare VARRAY of cursors or TABLE of cursors but it is not supported. One way of doing this is to declare all the 80 cursors as OUT parameters in the new stored procedure, but that is absolutely a bad programming practice. Apart from that, in future if we want to modify the order of the stored procedure, OR if we want to add or remove few stored procedures listed in tblSPTable, we have to modify this new procedure every time. My question is how can I declare or use a variable which can hold the list of cursors, which I can use from a .NET base application.
Secondly, I will get the name of all the stored procedure by querying the tblSPTable, and will execute them dynamically. I have tried out something like this but not succeeded
declare
cur_result some_package.some_cursor;
var_spname varchar;
begin
var_spname:=’pr_some_procedure’;
execute immediate 'begin ‘ || var_spname || ‘(:2); end;' using out cur_result;
end;
Bur, I am getting an error saying “Error while trying to retrieve text for error ORA-03113”. I have scanned through few docs available over net, but none of them are really helpful. My question is how can I dynamically execute a stored procedure which has a cursor as a OUT parameter.
Please help me out if you people have any idea regarding this. Please let me know whether my approach is correct or not. I am waiting for your valuable suggestions.
Thanking you
Ayan Mitra
Message was edited by:
user588628your solution will work out only in case all the functions returning you a cursor which holds same number of columnNot so. It is unfortunate that my example does not make that clear.
The UNION ALL is of a single column which is of type weak refcursor.
By way of example the below changes the p_dept procedure so it returns two columns rather than three.
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> CRE ATE OR REPLACE PROCEDURE p_dept (
2 p_deptno IN dept.deptno%type,
3 p_resultset OUT SYS_REFCURSOR)
4 IS
5 BEGIN
6 OPEN p_resultset FOR
7 SELECT d.deptno, d.dname
8 FROM dept d
9 WHERE d.deptno = p_deptno;
10 END p_dept;
11 /
Procedure created.
SQL> VARIABLE p_resultset REFCURSOR;
SQL> BEGIN
2 :p_resultset := f_all (
3 p_deptno => 30,
4 p_functions => varchar2_table ('F_DEPT', 'F_EMP'));
5 END;
6 /
PL/SQL procedure successfully completed.
SQL> PRINT p_resultset;
RN FN RS
1 F_DEPT CURSOR STATEMENT : 3
CURSOR STATEMENT : 3
DEPTNO DNAME
30 SALES
2 F_EMP CURSOR STATEMENT : 3
CURSOR STATEMENT : 3
EMPNO ENAME JOB
7499 ALLEN SALESMAN
7521 WARD SALESMAN
7654 MARTIN SALESMAN
7698 BLAKE MANAGER
7844 TURNER SALESMAN
7900 JAMES CLERK
6 rows selected.
SQL>[pre] -
Post Author: Ranjith.403
CA Forum: General
Hi,
Am new to crystal reports with stored procedures
am created a report using a stored procedure in oracle. In that Stored Procedure am Using a temporary table.
After inserting values into the table am assigning to ref cursor.
Refcursor having fields like item,onhandstock,purchase rate
This report working fine in oracle version 9.2.0.1.0 where comes to oracle version 9.2.0.8.0 it's giving the varchar values correctly.
The Number values are showing as 0.
Help me to solve it.
Thanks in Advance,
RanjithTry modularising this large procedure into smaller procedures and functions, and determine which part is causing you trouble.
-
DDL statements and dynamic sql in stored procedure
I created a stored procedure to create and drop tables, using dynamic sql.
When I try to do the inserts using dynamic sql, i.e
v_string := 'INSERT statement';
EXECUTE IMMEDIATE v_string;
I get the following error message:
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at line 63
Line 63 happens to be the line that the EXECUTE IMMEDIATE v_string; statement is in.
I am able to describe the table that the inserts are being made into, so I know that the table exists.
Any idea why I'm getting this error message would be appreciated.Yes I do and I have been able to create other tables using dynamic sql.
The table that I am having problems with SELECTs data from another table to get its column values; within the SELECT statement, the CAST function is used:
ie. CAST(CASE SUBSTR(CAST(E_MOD AS VARCHAR(7)),2,3)
WHEN 'AAA' THEN 'A55'
ELSE ............
I get the following error message:
ERROR at line 18: (this line starts the CAST statement)
ORA-06550: line 18, column 13:
PLS-00103: Encountered the symbol "AAA" when expecting one of the following:
. ( * @ % & = - + ; < / > at in is mod not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or
like between into using || bulk
When I remove the quotes or add another single quote, the same error cascades to 'A55'.
After doing the same for the next error, I get the error message below:
ERROR at line 1: (this line has the EXECUTE IMMEDIATE statement)
ORA-00936: missing expression
ORA-06512: at line 6
Any idea what the problem could be?
Also is there another way to have DDL statements as stored procedures other than using dynamic sql or the DBMS_SQL package? -
Hi,
i havea requirement where in i should be able to call my shell script through oracle stored procedure.i tried the following way..but iam unable to get the result.please find the details below.
new.sh - my shell script - lctfile (LCTFILE) is the input pa
v_config_file=`find $FND_TOP -name LCTFILE
FNDLOAD apps/s0ccer@$dxbs1 0 Y DOWNLOAD $v_config_file /home/bir4163/RPT33/bin/menu.ldt MENU MENU_NAME='AR_NAVIGATE_GUI'
if [ $? != 0 ];then
echo "$DATE $0 FNDLOAD DOWNLOAD Failed!" | tee -a $LOG_FILE
else
echo "SUCCESS" | tee -a $LOG_FILE
fi
CREATE OR REPLACE PROCEDURE test_dbms_scheduler
AS
v_text VARCHAR2 (255) := 'AR_NAVIGATE_GUI';
BEGIN
DBMS_OUTPUT.put_line ('I am in Procedure');
DBMS_SCHEDULER.create_job (
job_name => 'test_dbms_scheduler',
job_action => '/home/bir4163/RPT33/bin/new.sh',
number_of_arguments => 1,
job_type => 'executable',
start_date => SYSDATE,
repeat_interval => 'FREQ=SECONDLY; INTERVAL=1',
enabled => FALSE,
auto_drop => FALSE,
comments => 'run shell script'
DBMS_SCHEDULER.set_job_argument_value (job_name => 'test_dbms_scheduler',
argument_position => 1,
argument_value => v_text);
DBMS_SCHEDULER.enable ('test_dbms_scheduler');
DBMS_OUTPUT.put_line ('I am back in Procedure');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SQLCODE || SQLERRM);
END;
But iam unable to test it as i do not have permissions to access dbms_scheduler.can anybody tell me how to solve this using DBMS_PIPE with a sample code.
please do help its very urgent
thanks
ramyaHi,
Register your Shell Script as a concurrent program, Executable execution method "Host", then use fnd_request.submit_request to submit the program.
Regards,
Andries -
Dynamic queries in stored procedures - JDBC
Hi,
How do we write a query in stored procedures if the field to be selected,conditions & sort order are dynamic?
The user selected the columns,conditions & sort order only at run time.
Thanks in advance,
sundarThe syntax for a stored procedure varies by database. And support for dynamic SQL in a stored proc varies to. And it has nothing to do with java. So you are more likely to get better responses by asking the question on a board/list that is specific to your database and that address stored procedures.
And to get a response here you need to specify the database your are using, and the version might be a good idea too.
And from the design prespective you might keep in mind that dynamic SQL is significantly slower than other forms. And it is also harder to debug and code for. So you might want to consider why you need to do that.
Perhaps you actually want to know how to create dynamic SQL in Java instead? -
Probleme with stored procedure in oracle 10 g
I create a stored procedure for archiving successfully compile but when I select t_sql_statement i have 0 rows :( :(
create or replace
PROCEDURE p_archive_test(piv_owner varchar2)
is
lv_stmt varchar2(2000) := 'insert /*+ append */ into TABLE1 (COLUMNS)
select INS_COLUMNS
from TABLE2 tab2@db1
where not exists (select null
from TABLE1 tab1
where PKCOLUMNS
cursor c_tab is
select tab.table_name,'ERR$_'||tab.table_name ERR_TABLE
from all_tables tab
where tab.owner = piv_owner
-- and tab.table_name = 'action'
--order by atb.TABLE_ORDER
-- For each table get the primary key columns
cursor c_pk(civ_table_name in all_tables.TABLE_NAME%type)
is
select acl.COLUMN_NAME
from all_cons_columns acl
,all_constraints acn
where acn.OWNER = piv_owner
and acn.CONSTRAINT_TYPE = 'P'
and acn.TABLE_NAME = civ_table_name
and acl.OWNER = acn.OWNER
and acl.TABLE_NAME = acn.table_name
and acl.CONSTRAINT_NAME = acn.CONSTRAINT_NAME
order by acl.POSITION;
-- For each table get the corresponding table columns names
cursor c_ins_cols(civ_table_name in all_tab_columns.TABLE_NAME%type)
is
select 'tab2.'||atc.COLUMN_NAME column_name
from all_tab_columns atc
where atc.OWNER = piv_owner
and atc.TABLE_NAME = civ_table_name
order by atc.COLUMN_ID;
-- For each table get the columns names excluding the primary key columns
cursor c_upd_cols(civ_table_name in all_tab_columns.TABLE_NAME%type)
is
select 'tab1.'||atc.COLUMN_NAME||'=tab2.'||atc.column_name column_name
from all_tab_columns atc
where atc.OWNER = piv_owner
and atc.TABLE_NAME = civ_table_name
and not exists (select 1
from all_cons_columns acl
,all_constraints acn
where acl.OWNER = atc.owner
and acl.TABLE_NAME = atc.TABLE_NAME
and acl.column_name = atc.column_name
and acn.OWNER = acl.OWNER
and acn.TABLE_NAME = acl.TABLE_NAME
and acn.constraint_type = 'P')
order by atc.COLUMN_ID;
-- For each table get the columns names
cursor c_cols(civ_table_name in all_tab_columns.COLUMN_NAME%type)
is
select
--'tab1.'||
atc.COLUMN_NAME column_name
from all_tab_columns atc
where atc.owner = piv_owner
and atc.TABLE_NAME = civ_table_name
order by atc.COLUMN_ID;
lv_cols varchar2(4000);
lv_pk_cols varchar2(4000);
lv_ins_cols varchar2(4000);
lv_upd_cols varchar2(4000);
BEGIN
for r_tab in c_tab
loop
lv_cols := '';
lv_pk_cols := '';
lv_ins_cols := '';
lv_upd_cols := '';
for r_pk in c_pk(civ_table_name => r_tab.table_name)
loop
lv_pk_cols := lv_pk_cols||'tab1.'||r_pk.column_name||'=tab2.'||r_pk.column_name||' and ';
end loop r_pk_loop;
lv_pk_cols := substr(str1 => lv_pk_cols
,pos => 1
,len => length(ch => lv_pk_cols) - 5);
for r_ins_cols in c_ins_cols(civ_table_name => r_tab.table_name)
loop
lv_ins_cols := lv_ins_cols||r_ins_cols.column_name||',';
end loop r_ins_cols_loop;
lv_ins_cols := substr(str1 => lv_ins_cols
,pos => 1
,len => length(ch => lv_ins_cols) - 1);
for r_upd_cols in c_upd_cols(civ_table_name => r_tab.table_name)
loop
lv_upd_cols := lv_upd_cols||r_upd_cols.column_name||',';
end loop r_upd_cols_loop;
lv_upd_cols := substr(str1 => lv_upd_cols
,pos => 1
,len => length(ch => lv_upd_cols) - 1);
for r_cols in c_cols(civ_table_name => r_tab.table_name)
loop
lv_cols := lv_cols||r_cols.column_name||',';
end loop r_cols_loop;
lv_cols := substr(str1 => lv_cols
,pos => 1
,len => length(ch => lv_cols) - 1);
lv_stmt := replace(replace(replace(replace(replace(replace(replace(lv_stmt
,'TABLE1'
,r_tab.table_name)
,'TABLE2'
,'DIST_'||r_tab.table_name)
,'PKCOLUMNS'
,lv_pk_cols)
,'UPD_COLUMNS'
,lv_upd_cols)
,'INS_COLUMNS'
,lv_ins_cols)
,'COLUMNS'
,LV_COLS)
,'TABLE3'
,R_TAB.ERR_TABLE);
-- here It highy advisable to store the sql statement that will be submitted
-- to the SQL engine before executing it dynamically
insert into t_sql_statement values (lv_stmt);
execute immediate lv_stmt;
end loop ;
commit;
exception
when others then
rollback;
raise;
end p_archive_test;Welcome to the forum!
Unfortunately you have posted to the wrong forum. This question is not about sql developer and is more appropriate for the sql and pl/sql forum
PL/SQL
Please
1. repost the question in the SQL and PL/SQL forum
2. edit this question to tell people to followup in the other forum - post the link to the question in the other forum
3. mark this question answered so people will followup in the other forum.
Read the FAQ in the other forum (there will be link at the top right of the page) for how to post a question and the information you need to provide. In particular use 'code' tags (see FAQ for explanation) before and after posted code and always provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
Before you post the new thread I suggest you perform some additional testing by
1. Modify your code so that it creates the statements but does not execute them. With dynamic sql the most common problem is incorrect syntax and until you have verified that the syntax is both correct and exactly what you want it is a waste of time to execute the statements.
2. Modify your code to only create one statement (add WHERE ROWNUM = 1 to the main query). If the syntax is wrong it will be wrong for all of the statements so until the code works correctly for one loop it is a waste of time perform 10's or 100' of loops.
3. Currently you are not committing the creation of the statement itself but only after it is executed. Thus if the execution fails the query that failed won't be available for you to examine. Either commit the INSERT or, at a minimum capture the query into a global variable and add a DBMS_OUTPUT to the exception handler to display the failed query so you can examine and test it to fix any problem.
Also, by just blindly using the data in ALL_TAB_COLS you are not taking into account that Oracle creates hidden (see the hidden column) and virtual columns that will cause your processing to fail for any tables that use them since you cannot use them directly in queries like you are creating. -
Passing dynamic parameter to stored procedure from CR formula?
Dear all,
I need to insert in some textboxes the right string based on the desired Language Code.
I crated a stored procedure in my db.
CREATE PROCEDURE MY_GET_TRANSLATION
@TextID nvarchar(8),
@LangCode int
This parameters are used as keys to get the Trans field.
I created a workshop formula: GetTranslation
Please, can someone suggest the correct statement to call my MY_GET_TRANSLATION stored procedure passing parameters?
I would like to call the GetTranslation formula from all my textboxes, passing the specific TextID value
and visualized the right translated string.
For example:
in my TEXT1 textbox, I would like to call the GetTranslation formula passing the parameters
TextID = "T000001"
and
LangCode = 13 (Italian language)
How can pass dynamic parameters to a formula?
How can pass dynamic parameters to a stored procedure from a CR formula?
Regards
EmanueleDear Jason,
I'm trying to modify a SAP B1 CR marketing report.
This CR marketing document is called by SAP B1 automatically passing the Document Number and Document Type.
The report uses the right SAP B1 tables to read the information of the header and rows of the document.
The language of the document is contained in a field of the header table
{MyMarketingDocTable.LanguageID}
I created a user table named "MyTranslationTable" where I added some strings in different langiages.
For example:
TexiID TextString LangID
T00001 Delivery 8
T00001 Consegna 13 (Italian translation)
T00002 Invoice 8
T00002 Fattura 13 (Italian translation)
In the header of the report I'd like, for example, to visualise the string "Consegna" if my document is a delivery in italian language.
I'd like to implement this method to translate all the textboxes (header, comments, etc.) based on the languageID of my document.
For each textboxes, in the CR designer statically I know what TextID I want to visualized but dinamically I need to pass to my stored procedure the right language. I'd like my report automatically gets the language at run-time. I don't want that when I press the Print-preview button in SAP B1, the report asks to prompt the languageID.
It already read the DocNum and DocType and it already filter the SAP B1 tables basing on the DocNum and DocType of the document. In this way it reads the right row in the SAP B1 table and in this way I can read all the fields of this row (also the languageID of the actual document).
Regards
Emanuele
Edited by: Emanuele Croci on Dec 3, 2010 9:03 AM -
Crystal Reports with stored procedures
Hello Members,
I have come across a unique problem (only for me I guess). When I develop a report using a sql command (with sql script), I can run this report against any server or any datatbase dynamically with out using the "Set Data Source Loaction" found under database fields in field explorer. This report is based on a stored procedure and uses a OLEDB connection. When I developed this report for the first time, I defined its database connection (servername,database). Now I have created a same procedure with the same name on different server under a different database. I wanted to run this report against the new server, but I am getting an error " Failed to retrieve data from database". If i click OK on this pop up window. It displays another pop up window and says the old database name is not found in the new server. The criteria is the report should be able to run on any database on any server if the same stored procedure exists in there just like the report with sql command runs. How to solve this problem ?
Thanks in Advance!!!!Hi Raghavendra,
I know that is one of the way to do this ands it is manual process. The problem here is different clients will be running this report. Each client's data is located on different server and different database and this update process should be done automatically. Do you know any way to do this ?
Thanks!!!! -
Report with Stored Procedure does not return until refresh
I'm using RAS server 2008 to run many Crystal reports from a web application (TrackWise) over Oracle 10g DB.
A new report is using a stored procedure that takes several minutes (5-10) to return before the rest of the report's SQL can execute.
When running the report from Crystal Developer there is no problem,
but when running from the application (using the RAS), the report seems to be running forever,
However, if you wait a few minutes for the DB utilization to drop (i.e. for the stored procedure to finish) and refresh - the full report appears on the screen in a second.
Since I have many other reports that run for much longer time with no issue, I assume that this has nothing to do with the web application, but rather related to the connection between the RAS and the DB (i.e. the idle time between the beginning of the stored procedure execution to its return and the continuation of the report creation).
I assume that I need to change one of the RAS settings/ parameters (in the properties or in the registry), but which?
Please assist.Since this app is from TrackWise, I'd recommend contacting TrackWise and see if they have an answer for you. As it is, we have no idea how they implemented the CR components in their app. If they cannot help you, it should be them coming here and asking us - or better yet they should be creating a phone incident.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
Passing parameters from vb form to a crystal report with stored procedure
Can someone give me an idea how to use data inputted on vb form to be use as basis of crystal report generation which loads data from a stored procedure. Stored procedure has parameters that was also set in the crystal report. viewing on crystal report is ok but i am having difficulty running the report from vb.
Hi John,
If Not CRRpt.ParameterFields("AgeType") Is Nothing Then
CRRpt.ParameterFields("AgeType").CurrentValues.Clear()
Dim ParamValue As new CrystalDecisions.Shared.ParameterDiscreteValue
ParamValue.Value = AgeType.ToString
CRRpt.ParameterFields("AgeType").CurrentValues.Add(ParamValue)
End If
Note that the ParamValue.Value should be assigned with exact same data type as you declared it in CR.
If it is string, Convert your Variable to string first.
If it is date, make sure you are passing a date variable.
and so on...
Regards
Edy -
Hi,
I'm new to the Oracle SOA Suite and have been creating very simple SCA WebServices (async and sync) prototypes to INSERT, UPDATE and Poll Oracle 9i and 11g databases. So far, everything works and passes the tests from EM.
I cannot get the Stored Procedure WebService to test successfully as I receive the error message below regardless of JNDI configuration for XA, non-XA, Last Logging Resource, Support Global Transactions,PlatformClassName, etc... The Outbound Connection Pool is setup correctly as the other DML tests have worked fine.
BINDING.JCA-12563
Exception occurred when binding was invoked.
Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'dbReference' failed due to: Interaction processing error.
Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD. This exception is considered not retriable, likely due to a modelling mistake.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
Caused by: BINDING.JCA-12563
Exception occurred when binding was invoked.
Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'callAPI' failed due to: Interaction processing error.
Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD. This exception is considered not retriable, likely due to a modelling mistake.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:569)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:724)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:689)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteraction.java:628)
at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:325)
... 84 more
Caused by: BINDING.JCA-11812
Interaction processing error.
Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD. This exception is considered not retriable, likely due to a modelling mistake.
at oracle.tip.adapter.db.exceptions.DBResourceException.createNonRetriableException(DBResourceException.java:690)
at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:656)
at oracle.tip.adapter.db.sp.SPUtil.createResourceException(SPUtil.java:180)
at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:183)
at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1302)
at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:307)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:415)
Caused by: java.lang.NullPointerException
at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:162)
... 91 more
The SP SCA is the simplest possible application I can think of... The WebService accepts a single INT, calls BPEL>Receive>Assign>Invoke>dbAdapter(Stored Procedure) that accepts a single IN INTEGER parameter in an Oracle 11g database.
Steps I've used to create the SP SCA. (Create Empty SOA Application)
1.) Create Database Adapter in External References swim lane.
2.) Set JNDI and Connection.
3.) Browse to Oracle Procedure...click through Wizard and accept all defaults.
CREATE OR REPLACE PROCEDURE TEST_SOA_API (
wo_order_no_ IN INTEGER)
IS
BEGIN
INSERT INTO TEST_TMP VALUES (wo_order_no_);
END;
4.) WSDL, XSD, JCA are automatically generated.
5.) Create BPEL Process Component and select Template "Base on a WSDL". I choose the WSDL created from the Database Adapter wizard.
6.) The "Exposed Service" is automatically created and everything is wired.
7.) I deploy to my CompactDomain (running on a local Oracle12 db). No errors.
8.) I login to EM and Test the WebService..and ALWAYS receive the error message above.
I've tried BPEL Process and Mediator as components to simply pass the single incoming INT parameter to the SP DbAdapter and tried every combination I can think of with DataSource/DbAdapter Deployment through the Admin console. I used the same exact steps above for INSERT, UPDATE, Polling and have had no issues so I cannot figure out why I'm not receiving java.NullPointer exception or why I'm receiving the XML/XSD malformation error.
Stuck now...anyone have an idea what I'm doing wrong or simply tell me I'm an idiot and shouldn't do SP's this way?
FYI. I've turned on logging for the oracle.soa.adapter.db class to TRACE: 32(FINEST). Not much help to me
[2015-04-02T09:03:55.706-05:00] [AdminServer] [WARNING] [ADF_FACES-00007] [oracle.adf.view.rich.render.RichRenderer] [tid: 118] [userId: weblogic] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-00000788,0] [APP: em] [DSID: 0000KluHqzk0NuGayxyWMG1L7K52000003] Attempt to synchronized unknown key: viewportSize.
[2015-04-02T09:05:23.971-05:00] [AdminServer] [TRACE] [] [oracle.soa.adapter.db.outbound] [tid: 115] [userId: <anonymous>] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-000007db,1:17474] [APP: soa-infra] [oracle.soa.tracking.FlowId: 250004] [oracle.soa.tracking.InstanceId: 1270014] [oracle.soa.tracking.SCAEntityId: 90004] [composite_name: OraclePLSQL2!1.0] [FlowId: 0000KluSpyP0NuGayxyWMG1L7K52000007] [SRC_CLASS: oracle.tip.adapter.db.sp.AbstractStoredProcedure] [SRC_METHOD: execute] [composite_version: 1.0] [reference_name: dbReference] BEGIN IFSAPP.TEST_SOA_API(WO_ORDER_NO_=>?); END;
[2015-04-02T09:05:23.972-05:00] [AdminServer] [TRACE] [] [oracle.soa.adapter.db.outbound] [tid: 115] [userId: <anonymous>] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-000007db,1:17474] [APP: soa-infra] [oracle.soa.tracking.FlowId: 250004] [oracle.soa.tracking.InstanceId: 1270014] [oracle.soa.tracking.SCAEntityId: 90004] [composite_name: OraclePLSQL2!1.0] [FlowId: 0000KluSpyP0NuGayxyWMG1L7K52000007] [SRC_CLASS: oracle.tip.adapter.db.sp.AbstractStoredProcedure] [SRC_METHOD: execute] [composite_version: 1.0] [reference_name: dbReference] Bindings [WO_ORDER_NO_=>INTEGER(2343)]
WSDL
<wsdl:definitions
name="dbReference"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/OraclePLSQL2/OraclePLSQL2/dbReference"
xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/OraclePLSQL2/OraclePLSQL2/dbReference"
xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>
<plt:partnerLinkType name="dbReference_plt" >
<plt:role name="dbReference_role" >
<plt:portType name="tns:dbReference_ptt" />
</plt:role>
</plt:partnerLinkType>
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference"
schemaLocation="../Schemas/dbReference_sp.xsd" />
</schema>
</wsdl:types>
<wsdl:message name="args_in_msg">
<wsdl:part name="InputParameters" element="db:InputParameters"/>
</wsdl:message>
<wsdl:portType name="dbReference_ptt">
<wsdl:operation name="dbReference">
<wsdl:input message="tns:args_in_msg"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
XSD
<schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference" elementFormDefault="qualified">
<element name="InputParameters">
<complexType>
<sequence>
<element name="WO_ORDER_NO_" type="int" db:index="1" db:type="INTEGER" minOccurs="0" nillable="true"/>
</sequence>
</complexType>
</element>
</schema>
Payload XML
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:InputParameters xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference">
<ns1:WO_ORDER_NO_>667</ns1:WO_ORDER_NO_>
</ns1:InputParameters>
</soap:Body>
</soap:Envelope>An even simpler request:
Can someone create an SCA that simply accepts a single INT parameter and calls a Stored Procedure (Oracle) that inserts this INT into a table? Maybe upload the project folder structure in a zip?
Seems someone with experience on this platform could execute this task in 10-15 minutes.
CREATE TABLE TEST_TMP (WO_ORDER_NO INT);
CREATE OR REPLACE PROCEDURE TEST_SOA_API (
wo_order_no_ IN INTEGER)
IS
BEGIN
INSERT INTO TEST_TMP VALUES (wo_order_no_);
END; -
Switching Data Source for a report with stored procedure
Post Author: ysbn
CA Forum: Data Connectivity and SQL
I've created a report and deployed it on a Crystal Server. The report is based on a certain stored procedure which also exists on other DB machines in my environment (Oracle machines). When I try to switch my report object to work with other machines (not the one originally used when the report was designed) the activation of the report fails. The error I see in the preview window is:
Error in File <my rpt file name>: Failed to retrieve data from the database. Details: [Database Vendor Code: 6550 ]
When I try the same thing with a report which is based on a view and not a stored procedure the switching of Data Source works perfectly.
Is there a problem switching between data sources from the server when the report is based on stored procedure? Are there any configurations I need to do in order to support this scenario?
Thanks!Hi everyone~
i am now facing the same problem
i am using CR2008 and Visual Studio 2008 c# to write a window program
because we have 2 db environment (one is production , the other one is development) so i have set a prarameter to switch db connection in c# code.
the database is Oracle, and the the report will connect to Oracle procedure (which it is stored in package) this procedure will return reference cursor, so the report will loop up this cursor to generate report.
at first time, it work fine when i open the report in CR2008 designer and point to dev database (ie datasource point to oracle procedure) . but when i want to deploy this win application to client and point to prod database, it show (vendor error 6550)
i found that i cannot change the datasource during runtime in c# code...
am i miss something in code? here attached a part of this code...
private void setDBLogonForReport(ConnectionInfo info, ReportDocument doc)
Tables myTables = doc.Database.Tables;
foreach (Table myTable in myTables)
TableLogOnInfo logOnInfo = myTable.LogOnInfo;
logOnInfo.ConnectionInfo = info;
logOnInfo.TableName = myTable.Name;
myTable.ApplyLogOnInfo(logOnInfo);
//myTable.Location = info.UserID + "." + "pkg_crystal_report." + myTable.Name;
//someone suggest i have to set the 'Location' for change the datasource, but i am not sure how to construct a
//string for point to oracle prcedure
i will check it freq ... hope any expert can give me some advice ~
thank you very much!!! -
Insert Multiple records using Database adapter with Stored procedure func
Hi All,
I want to insert multiple records on a database using a stored procedure. I wanted to insert those records using a Database Adapter and the Database adapter should be invoked by a Mediator.
Can somebody suggest me with ideas whether it can be acheived with OOB capabtilities in SOA suite or not?
Thanks for your help in advance.
Thanks,
ShivThe use case you want to achieve is feature supported by the DBAdapter and it is possible to invoke the same from mediator.
Please have a look at the oracle documentation and you should be able to get the necessary information.
The below links should help you as well:
http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10231/adptr_db.htm
http://blogs.oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html
There are some video tutorials as well :)
http://www.youtube.com/watch?v=dFldS-fDx70 This should also help
Thanks,
Patrick
Maybe you are looking for
-
Automatically login the user when he clicks on a URL in Adobe Form
Hi Experts, Am currently working on the e-recruitment module & have a query pertaining to Adobe Forms. As per client requirement the offer letters are despatched to the candidates in the form of an Adobe Form. This form will contain a URL to a 3rd pa
-
How to listen for cell selection changes within a JTable
Problem: my table has 8 columns, with 4 of them containing very large text (up to 1000 chars). Solution is to set the initial size these columns so that the 1st 20 chars are visible, and if one of these columns gains focus/selection via mouse-clickin
-
Hey! I know that there are several discussions about this, but i think this problem that i've got is quite unique. I am using Mountain Lion on a Macbook Pro with Logic pro 9. I was using the following plug-ins: *Sausage fattener *Massive *Sylenth1 *N
-
Gnome-panel not working when auto-started in openbox
Salut, trying to get openbox to work with gnome-panel. Everything works fine if I run gnome-panel when openbox is already started. But when trying to add gnome-panel to the autostart.sh with (sleep 1 && gnome-panel) & as the last line, I get the erro
-
Hello, I have installed an 8i db with OID, but i don't find nothing about OID/8i setup steps in the OID Administrator's Guide. Can anyone tell me what are the steps to follow in Win NT? Thanks in advance Longato.