Query for records on a block with Query Data Source Type : Procedure
Hi All,
The veriosn of form I'm using is:
Forms [32 Bit] Version 6.0.8.23.2
I have a block based on a procedure.
But when I enetr-query and search for records specific to ceratin criteria even then the result of the Query is all records.
Is Query not allowed on a block with Query Data Source Type : Procedure.
Hope my question is clear.
Thanks in advance.
Regards
Arif
When you use a table based block, forms can construct any select with any where clause based on the given inputs. Using a procedure based block, forms cannot "know" which in or out parameter of the procedure corresponds to which item. Even if Forms could pass the value of an item to an argument automagically, the procedure would have to "do something" with the argument, and you´d have to code it.
So, any item that should be used in the where-clause must be mapped to an argument.
Perhaps it would be easier to use a table based block querying a view? For DDL, you could use an instead-of-trigger on the view.
Regards,
Gerd
Similar Messages
-
Query data source type = procedure or from clause
1)I have a form where a block is based on a from clause. In the source name I entered a simple sql statement.
Isn't the items suppose to show without any other action or
WHAT ELSE DO I NEED TO DO IN ORDER TO SEE THE BLOCK ITEMS EQUIVALENT TO THE COLUMNS IN THE QUERY?
2) I have a form where a block is based on a procedure.
First I created a package in a program unit with the procedures query_procedure, insert_procedure, update_procedure, delete_procedure and lock_procedure.
Then I set the query data source name to the package query_procedure. The columns and arguments were automatically filled by Forms - they are fine as well.
Forms automatically created the block triggers insert-procedure,delete-procedure, update-procedure and lock-procedure.
Everything seems to be fine but when I run the form and execute the query I get frm 40505 - unable to perform query.
What am i doing wrong?
This is the package:
PACKAGE pkgdeptemp IS
type dept_emp is record (
empno number(4),
ename varchar2(10),
job varchar2(9),
hiredate date,
sal number(7,2),
deptno number(2),
dname varchar2(14));
success constant number :=0;
type dept_emp_ref is ref cursor return dept_emp;
type dept_emp_tab is table of dept_emp index by binary_integer;
procedure query_procedure (resultset in out dept_emp_ref, p_empno in number);
procedure lock_procedure (dmlset in out dept_emp_tab);
procedure insert_procedure (dmlset in out dept_emp_tab);
procedure update_procedure (dmlset in out dept_emp_tab);
procedure delete_procedure (dmlset in out dept_emp_tab);
END;
PACKAGE BODY pkgdeptemp IS
function get_success return number is
begin
return(success);
end;
procedure query_procedure (resultset in out dept_emp_ref, p_empno in number) is
begin
open resultset for
select e.empno, e.ename, e.job, e.hiredate, e.sal, e.deptno, d.dname
from emp e, dept d
where e.deptno = d.deptno
and e.empno = nvl(p_empno, e.empno);
end query_procedure;
procedure lock_procedure(dmlset in out dept_emp_tab) is
tempout number(4);
begin
for i in 1..dmlset.count loop
select empno
into tempout
from emp
where empno = dmlset(i).empno
for update;
end loop;
end lock_procedure;
procedure insert_procedure (dmlset in out dept_emp_tab) is
cursor c_dept (i binary_integer) is
select deptno
from dept
where deptno = dmlset(i).deptno;
tempout number(4);
begin
for i in 1..dmlset.count loop
open c_dept(i);
fetch c_dept into tempout;
if c_dept%notfound then
insert into dept(deptno,dname)
values(dmlset(i).deptno, dmlset(i).dname);
end if;
close c_dept;
insert into emp (empno,ename,job,hiredate,sal,deptno)
values (dmlset(i).empno, dmlset(i).ename, dmlset(i).job, dmlset(i).hiredate, dmlset(i).sal, dmlset(i).deptno);
end loop;
end insert_procedure;
procedure update_procedure (dmlset in out dept_emp_tab) is
cursor c_dept (i binary_integer) is
select deptno
from dept
where deptno = dmlset(i).deptno;
tempout number(4);
begin
for i in 1..dmlset.count loop
open c_dept(i);
fetch c_dept into tempout;
if c_dept%notfound then
insert into dept(deptno,dname)
values(dmlset(i).deptno, dmlset(i).dname);
else
update dept
set deptno=dmlset(i).deptno,
dname=dmlset(i).dname;
end if;
close c_dept;
update emp
set empno=dmlset(i).empno,
ename=dmlset(i).ename,
job=dmlset(i).job,
hiredate=dmlset(i).hiredate,
sal=dmlset(i).sal,
deptno=dmlset(i).deptno;
end loop;
end update_procedure;
procedure delete_procedure (dmlset in out dept_emp_tab) is
begin
for i in 1..dmlset.count loop
delete from emp where empno = dmlset(i).empno;
end loop;
end delete_procedure;
END;for ur q1:
create the text items manually in the layout editor or in the obj navigator then specify there properties manually in the the pallette.
database item = yes
column name = field name in ur select statement
for q2:
try running the form again and press F8 then if an error occur press F1 or shift F1 to show the error in ur code.
i suspect u forgot to specify a value for the in parameter the reason why u get an error that is specify the actual parameter for ur in argument then press F8.
enjoy! -
Query for all open sales order with a date range
Hi Experts!
I wrote this query that will look up all open sales order of a particular customer and how much was served:
SELECT T0.[DocNum] 'OS #', T0.[DocDate] 'Posting Date', T0.[CardName] 'Customer', T1.[Dscription] 'Item Description',T4.[SalUnitMsr] 'Sales UOM', T4.[InvntryUom] 'Invty UOM', T1.[UseBaseUn] 'Use of Invty UOM' , T1.[Quantity], T1.[Quantity]-T1.[OpenQty] 'Served Qty', T1.[OpenQty] 'Unserved Qty' FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE T0.[DocStatus] = 'O' and T0.[CardName] =[%0]
However, I don't know how to input a parameter for the date range in a query. Can anyone help with this issue?
Your input will be highly appreciated.
Warm regards,
JenHiiiiiii
Try This.....
SELECT T0.DocNum 'OS #', T0.DocDate 'Posting Date', T0.CardName 'Customer', T1.Dscription 'Item Description',T4.SalUnitMsr 'Sales UOM', T4.InvntryUom 'Invty UOM', T1.UseBaseUn 'Use of Invty UOM' , T1.Quantity, T1.Quantity, T1.OpenQty 'Served Qty', T1.OpenQty 'Unserved Qty' FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE T0.DocStatus = 'O' and T0.CardName ='[%0]' and (T0.DocDate>='[%1]' and T0.DocDate<='[%2]')
Regards, -
Oracle Forms - How can I create a Data Block with query
Dear friends I have a question, I couldn't do this..
I have a sql query, I want to show the datas of the query.. How can I do this. ?
Data Block Wizard wants a table, view or stored procedure, but I have a query, how can I create a data block with my query.. I m waiting your helps..? Please...
SemihHi,
You have two options
1. create a view and base the block on the view
2. create a block with a query Data Source Type of 'FROM clause query'
Hope this helps
Neil -
Adhoc Query Requirement with Multiple Data Source
Hi All,
I have a Adhoc Query Requirement with Multiple Data Source. Is there any way to achive it. Other than Resultant set and bring into Model.
Thanks
SSYou can compare stuff in the EL, but I don't think this is what you need.
You can just use Java code in the backing bean class for all the business logic. You can use DAO classes for database access logic. Finally for displaying you can use the JSF tags such as h:outputText. -
Block Property (Query Data Source Type)
Hello Friends
I am using Forms 6i.oracle 9i.
in the Block Property Pallete under Query Data Source Type there
are 4 Type is mentioned.i have used Table,From Clause Query but yet to use Transactional Trigger and Procedure.How to use this two and it will be very kind enough if u give any example about these twos.
RegardsThere's a whole bunch of explanation about this subject in the online help of Forms. Just select the Query Data Source Type property and press F1. The initial explanation is very limited but there are a number of useful links under "Related topics"
-
Abnormal termination of runform when PROCEDURE is used as Query Data Source Type
I created a package with a procedure that returns a table of records. This
procedure tested OK in SQLPLUS. I then created a form and in this form a block
that used this procedure as the Query Data Source Name, and of course the Query
Data Source Type has been set to PROCEDURE. This form runs beautifully when the
number of records returned is small (a few hundreds). But when the number of
records is large (I have one case where the total number of records returned
was 11099) then it will crash. I also found that whenever this happens, there
will be a file in my C:\TEMP with funny namessuch as s90, s81, etc. They are
always the same size (5008 kBytes).
Anyone any ideas?
null<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Chandra movva([email protected]):
Create a view and base your block on view.That could solve the problem unless you have other requirements specifically.<HR></BLOCKQUOTE>
Chandra,
Thank you for your suggestion. Unfortunatel, we have requirements that translate to logics too complicated to be handled by views, and that is why we use PROCEDURES. This actually works very well and very fast, except when we have lots of records returned, then it fails. I am just wondering whether this is a configuration problem ???
Regards,
A. Leung
null -
How can I update record in the block that Data Source is PROCEDURE?
I like use Procedure as the Data Source of block.It's very flexible.
Usually I do this only query the record,but now I must update record in the block that Data Source is Procedure.
What next step can I do?Can anyone offer some examples?
This is example, you goto
http://www.2shared.com/file/1923834/e0b65fb7/Example.html
Wait about 30 sec, Click "Save file to your PC: click here",and then you can download it.<p>I have written an article about some advanced Forms features.
Have a look at the 2.3.2 paragraph</p>
Francois -
Hi.
I installed the full suite of tools as I am involved with a company intended to become a partner and reseller so we are trying to get everything working.
SAP Crystal Server 2013 SP1
BusinessObjects Business Intelligence platform
SAP Crystal Reports for Enterprise
SAP HANA
SAP Crystal Reports 2013 SP1
SAP BusinessObjects Explorer
SAP Crystal Dashboard Design 2013 SP1
Crystal Server 2013 SP1 Client Tools
SAP BusinessObjects Live Office 4.1 SP1
.NET SDK
I found out that BI was needed only after I installed all the others but I installed it without problem.
My issue is that the Information Design Tool (IDT) which creates my universes successfully, and even lets me open and see the dada no problem. Is using a 32bit (ODBC connected to SQL Server 2008) data source.
However, I am unable to load the .UNX in crystal reports (CR) 2011, so I used CR Enterprise (CRE) to connect to my universe. Now when I try to open the universe I start getting the following error:
[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
When I do searches online I get very generic information relating to setting up data sources. While I believe the problem is indeed with the data source, I don't believe it is setup wrong.
When I access the universe using the IDT (which uses the 32bit version of the data source to build its connection, it wont let me use a 64bit) I can load a table under the "result objects for query #1" press refresh, I get a list of data.
When I access the same universe using CRE (which "Seems" to use a 64bit data source, but I am not sure), and follow the same process as above. I get the above error.
If I cancel the process, when CRE lists the fields for the report I can later manually map these fields to an ODBC connection. But if I have to do this what is the point of using the universes at all as the end user has full access to all the various DB's available in the data source.
Thanks in advance for any help you can provide.On the server where Crystal Reports Server is installed, create a 64-bit ODBC connection with the same name as the 32-bit connection. CRS will then automatically use the 64-bit version of the connection.
-Dell -
hi,
I can't create...
Query Data Source Type: FROM clause query
Query Data Source NAme: (select t.col1 as cl1,t.clo2 as cl2, m.col1 as cl3
from tab1 t, tab2 m)
WHERE clause: cl1=:master.col1 and cl3=:master.col3
is not work....
form's 6i
thank's
JomarYou can not use where condition if query data source type is
From Clause Query.
Use DB view and filter data by Where clause in the block.
D -
Using query data source type as procedure
Could anyone pls. let me know how to use the query data source type property as procedure? Is there any example or document where I can find the above info? Any help or reference to doc will be helpful...
Thanks in advanceHave a look at Note 66887.1 on MetaLink.
-
Sample report for filling the database table with test data .
Hi ,
Can anyone provide me sample report for filling the database table with test data ?
Thanks ,
Abhi.hi
the code
data : itab type table of Z6731_DEPTDETAIL,
wa type Z6731_DEPTDETAIL.
wa-DEPT_ID = 'z897hkjh'.
wa-DESCRIPTION = 'computer'.
append wa to itab.
wa-DEPT_ID = 'z897hkjhd'.
wa-DESCRIPTION = 'computer'.
append wa to itab.
loop at itab into wa.
insert z6731_DEPTDETAIL from wa.
endloop.
rewards if helpful -
11i EBS XML Publisher Report with Multiple Data Source
I need to create XML Publisher report in 11i EBS pulling data from another 10.7 EBS Instance as well as 11i EBS in single report.
I am not allowed to create extract or use db links.
My problem is how to create Data Source Connection using Java Concurrent Program.
The approach I am trying is
1. create Java concurrent program to establish connection to 10.7 instance.
2. Will write the SQL queries in Data Tempalete with 2 Data Source 1 for 11i EBS and 2 for 10.7 EBS
3. Template will show the data from both query in 1 report..
Is there any other way to proceed using datasource API...
thanksoption1:
The query should be same @ detail level, only the template has to be different for summary and details.
@runtime, user can choose to see the detail/summary
Disadvantage, if the data is huge,
advantage , only one report.
option2:
create two separate reports summary and details
and create diff data and diff layout and keep it as different report
Advantage, query will perform based on the user run report, summary/detail, so that you can write efficient query.
Dis advantage , two reports query/template to be maintained. -
Using ConnBean and CursorBean with a Data Source
Hi all,
I',m making a web app. using the Jdev (RUP4) with OA Extension. I looked in the help menu under "About Data-Access JavaBeans and Tags". Here I found the following example, but for some stange reason I cannot get the setProperty to work.
Example: Using ConnBean and CursorBean with a Data Source This following is a sample JSP page that uses ConnBean with a data source to open a connection, then uses CursorBean to execute a query.
<%@ page import="java.sql.*, oracle.jsp.dbutil.*" %>
<jsp:useBean id="cbean" class="oracle.jsp.dbutil.ConnBean" scope="session">
<jsp:setProperty name="cbean" property="dataSource"
value="<%=request.getParameter("datasource")%>"/>
</jsp:useBean>
<% try {
cbean.connect();
String sql="SELECT ename, sal FROM scott.emp ORDER BY ename";
CursorBean cb = cbean.getCursorBean (CursorBean.PREP_STMT, sql);
out.println(cb.getResultAsHTMLTable());
cb.close();
cbean.close();
} catch (SQLException e) {
out.println("<P>" + "There was an error doing the query:");
out.println("<PRE>" + e + "</PRE>\n<P>"); }
%>
Does anyone know how to set the "Property" to a datasource and make it work?
Best regards,
MHCIThere is no point-and-click (Import Data Source Metadata) way to use an LDAP server as a datasource. You have to use the Java Function provided on dev2dev. If you need help with it, please post here.
- Mike -
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>
Maybe you are looking for
-
OSB file logging settings configuration
Dear Experts, I need to know if it is possible to log on file all messages of error (i.e $fault variable) during a flow execution without using in the flow neither logs neither report. Is it possible ? If it is, which the correct WLS settings configu
-
I haven't been able to synch for a very long time. I'm finally tired enough of the same music constantly on my ipod that I'm trying again to find some help. I'm computer literate, but not a tech person by any stretch. According to itunes, I'm not due
-
How to stop closing windows accidentally?
I work with many windows open. I would like to "lock" my tabs so I don't always accidentally close windows.
-
I used to make Flex 3 applications until yesterday. Today I can't and I don't know why (was it Windows Update!?). I have the latest Flash Player Debug version installed. If I launch IE normally, I can see any type of flash content on the web: This is
-
How to download Adobe DNG Converter?
I've tried the links on the Adobe site but they take me only to an error message on both Firefox and Safari. I've got some JPGs I need to convert to DNG. (Hopefully this software will do the trick) Thanks for your help!