Setting Query Data Source Arguments Property for Block with TYPE Procedure
Hi,
I have a block whose type is 'Procedure', this returns a PL/SQL table.
I pass an IN OUT variable declared in the Package header and all works well.
What I need to know is how, if I have ANOTHER argument, how do I set it programatically prior to EXECUTE_QUERY.
I can see how to set the Name and Value manually at the "Query Data Source Arguments" property but if I need to set it dynamically in the code how would I do it.
Thanks,
Worked it out.
Set the VALUE to the name of a Global variable and populated the variable before executing the procedure.
Thanks
Similar Messages
-
hi
i build a block based on storeprocedures ,if i set the
Query Data Source Arguments property in design time with a value
my form will work,
but i need to set this property programetically and in runtime,
if there is any built_in or other ways ,please help me.
thanks in advance.
shoja.Sorry, but there is no way to do this.
If you need to switch the table you're selecting from, you have to do this
inside your stored procedure. -
Help !!!set Arguments property for block based on store procedures
hi
i build a block based on storeprocedures ,if i set the
Query Data Source Arguments property in design time with a value
my form will work,
but i need to set this property programetically and in runtime,
if there is any built_in or other ways ,please help me.
thanks in advance.
shoja.Sorry, but there is no way to do this.
If you need to switch the table you're selecting from, you have to do this
inside your stored procedure. -
How to use 'query data source Name ' property in a block
I want to create a block using query and want to show the columns on a form.
Could you please tell me how can I do this?
RegardsHi!
Create a new block manually.
Set the Query Data Source Type Property to FROM clause query.
In the Query Data Source Name Property write your query like you would
write it in sql*plus or toad but without a order by clause.
Set the DML Data Target Type Property to None.
Create items for the columns in your query.
May set the where clause and order by property of the block.
Build the form and execute a query in your new block.
Regards -
About Query Data Source Columns property
Hello everyone,
I'm new to Oracle Forms version 10.1.0.2.
When I create a data block based on a table using Data Block Wizard, the block's Query Data Source Columns property is automatically populated with column definition entries corresponding to the columns of the base table.
I tried making changes to these entries, for example by changing the data types to wrong data types or even deleting them, and I found that those changes had no effect on the block at all. The form was still working as I wanted.
Please explain what is exactly the role of the block's Query Data Source Columns property.
Thank you very much.
p.s: The F1 key help says "The Query Data Source Columns property is valid only when the Query Data Source Type property is set to Table, Sub-query, or Procedure". So, please explain in each context of Query Data Source Type.p.s: The F1 key help says "The Query Data Source Columns property is valid only when the Query Data Source Type property is set to Table, Sub-query, or Procedure". So, please explain in each context of Query Data Source Type.
IMHO those properties are very self-explaining: It is the data source of the block, or in other terms: how it is populated.
Table means the data block is based on a table and subsequently will be populated by
select col1, col2, col3 from your_table
With sub-query the block will be populated with your subquery; forms will issue
select col1, col2, col3 from (
-- this is your subquery
select col1, col2, col3 from tab1, tab2 where [....]
With Procedure in short you'd have a stored procedure which returns a ref cursor and the block will be populated by the ref cursor.
As for your question about the name: this actually should matter; the default is NULL which means that there needs to be a column which has the exact name as the item so in the above sample with table the item associated with your_table.col1 should be named col1. If it isn't the property should be named like the column. If this property also doesn't reflect the name this shouldn't work IMO.
cheers -
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
ArifWhen 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 -
Frm-41380 error - cannot set the blocks query data source
Fairly new forms so bare with me. I am creating a form based on one table. This table has one column that is a nested table.
table name: szrtime
table columns: szrtime_code, szrtime_styp_list
szrtime_styp_list is a table of varchar2(1).
main block is szvtime_block
the block that contains the nested table is szvtime_styp_block
I read that I could use a WHEN_NEW_RECORD_INSTANCE trigger on the main block to display the related nested table. I have tried the folllowing:
Declare
select_stmt Varchar2(512) ;
Begin
If :szvtime_block.szvtime_code Is not null Then
select_stmt := '(SELECT column_value FROM TABLE ( SELECT szrtime_styp_list FROM szrtime WHERE szrtime_code = ''' || :SZVTIME_BLOCK.SZVTIME_CODE || '''))';
Go_Block('SZVTIME_STYP_BLOCK' );
Clear_Block ;
message('select_stmt = '||select_stmt);
Set_Block_Property( 'SZVTIME_STYP_BLOCK', QUERY_DATA_SOURCE_NAME, select_stmt ) ;
Execute_Query ;
Go_Block('SZVTIME_BLOCK') ;
Else
Go_Block('SZVTIME_STYP_BLOCK' );
Clear_Block ;
Go_Block('SZVTIME_BLOCK') ;
End if ;
End ;
The result is the frm-41380 error.
I have tried change the query data source type on the nested table block to Table or From-clause but did not help. The select statement that is valid and returns the correct result in Toad.
Any suggestions on what to look for? Thank you.
Todd> But what is giving me pause is that the user will be updating, deleting, and inserting
into this table and, of course, the nested table column.
It would give me pause, too. I've never used nested tables, so I poked around in Forms on-line help. In Forms 6i, it specifically states that Forms does not support the Nested Table structure.
In Forms 10g help, it describes Nested Table structures, but says NOTHING about how a form would handle it. And that implies to me that it is still not supported. So good luck.
In addition to creating the view, you may need to provide your own nested table updating procedures via a package on the server which your form can call. I know Forms supports passing pl/sql tables ("indexed by binary_integer"), so you could pass your nested table back and forth between the package and the form in that format. -
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"
-
How to set JDBC Data Sources in Oracle MapViewer for Oracle database 12c Release 1 (12.1.0.1)?
The following is my configuration in the conf\mapViewerConfig.xml:
<map_data_source name="mvdemo12"
jdbc_host="127.0.0.1"
jdbc_sid="orcl12c1"
jdbc_port="1522"
jdbc_user="mvdemo"
jdbc_password="7OVl2rJ+hOYxG5T3vKJQb+hW4NPgy9EN"
jdbc_mode="thin"
number_of_mappers="3"
allow_jdbc_theme_based_foi="true"
editable="true"/>
<!-- **** -->
But it does not work.
After use "sqlplus mvdemo/[email protected]:1522/pdborcl", it connected to the Oracle database 12c.
Does anyone know it?
Thanks,For 11.1.1.7.1 use the syntax for jdbc_sid, i.e.
//mypdb1.foo.com as described in the README,
- MapViewer native (non-container) data sources can now use database service name in place of SID. To supply a db service name, you will use the same jdbc_sid attribute, but specify the service name with double slashes in front, such as follows:
<map_data_source name="myds"
jdbc_host="foo.com"
jdbc_sid="//mypdb1.foo.com"
jdbc_port="1522"
/>
For 11.1.1.7.0 use a container_ds instead.
i.e. instead of using
<map_data_source name="my_12c_test"
jdbc_host="mydbinstance"
jdbc_sid="pdborcl12c"
jdbc_port="1522"
jdbc_user="mytestuser"
jdbc_password="m2E7T48U3LfRjKwR0YFETQcjNb4gCMLG8/X0KWjO00Q="
jdbc_mode="thin"
number_of_mappers="6"
allow_jdbc_theme_based_foi="false"
editable="false"
/>
use
<map_data_source name="my_12c_test"
container_ds="jdbc/db12c"
number_of_mappers="6"
allow_jdbc_theme_based_foi="false"
editable="false"
/>
In my case the Glassfish 3.1.2.2 JDBC connection pool definition was
Property
url jdbc:oracle:thin:@mydbinstance:1522/pdborcl12c.rest_of.service.name
Uncheck the Wrap JDBC Objects option in Advanced panel, i.e. the Edit JDBC Connection Pool Advanced properties page.
Add a JDBC resource for that newly created pool
Use that in mapviewerconfig.xml as above -
Forms clause query data source data block in oracle forms
Hello experts,
I am new in oracle forms.I am using oracle forms 11g with weblogic 10.3.5 at windows 7.Through googaling I know how to create a database block,forms clause data block and stored procedure based datablock in oracle forms.I want to know that as in case of Database based datablock, could we commit form either on editing records or on insertion or deletion in data block.
I tried this but got error frm 40501.If we can perform editing and creation in such type of datablock then please tell me how.
Thank You,
regards
aadityaWhen I base my datablock on a query using the "From Clause" property of the block query data source in the oracle Forms 6i,
I get the strange error
"ORA-00928: missing SELECT keyword"
The query I see in the Display Error in Help Menu is
SELECT DAY_NUMBER,CONSULTANT_ID,EVENT_ID,EVENT_NUMBER,SESSION_NUMBER,HOURS_UNPAID,HOURS_PAID,PAPERWORK FROM (EVENT_ASSIGNED_CONSULTANT) WHERE (CONSULTANT_ID=:1)
What should I do now?????? Please remove the brackets () from the table name.
Instead of (EVENT_ASSIGNED_CONSULTANT) use
EVENT_ASSIGNED_CONSULTANT -
When changing query data source property.....
hello folks,
I have this very weird behavior in oracle forms 10 g R2:
in my form I built a datablock " DB " based on a table " table1 ", in that datablock I added a push button that changed the query data source name of data block DB to " table2 " using the set_block_property() built-in, please note that table1 and table2 has the same structure.
When I query the table2, and if i try to update a record, the updates are not saved and I got the error ora - 0000 , It seems that after changing the query data source to table2, if i try to update a record, the locking is perform to table1 (the original query data source that the datablock is built in the first place) ....
Please can anyone help or explain me this behavior and what can i do to perform a workaround for it,,,,,
and than you in advance...dear Mark,
What indicates that the record is locked? More information please. well if query the v$lock view or from the EM I can see that the lock is performed on the first table -
Problem during the setting the query data source name in forms 6i
We are now doing assignments in forms 6i actually there is a problem during setting the query data source name in run time.
The problem is
declare
v_query varchar2(200),
begin
v_query :='(select empno,ename,deptno from emp where hiredate =' || control .value1 ||')';
go_block('emp');
set_block_property('emp',query_data_source_name,v_query);
end;
that bolded area is the problem that ia varchar value the single qoutes embedded with that value.how can i embedded single qoutes in that concatenation.
That is now query will run like select empno,ename,deptno from emp where hiredate =control.value
But we need like select empno,ename,deptno from emp where hiredate ='control.value'
Message was edited by:
PunithavelThanks for your response
We fixed the error
and the answer is
declare
v_query varchar2(200),
begin
v_query :='(select empno,ename,deptno from emp where hiredate = ' ' ' || control .value1 ||' ' ' ) ' ;
go_block('emp');
set_block_property('emp',query_data_source_name,v_query);
end; -
Trying to programmatically set the data-source for a Crystal reports report.
I've got the following existing procedure that I need to add to in order to programmatically set the data-source (server, database, username, and password) for a Crystal reports report.
I added the connectionInfo parts, but can’t figure out how to attach this to the existing
this._report object.
This is currently getting the connection data from the report file, but I now need to populate this connection data from a 'config.xml' text file.
Am I trying to do this all wrong?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CrystalDecisions.CrystalReports.Engine;
using WGS.Reports.Reports;
using CrystalDecisions.Shared;
using WGS.Reports.Forms;
namespace WGS.Reports
public class ReportService
ReportClass _report;
ParameterFields paramFields;
ConnectionInfo connectionInfo; // <- I added this
public ReportService()
public void DisplayReport(string reportName, int allocationNo)
if (reportName.ToLower() == "allocationexceptions")
this._report = new AllocationExceptions();
PrepareConnection(); // <- I added this
PrepareAllocationExceptionReport(allocationNo);
this.DisplayReport();
private void PrepareConnection() // <- I added this
//test - these will come from the config.xml file
this.connectionInfo = new ConnectionInfo();
this.connectionInfo.ServerName = "testserv\\test";
this.connectionInfo.DatabaseName = "testdb";
this.connectionInfo.UserID = "testuser";
this.connectionInfo.Password = "test";
this.connectionInfo.Type = ConnectionInfoType.SQL;
private void PrepareAllocationExceptionReport(int allocationNo)
this.paramFields = new ParameterFields();
this.paramFields.Clear();
ParameterField paramField = new ParameterField { ParameterFieldName = "@AllocationNo" };
ParameterDiscreteValue discreteVal = new ParameterDiscreteValue { Value = allocationNo };
paramField.CurrentValues.Add(discreteVal);
paramFields.Add(paramField);
private void DisplayReport()
frmReportViewer showReport = new frmReportViewer();
showReport.ReportViewer.ReportSource = this._report;
showReport.ReportViewer.ParameterFieldInfo = paramFields;
showReport.ShowDialog();
showReport.Dispose();
Any help would be much appreciated.Hi Garry,
Please post SAP Crystal Reports questions in their own forums here:
SAP Crystal Reports, version for Visual Studio
We don't provide support for this control now. Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
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! -
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
Maybe you are looking for
-
hi i made a vi,in which we used the exit vi and following option are selected from vi properties 1.do not allow the user to close, 2.dont show the abort button 3. run when oppend 4.password protected 5.and we switch it to run mod ..now our Q is when
-
Is there a way to get iPhoto to reconcile its library and search for photos that have been moved? I have reorganised a handful of photo folders and now iPhoto shows the thumbnail but no full size image. As I dont let iPhoto organise the photos for me
-
Migration Assistant (Tiger -- Leopard)
I just received my new MacBook yesterday...during installation, I was trying to use the Migration Assistant to take data from my older Mac (PowerBook G4 w/ Tiger) using the Firewire mode. After connecting the Macs using the Firewire cable, and then r
-
Crash on import / Why is my preview squashed?
This seems like a reoccurring question, sorry. I tried to search the internet for an answer and got some understanding but I didn't fully learn how to fix my project based on that information. So anyway, I have been recording off of my ps3 and editin
-
Regular Expressions (Perl style) problem...!!!
I need to find the all appearance of html tags in string.. string-->(fgsfdg<a href='dfhfdgdfg<b>dfghf<span>) Where a can find (download) this package.?