Data Set with multiple ref cursors
Hi ,
I need to design an integrated report , i created my data set with a oracle procedure which returns "multiple ref cursors" . In this case birt is displaying all output columns together and it is difficult to identify which column belongs to which ref cursor and if there are any columns with same name in both output cursors , it displays only one. Is there any way to handle this ? or how we handle a data set which contains multiple ref cursors in output ??
Having to ref cursors return mutiple recordsets in an Oracle package is like haveng two resultsets return from a MS SQL Server sparc.
The link may point you in the right direction.
http://www.codeproject.com/Articles/675933/Returning-Multiple-Result-Sets-from-an-Entity-Fram
Similar Messages
-
Importing function with multiple ref cursors in Stored Procedure of Oracle 12c database Using EF6
Hi Good day!
I can able to import function for stored procedure of oracle db and able to add the complex type and get the output but i tried to import the procedure which having two ref cursors and unable to retrieve the column information. Only able to retrieve the
columns of first ref cursor. Please help me to get the result of two ref cursors which acting as out parameters.Having to ref cursors return mutiple recordsets in an Oracle package is like haveng two resultsets return from a MS SQL Server sparc.
The link may point you in the right direction.
http://www.codeproject.com/Articles/675933/Returning-Multiple-Result-Sets-from-an-Entity-Fram -
How to call a Stored Procedure with a REF CURSOR output parameter
I am looking forward an example that call a stored function/procedure with a REF CURSOR output parameter and get the result.
In other words, I have a stored function/procedure that execute a SELECT statement using the OCI library and then it could get the values of each column and each row.
I put a code snippet, it have only the main thing to call a simple stored procedure and print the name of each column of the cursor, but I couldn´t to print out the values in the table that call the stored procedure.
I understand that the next step, it is to call a OCIStmtFetch.
How to associate the cursor with the OCIStmtFetch?
If you need more information, only tell me.
I am using ANSI C with HP-UX Operative System (C for HP-UX) and Oracle 10g.
Regards.
Antonio Garcia
/* callOracleSP */
#include <stdio.h>
#include <string.h>
#include <oci.h>
#include <stdlib.h>
char* pConnectChar ="server";
char* pUsernameChar = "user";
char* pPasswordChar = "passwd";
char* sqlCharArray1 = "BEGIN SP_GETCITIES(:s, :c); END;";
int retval;
ub4 parmcnt=0;
ub4 pos2=0;
text *pcoln[20];
ub4 namelen[20];
char state_key[5];
OCIStmt* pOciStatement;
OCIStmt* pOciStatCursor;
OCIError* pOciError;
OCIEnv* pOciEnviron;
OCIServer* pOciServer;
OCISession* pOciSession;
OCISvcCtx* pOciServiceContext;
OCIBind* pOciBind[500];
OCIParam* pOciParam;
int main()
retval = OCIEnvCreate(&pOciEnviron, OCI_DEFAULT, NULL, NULL, NULL, NULL,0,NULL);
retval = OCIEnvInit(&pOciEnviron, OCI_DEFAULT, 0, NULL);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatement, OCI_HTYPE_STMT, 0, NULL);
retval = OCILogon(pOciEnviron,pOciError,&pOciServiceContext,(unsigned char *)pUsernameChar,
strlen(pUsernameChar), (unsigned char *)pPasswordChar, strlen(pPasswordChar),
(unsigned char *)pConnectChar,strlen(pConnectChar));
printf("OCILogon retval=%d\n",retval);
retval = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray1,strlen(sqlCharArray1),
OCI_NTV_SYNTAX, OCI_DEFAULT);
printf("StmtPrepare retval=%d\n",retval);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatCursor, OCI_HTYPE_STMT, 0, NULL);
retval = OCIBindByPos(pOciStatement,&pOciBind[0], pOciError, (ub4) 1, (void *)&state_key,
(sb4) sizeof(state_key), SQLT_STR, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
retval = OCIBindByPos(pOciStatement,&pOciBind[1], pOciError, (ub4) 2, (void *)&pOciStatCursor,
(sb4) 0, SQLT_RSET, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
strcpy(state_key,"CA");
retval = OCIStmtExecute(pOciServiceContext, pOciStatement, pOciError, (ub4)1, (ub4) 0,
(OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4) OCI_DEFAULT);
printf("StmtExecute retval=%d\n",retval);
/* How to get the values of the cursor? */
/* Get number of parameters of the Cursor */
OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &parmcnt,(ub4 *) 0,
(ub4)OCI_ATTR_PARAM_COUNT, pOciError);
printf("\nNumber of parameters of the cursor = %d\n",parmcnt);
for (int pos = 1; pos <= (int)parmcnt; pos++)
OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &pos2,(ub4 *) 0,
(ub4)OCI_ATTR_CURRENT_POSITION, pOciError);
retval = OCIParamGet((void *)pOciStatCursor, (ub4)OCI_HTYPE_STMT, pOciError, (void **)&pOciParam,
(ub4) pos );
OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &pcoln[pos-1],(ub4 *) &namelen[pos-1],
(ub4) OCI_ATTR_NAME,(OCIError *)pOciError );
for (int i = 1; i <=(int)parmcnt; i++)
printf("Column %i\tNAME = %.*s\n",i,namelen[i-1],pcoln[i-1]);
return 0;
This is the script that create the table, insert records and create the stored procedure
CREATE TABLE CITIES (
STATE_CODE VARCHAR2(2) NULL,
CITY_CODE NUMBER(15,5) NULL,
CITY_NAME VARCHAR2(30) NULL
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('CA', 30, 'SAN DIEGO')
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('CA', 40, 'SACRAMENTO')
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('FL', 10, 'MIAMI')
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('FL', 20, 'ORLANDO')
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('NY', 10, 'NEW YORK')
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('NY', 20, 'ALBANY')
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('CA', 10, 'LOS ANGELES')
INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
VALUES('CA', 20, 'SAN FRANCISCO')
CREATE OR REPLACE PACKAGE globalPkg AUTHID CURRENT_USER AS
/* The following are T/SQL specific global variables. */
TYPE RCT1 IS REF CURSOR;/*new weak cursor definition*/
END globalPkg;
CREATE OR REPLACE PROCEDURE SP_ADDCITY(
P_STATE_CODE IN VARCHAR,
P_CITY_CODE IN NUMBER,
P_CITY_NAME IN VARCHAR2,
P_RETURN IN OUT NUMBER)
AS
StoO_error INTEGER;
StoO_selcnt INTEGER;
StoO_rowcnt INTEGER;
StoO_errmsg VARCHAR2(255);
BEGIN
StoO_rowcnt := 0;
StoO_error := 0;
StoO_selcnt := 0;
P_RETURN := 0;
INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
VALUES (P_STATE_CODE, P_CITY_CODE, P_CITY_NAME);
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN TOO_MANY_ROWS THEN
StoO_rowcnt := 2;
WHEN OTHERS THEN
StoO_rowcnt := 0;
StoO_selcnt := 0;
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
IF StoO_error != 0 THEN
BEGIN
P_RETURN := 1;
RETURN;
END;
END IF;
END;
CREATE OR REPLACE PROCEDURE SP_GETCITIES(
STATE_KEY IN VARCHAR,
RC1 IN OUT globalPkg.RCT1)
AS
StoO_error INTEGER;
StoO_selcnt INTEGER;
StoO_rowcnt INTEGER;
StoO_errmsg VARCHAR2(255);
BEGIN
StoO_rowcnt := 0;
StoO_error := 0;
StoO_selcnt := 0;
OPEN RC1 FOR
SELECT STATE_CODE, CITY_CODE, CITY_NAME
FROM CITIES
WHERE STATE_CODE = STATE_KEY
ORDER BY CITY_CODE;
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN OTHERS THEN
StoO_rowcnt := 0;
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
END;
/Hi Mark,
Thanks for your recommendations.
I change the code with OCIDefineByPos, one for each parameter from cursor and then use the OCIStmtFetch.
I don´t receive a error when call OCIDefineByPos, but when I call OCIStmtFetch receive a -1 error number.
What is wrong with the code?
The script is the same.
I need your help!
Best Regards!
Antonio Garcia (Mexico)
This the new code:
#include <stdio.h>
#include <string.h>
#include <oci.h>
#include <stdlib.h>
char* pConnectChar ="ORAC617";
char* pUsernameChar = "C617_005_DBO_01";
char* pPasswordChar = "Tempora1";
char* sqlCharArray1 = "BEGIN SP_GETCITIES(:s, :c); END;";
int retval;
ub4 parmcnt=0;
ub4 pos2=0;
sb2 *c_indp;
text *pcoln[20], *name,*name2;
ub4 namelen[20],len;
ub2 type,size;
char state_key[5];
OCIDefine *pdef;
OCIBind *p_bnd;
ub1 **c_buf;
OCIStmt* pOciStatement; /* Statement handle */
OCIStmt* pOciStatCursor; /* Statement handle */
OCIError* pOciError; /* Error handle */
OCIEnv* pOciEnviron; /* Environment handle */
OCIServer* pOciServer; /* Server handle */
OCISession* pOciSession; /* Session handle */
OCISvcCtx* pOciServiceContext; /* Service Context handle */
OCIBind* pOciBind[500]; /* Bind handle */
OCIParam* pOciParam; /* Param handle */
int OCI_Fetch(OCIStmt *p_select,OCIError *p_err, int *piOcc)
int iOcc, rc;
rc=OCIStmtFetch(p_select,p_err,1,OCI_FETCH_NEXT,OCI_DEFAULT);
printf("rc fetch %i",rc);
if(rc==0&&piOcc!=NULL){
printf("entro al if");
iOcc=*piOcc;
*piOcc=iOcc+1;
return rc;
int main()
int pos,i=0,rc;
retval = OCIEnvCreate(&pOciEnviron, OCI_DEFAULT, NULL, NULL, NULL, NULL,0,NULL);
printf("EnvCreate retval=%d\n", retval);
retval = OCIEnvInit(&pOciEnviron, OCI_DEFAULT, 0, NULL);
printf("EnvInit retval=%d\n",retval);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
printf("HandleAlloc OCI_HTYPE_ERROR retval=%d\n",retval);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
printf("HandleAlloc OCI_HTYPE_SVCCTX retval=%d\n",retval);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatement, OCI_HTYPE_STMT, 0, NULL);
printf("HandleAlloc OCI_HTYPE_STMT retval=%d\n",retval);
retval = OCILogon(pOciEnviron,pOciError,&pOciServiceContext,(unsigned char *)pUsernameChar,
strlen(pUsernameChar), (unsigned char *)pPasswordChar, strlen(pPasswordChar),
(unsigned char *)pConnectChar,strlen(pConnectChar));
printf("OCILogon retval=%d\n",retval);
retval = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray1,strlen(sqlCharArray1),
OCI_NTV_SYNTAX, OCI_DEFAULT);
printf("StmtPrepare retval=%d\n",retval);
retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatCursor, OCI_HTYPE_STMT, 0, NULL);
printf("HandleAlloc OCI_HTYPE_STMT retval=%d\n",retval);
retval = OCIBindByPos(pOciStatement,&pOciBind[0], pOciError, (ub4) 1, (void *)&state_key,
(sb4) sizeof(state_key), SQLT_STR, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
retval = OCIBindByPos(pOciStatement,&pOciBind[1], pOciError, (ub4) 2, (void *)&pOciStatCursor,
(sb4) 0, SQLT_RSET, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
strcpy(state_key,"CA");
retval = OCIStmtExecute(pOciServiceContext, pOciStatement, pOciError, (ub4)1, (ub4) 0,
(OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4) OCI_DEFAULT);
printf("StmtExecute retval=%d\n",retval);
c_buf=(ub1 **)calloc(sizeof(ub1 *),3);
c_indp=(sb2 *)calloc(sizeof(sb2 *),3);
// Get number of parameters of the Cursor
OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &parmcnt,(ub4 *) 0,
(ub4)OCI_ATTR_PARAM_COUNT, pOciError);
printf("\nNumber of parameters of the cursor = %d\n",parmcnt);
for (pos = 1; pos <= (int)parmcnt; pos++)
OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &pos2,(ub4 *) 0,
(ub4)OCI_ATTR_CURRENT_POSITION, pOciError);
retval = OCIParamGet((void *)pOciStatCursor, (ub4)OCI_HTYPE_STMT, pOciError, (void **)&pOciParam,(ub4) pos );
// Get the column name
OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &name,(ub4 *) &len, (ub4) OCI_ATTR_NAME,(OCIError *)pOciError );
// Get the column datatype
OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &type,(ub4 *)0,(ub4)OCI_ATTR_DATA_TYPE,(OCIError *)pOciError);
// Get the column size
OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &size,(ub4 *)0,(ub4)OCI_ATTR_DATA_SIZE,(OCIError *)pOciError);
printf("Column %i\tNAME = %.*s \ttype %d \tsize %d\n",pos,len,name,type,size);
// OCIDefine ByPos, one for each parameter
// c_buf store the STATE_CODE, CITY_CODE and CITY_NAME columns from the cursor
rc=OCIDefineByPos(pOciStatCursor,&pdef,(OCIError *)pOciError,pos,c_buf[pos-1],size+1,(ub2)type,(dvoid *)c_indp[pos-1],(ub2 *)0,(ub2 *)0,OCI_DEFAULT);
printf("OCIDefineByPos retval=%d\n,rc);
// call OCIStmtFetch. In the next line, I receive the error
rc=OCIStmtFetch(pOciStatCursor,pOciError,1,OCI_FETCH_NEXT,OCI_DEFAULT);
printf("rc fetch %i",rc);
return 0;
{code} -
XML Data Set with Spry Slides - Please Help
Hi, I'm trying to combine XML Data Set with sliding tabs.
I've created two keys responsible for sliding the tabs:
<a id="previous" href="#"
onclick="sp1.showPreviousPanel();">Previous</a>
<a id="next" href="#"
onclick="sp1.showNextPanel();">Next</a>
Then XML Data Set is used to populate the tabs, but only a
single tab remains visible, and a "Next/Previous" buttons are used
to move to the next tab. And this is where the problem arises.
The problem is that, every time I refreash the gallery or
load it for the first time, I have to press TWICE the "Next" button
to move to the next image. After that, its all fine, and slides
well. It's only the FIRST time when loaded.
Please help.
Here's the full code:
<div id="images_gal" >
///////////////////////////////////////// The menu - the
culprit///////////////////////////////////////////
<div id="menu_next">
<a id="previous" href="#"
onclick="sp1.showPreviousPanel();">Previous</a>
<a id="next" href="#"
onclick="sp1.showNextPanel();">Next</a>
</div>
//////////////////////////////////////// The Sliding Panels
Gallery ////////////////////////////////////////////////////
<div id="example2" class="SlidingPanels" tabindex="0" >
<div class="SlidingPanelsContentGroup"
spry:region="dsSpecials">
<div spry:repeat="dsSpecials" id="{first}"
class="SlidingPanelsContent{second}"><div class="top_gal"
></div><div class="main_gal"><img
src="images/Galery/{third}" alt="Digital_Signage" width="600"
height="304" />
<p class="screen_gal"><a href="#"
onclick="MM_openBrWindow('film1.html','Coloris','width=340,height=260,
top=250, left=250')">CLICK TO VIEW</a></p>
</div><div
class="bottom_gal"></div></div>
</div>
</div>Anyone has any idea why I need a DOUBLE Click to start moving
the sliding panels?
I've just completed two tutorials by Don Booth.
1/Building a Spry Sliding Panels widget
2/Building a photo album with the Spry framework
But what I try to COMBINE them - display the photos in
sliding panels, I also need to DOUBLE click the "next" buton before
it starts scrolling.
Why is that Double Click needed? Help Please.
Here's my code for the combined version:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
a {
position:relative;
left:23px;
top:127px;
z-index:10000;
color: #FF0000;
</style>
<script type="text/javascript"
src="photo_album_samples/includes/xpath.js"></script>
<script type="text/javascript"
src="photo_album_samples/includes/sprydata.js"></script>
<script type="text/javascript"
src="Spry/SprySlidingPanels.js"></script>
<link type="text/css" rel="stylesheet"
href="Spry/SprySlidingPanels.css">
</head>
<body>
<div >
<a href="#" onclick="sp1.showPreviousPanel();">Previous
Panel</a>
<a href="#" onclick="sp1.showNextPanel();" >Next
Panel</a>
</div>
<div id="panelwidget" class="SlidingPanels" >
<div class="SlidingPanelsContentGroup"
spry:region="dsGallery" >
<div spry:repeat="dsGallery" class="SlidingPanelsContent"
id="p1"><img
src="photo_album_samples/thumbnails/{@thumbpath}"/></div>
</div>
</div>
<script type="text/javascript">
var dsGallery = new
Spry.Data.XMLDataSet("photo_album_samples/photos.xml",
"gallery/photos/photo");
</script>
<script type="text/javascript">
var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
</script>
</body>
</html> -
How do I link a Spry data set with a detail region to a html web site?
I have created a spry data set with a detail region. It works well. However, I would like to have a link from the detail region to another html web site. Can anyone help with the code? Below is the spry data set.
<?xml version="1.0" encoding="utf-8"?>
<books>
<book>
<title>The Advnentures of Crunchy and Munchy Squirrel: Field Nuts</title>
<author>Levester Williams</author>
<image>images/portfolio/tn_adventuresOfCrunchyAndMunchySquirrel.jpg</image>
<description>This delightful book for young readers teaches the importance of obedience and always doing what you know is right.</description> I
<weblink >www.crunchyandmunchy.com</weblink>
</book>
<book>
<title>More Dirty Little Secrets</title>
<author> Dr. Claud Anderson and Brant Anderson</author>
<image>images/portfolio/tn_moreDirtyLittleSecrets.jpg</image>
<description>In More Dirty Little Secrets, Dr. Claud Anderson and his son Brant Anderson, piece together little known facts about Black people, thier achievements, influence, involvement, tribulations and present them with wit and humor.</description>
<weblink>http://powernomics.com/</weblink>
</book>
</books>Hi,
In your html page, use the following notation:
<a href="http://{weblink}" title="{weblink}" target="_blank">{weblink}</a>
I hope this helps.
Ben -
How to fetch NO DATA FOUND exception in Ref Cursor.
In my procedure ref cursor is out parameter with returns dataset. in my proceudre
its like...
OPEN pPymtCur FOR
select.....
when I call this procedure from report to get dataset it causes NO DATA FOUND exception.
How to fetch this exception in my oracle procedure so I can get some other data.
Any Idea to do this?
Edited by: Meghna on 17-Jun-2009 22:28Mass25 wrote:
Correct me if I am wrong.
So if I do something as follows in my stored proc, I do not have to check for NO_DATA_FOUND?
OPEN my_CuRSR FOR
SELECT DISTINCT blah blah blahmy_cursr is what I am returning as OUT param in my SP.Correct. At the point you open the cursor, oracle has not attempted any 'fetch' against the data so it won't know if there is any data or no data. that only occurs when a fetch is attempted.
Take a read of this:
[PL/SQL 101 : Understanding Ref Cursors|http://forums.oracle.com/forums/thread.jspa?threadID=886365&tstart=0] -
Using temporary tables with a ref. cursor
I want to use a temporary table to populate certain data and then return a ref cursor fetching data from the temporary table.
1. Will this approach work ?
2. Do I need to drop the temporary table ? Can I drop the table as a last statement in the stored proc (remember a ref cursor based on this table is to be returned as a out parameter).
Please help.1. Will this approach work ?Sort of, just like it is possible to dig a trench with a spoon. It can be done, but why can't you just write a select that returns the data without storing intermediate versions of your processing somewhere.
2. Do I need to drop the temporary table ?No. and you shouldn't.
Can I drop the table as a last statement in the stored proc
(remember a ref cursor based on this table is to be returned as a out parameter).No.
If you really need to use a temporary table, it should be created one time when the application is installed, and should never be created in code. -
Data binding with Multiple Filter
Hi Experts,
I am trying to do the data binding using filters with multiple values.
ex: I am selecting the multiple values from list dialog and those i want to pass to odata service as a filters.
name : abc
pqr
I am looping on above and pushing it to array of filters.
jQuery.sap.require("sap.ui.model.FilterOperator");
var FilterOperator = sap.ui.model.FilterOperator;
var filtersTerr = new Array();
for(i=0;i<name.length;i++){
filterName = new sap.ui.model.Filter("FirstName", sap.ui.model.FilterOperator.EQ, name[i]);
filter.push(filterName );
this..getBinding("items").filter([filter],false);
Final filter should be something $filter=FirstName='abc' or FirstName='pqr'.
I have already looked into below discussions but somehow came to conclusion that array cannot be use with OR/AND.
Odata Filter with OR
http://scn.sap.com/thread/3462246
http://scn.sap.com/thread/3560814
Please let me know how this needs to be written.
Thanks,
RahulHi Rahul
There are many ways.
Filter for table
var sRlUrl = "http://<host Name>/sap/opu/odata/sap/ZTWMP" ;
var list = new sap.ui.model.odata.ODataModel( sRlUrl, false, "username", "pswd");
list.setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);
var iv_proID = sap.ui.getCore().getElementById('input1').getValue();
var iv_listNo = sap.ui.getCore().getElementById('input2').getValue();
var iv_Matnr = sap.ui.getCore().getElementById('input3').getValue();
var iv_Po = sap.ui.getCore().getElementById('input4').getValue();
//... Set any Filters .. if reqd'
var oFilter = new Array();
var iCount = 0;
if (iv_proID) {
oFilter[iCount] = new sap.ui.model.Filter("abc", sap.ui.model.FilterOperator.EQ, sap.ui.getCore().getElementById('input1').getValue());
iCount++;
if (iv_listNo){
oFilter[iCount] = new sap.ui.model.Filter("def", sap.ui.model.FilterOperator.EQ, sap.ui.getCore().getElementById('input2').getValue());
iCount++;
oFilter[iCount] = new sap.ui.model.Filter("PcTotal", sap.ui.model.FilterOperator.EQ,"HEADER" );
iCount++;
sap.ui.getCore().getElementById('T-POhdr-DR').setModel(list);
//... Bind Rows with oData, with filters if any
sap.ui.getCore().getElementById('T-POhdr-DR').bindRows({
path: '/t_entity set/',
filters: oFilter
2 General filter
OData.read({ requestUri: "http://<URL>:8001/sap/opu/odata/sap/ZTMP_ABC/Item?$filter=ID eq '"+ID+"' and DESC eq '"+Desc+"'", headers: { Accept: "application/json" } }, function (data, response) {
if (data.results[0]) {
sap.ui.getCore().byId("oInput2").setText(data.results[0].<odata field to assign>; -
How to use data sets with smart objects?
Hi,
I have a psd of some mock-up boxes, and I want to apply different text to multiple versions. The solution here: http://helpx.adobe.com/photoshop/using/creating-data-driven-graphics.html is good, but doesn't seem to work with smart objects?
The file that I have has the box label as a smart object (which opens as a psb). How could I apply a data set to that, and have it pump out multiple jpegs?
If I apply the data set to the psb layers, then go back to the main image, I cannot export the whole complete picture anymore.
Thanks!What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics. -
Tip for Data Merge with Multiple Records (labels, etc.)
I have seen many InDesign Data Merge questions about how to create sheets of mailing labels, especially the problem of getting only one label per page, when you need 30 or more.
Adobe's instructions are poor and incomplete in that InDesign doesn't step out the records from a data source - it steps out the FRAMES that contain the data field placeholders.
That is why you only need to place a text or image frame once on a single page - during the datamerge, InDesign will create the additional FRAMES for each record, and it will create the pages required to hold them.
You do have to set the desired spacing on the
If you create the frame on a Master page, ID allows you to update the data source (when it changes) in the Data Merge tool panel.
These are very nice and robust features, but the documentation for them is confusing to many people.
You will find more great in-depth help for Data Merge, with screen captures and attachments, here in the forum.For a multiple record merge you need one set of placeholders, then set the margins and spacing in the merge options so the positioning is correct.
Warning: Using Preview in a multiple record merge will corrupt the file. If you press the preview button, Undo after looking at the preview, then merge without using preview. -
Error message when using Spry Data set with XML
Hi,
I have what i see as a big problem, might just be me being
dumm, but here we go.
When I try to use the feature of spry XML Data Set and insert
spry table I get error message when trying it in IE 7.
There are even a problem when I use fireworks automated slide
show function, where you can choose to use the Spry/XML gallery
feature.
The error message I get everytime (incl the auto gallery in
fireworks) is:
The tag: "html" doesn't have an attribute: "xmlns:spry" in
currently active versions.[XHTML 1.0 transitional]
The tag: "div" doesn't have an attribute: "spry:region" in
currently active versions.[XHTML 1.0 transitional]
The tag: "th" doesn't have an attribute: "spry:sort" in
currently active versions.[XHTML 1.0 transitional]
and so on.
What´s wrong?!Hello barvid,
Ok, let's take each problem step by step:
1. The first error you see in the browser: " Exception while
loading ..." normally appears when you try to load files that are
not permitted by the browser security model. This means the XML
file you try to load is located on a different server than your
HTML which is not allowed. The browser is not permitting to load
any files that are not in the same domain as the current page
because of the complex security risks. You'll have to either get
the XML file from its original location and save it in your website
or use a proxy on your web server that should request that file
from the external server and send it to the browser as an XML from
the same domain as the HTML origin.
1.2 The "Exception while loading ..." error you see is a
generic error and my previous advise is based on my experience. In
case this is not your scenario you'll have to open the SpryData.js
and around line 112 you'll see the following code:
Spry.Debug.reportError("Exception caught while loading " +
url + ": " + e);
Please change this line with the following line of code:
Spry.Debug.reportError("Exception caught while loading " +
url + ": " + (e.message?e.message:e));
to obtain a more verbose error message that may clarify the
reasons of your errors.
2. The problems you describe are not browser errors but they
are w3c validation errors. At this point the XHTML standard allows
every application that define custom namespace attributes to also
link a DTD to the page so the page to continue to be valid.
Unfortunately at this point this feature is not correctly supported
by the FF and IE so we wrote an articles about how you should
link
the Spry DTD to your page so the validator understand the
custom attributes Spry use. You'll find inside the full description
of the problems and all the technical details you'll need to know
to solve this issue.
Regards,
Cristian -
Can we use same data definition with multiple concurrent programs?
Hi,
My requirement is as below:
I have two concurrent programs (say CP1 and CP2), both concurrent programs need to use same data definition (the same data template xml file) and same RTF layout template. However when registering data definition in the E-Biz, the data definition code must match concurrent program, hence I have to create two definitions (for the same data template xml file) and because layout template is attached with data definition I have to duplicate the layout definition also.
In summary, i have to create two (duplicate) Data Definition and Layout Template for the same dataTemplate.xml and Layout.rtf files. Is there any way to avoid this duplication?
The only issue with duplication is any change in xml or rtf needs to be updated in all the four definitions (2 data definitions and 2 layout definitions).
Thanks
BhavikI found the resolution and thought of sharing
you can see this post
*[How to use same data definition/template between multiple concurrent programs? |http://techatwork.wordpress.com/2009/08/06/how-to-use-same-data-definitiontemplate-between-multiple-concurrent-programs/]*
Thanks
Bhavik -
Build a table based on XML data set with Spry
Hi there,
I'm new to spry technology therefore forgive any basic question of mine.
I'm trying to fill content in a table based on XML data set values but nothing is shown :-(
here is my code.... any suggestion? pls tell me where I'm wrong.
Thank you in advance
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
var uscite = new Spry.Data.XMLDataSet("data/Calendario 2011.xml", "csv_data_records/record", {sortOnLoad: "Date", sortOrderOnLoad: "ascending"});
uscite.setColumnType("Date", "date");
uscite.setColumnType("km", "number");
</script>
<div class="RankContainer" id="UsciteDiv" spry:region="uscite" >
<table width="100%" border="0" class="RankTable">
<tr>
<th width="10%" scope="col" spry:sort="Date">Data</th>
<th width="20%" scope="col">Destinazione</th>
<th width="5%" scope="col">KM</th>
<th width="35%" scope="col">Percorso</th>
<th width="30%" scope="col">Breve</th>
<!-- <th width="15%" scope="col">Mappa</th>-->
</tr>
<tr>
<script type="text/javascript">
var rows = uscite.getData();
for (var i = 0; i < rows.length; i++)
if (rows[i]["Mappa"].startsWith("/"))
rowContent = "<td> si </td>";
else
rowContent = "<td> no </td>";
document.write("<td>{Date}</td>");
document.write("<td>"+rowContent+"</td>");
document.write("<td>{km}</td>");
document.write("<td>{Percorso}</td>");
document.write("<td>{Breve}</td>");
</script>
</tr>
</table>
</div>Sure this is how it should work (except that no anchor tag shall be present for Destinazione whereas Mappa has no real value in)
http://www.gsc-borsano.it/_Calendario%202011.html
and this is the non working page
http://www.gsc-borsano.it/_v2Calendario%202011.html
Thanks -
Error in viewing data in a data template with multiple data sources
Hello,
I have designed a data template with two data sources.One is from DEPARTMENTS table and the other datasource is a xml file.Following is the code for the data template :
<dataTemplate name="EmployeeListing" dataSourceRef="demo">
<parameters>
<parameter name="p_DEPTNO" dataType="character" defaultValue="20"/>
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT DEPARTMENT_NAME,DEPARTMENT_ID,LOC from DEPARTMENTS]]>
</sqlStatement>
<xml name="empxml" expressionPath=".//ROW[DEPARTMENT_NAME =$DEPARTMENT_NAME]">
<url method="GET" realm="" username="" password="">file:///D:\OraHome_1\xmlp\XMLP\DemoFiles\Employee Salary Report.xml</url>
</xml>
/dataQuery>
</dataTemplate>
The problem is when i am trying to view the data, only data from SQL Query Q1 is getting displayed and the data from Employee xml is not at all getting displayed.
Could anyone please let me know what i am missing?
Thanks
Nutan
Edited by: user609971 on Oct 23, 2008 8:06 AMThis is from Documenation sample....
Did you see the data structure section, where you say, how you wanted the columns ?
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<dataTemplate name="Employee Listing" description="List of Employees" v
ersion="1.0">
<parameters>- Defines a single parameter for the Department Number
- with default of 20:
<parameter name="p_DEPTNO" dataType="character"
defaultValue="20"/>
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT DEPTNO,DNAME,LOC from dept
order by deptno]]>
</sqlStatement>
<xml name="empxml" expressionPath=".//ROW[DEPTNO=$DEPTNO]"> - Defines name
- and link to DEPTNO in Q1
<url method="GET" realm="" username="" password="">
file:///d:/dttest/employee.xml</url> - Defines url for xml data
</xml>
</dataQuery>-
<dataStructure>- The following section specifies the XML hierarchy
- for the returning data:
<group name="G_DEPT" source="Q1"
<element name="DEPT_NUMBER" value="DEPTNO" />
<element name="DEPT_NAME" value="DNAME"/>
- This creates a summary total at the department level based
- on the salaries at the employee level for each department:
<element name="DEPTSAL" value="G_EMP.SALARY"
function="SUM()"/>
<element name="LOCATION" value="LOC" />
<group name="G_EMP" source="empxml">
<element name="EMPLOYEE_NUMBER" value="EMPNO" />
<element name="NAME" value="ENAME"/>
<element name="JOB" value="JOB" />
<element name="MANAGER" value="MGR"/>
<element name= "HIREDATE" value="HIREDATE"/>
<element name="SALARY" value="SAL"/>
</group>
</group>
</dataStructure>
</dataTemplate> -
Problems calling stored procedure with out ref cursors
Hi,
I am calling an oracle stored procedure and having problems. This is the code:
ResultSet cursor1, cursor2, cursor3, cursor4,cursor5,cursor6;
String sql = "BEGIN SYSADM.PKG_SERVICE.SERV_MAIN(:1,:2,:3,:4,:5,:6,:7,:8,:9) \n; END;";
CallableStatement call = null;
try
call = conn.prepareCall(sql);
call.setString(1,blah1);
call.setString(2,blah2);
call.setString(3,blah3);
call.registerOutParameter(4,OracleTypes.CURSOR);
call.registerOutParameter(5,OracleTypes.CURSOR);
call.registerOutParameter(6,OracleTypes.CURSOR);
call.registerOutParameter(7,OracleTypes.CURSOR);
call.registerOutParameter(8,OracleTypes.CURSOR);
call.registerOutParameter(9,OracleTypes.CURSOR);
call.execute();
cursor1 = ((OracleCallableStatement) call).getCursor(4);
cursor2 = ((OracleCallableStatement) call).getCursor(5);
cursor3 = ((OracleCallableStatement) call).getCursor(6);
cursor4 = ((OracleCallableStatement) call).getCursor(7);
cursor5 = ((OracleCallableStatement) call).getCursor(8);
cursor6 = ((OracleCallableStatement) call).getCursor(9);
on the cursor1 = line I get this exception:
06/08/08 15:07:01 java.lang.ClassCastException: com.evermind.sql.FilterCallableStatement
this is a web service running in JDeveloper 10.1.2
DennisDennis,
There is only one "data-sources.xml" file in my JDeveloper 10.1.3. It is in the "\j2ee\home\config" subdirectory.
But the again, I have not used my JDeveloper to create any Web services.
I really think you should try the JDeveloper and ADF forum.
Also, there are several debug properties you can set for OC4J.
Since you say you are using 10.1.2, the following Web page may be helpful:
http://www.oracle.com/technology/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html
Good Luck,
Avi.
Maybe you are looking for
-
Enterprise App on Multiple Devices
Hi, I'm making my first enterprise app intended for both iPad and iPhone. In terms of distribution is it possible to download on just one device and have it sync to the other on the same Apple ID or is this only for apps distributed through the App S
-
How can I move photos from photo stream to an Album?
I want to rearrange photos in my photos into Albums. Can someone tell me how to move photos from photo stream into Albums?
-
Using InfoPath and the Web service GetUserProfileByName-An error occurred accessing a data source
Hi, Everyone, I want to realize the function that when user fills out the infopath form the form can automatically get current users' name and I've searched that I can use the Web service GetUserProfileByName method. When I preview the form it is all
-
I have a device that shows up in my airplay device list in iTunes, and on my iPhone that does not exist. How do I delete it? I have OS X 10.10.1 on my iMac, and iOS 8.1.2 on my iPhone 5. I would like to get it out before I add new airplay devices t
-
CX_SY_NO_HANDLER
Hi experts, I have a call to a function module in ZXRSRU01 coded below: CASE v_var1. WHEN 'TEST'. CALL FUNCTION 'ZBW_TEST' EXPORTING I_VNAM = I_VNAM I_VARTYP = I_VARTYP I_IOBJNM = I_IOBJNM