Passing date argument to to_date
[ http://www.toadworld.com/Default.aspx?tabid=67&EntryID=536]
I agree there is an implicit conversion of date->text->date, even though this should not happen ?
still don't understand how trunc(sysdate) is greter than same date without timestamp i.e. 12:00:00 ?
THnaks ,
hesh.
Edited by: Hesh on May 10, 2010 10:37 PM
in the code you have posted the dates are not correctly taken.
the date that is used for comparision is
to_char(TO_DATE (global_end_date)---->*11/MAY/0010* which is wrong...
why do you want to use to_date when the variable is already date?
format the dates before you assign to a date variable
DECLARE
global_end_date DATE := to_date('11-May-2010','DD-MON-YYYY');
global_beg_date DATE := to_date('01-May-2010','DD-MON-YYYY');
BEGIN
DBMS_OUTPUT.put_line('trunc(sysdate)--->'||to_char(TRUNC (SYSDATE),'DD/MON/YYYY HH:MI:SS'));
DBMS_OUTPUT.put_line('to_date(global_end_date)---->'||TO_DATE (global_end_date, 'DD-MON-YYYY'));
DBMS_OUTPUT.put_line('to_char(TO_DATE (global_end_date)---->'||to_char(global_end_date, 'DD-MON-YYYY'));
IF TRUNC (SYSDATE) > global_end_date
THEN
DBMS_OUTPUT.put_line (TRUNC (SYSDATE));
DBMS_OUTPUT.put_line (TO_DATE (global_end_date, 'DD-MON-YYYY'));
DBMS_OUTPUT.put_line ('> global_end_date');
ELSIF TRUNC (SYSDATE) < global_beg_date
THEN
DBMS_OUTPUT.put_line ('sysdate < beg_date');
ELSE
DBMS_OUTPUT.put_line ('Neither');
END IF;
END;
trunc(sysdate)--->11/MAY/2010 12:00:00
to_date(global_end_date)---->11/MAY/10
to_char(TO_DATE (global_end_date)---->11-MAY-2010
NeitherEdited by: [email protected] on May 11, 2010 12:30 AM
Similar Messages
-
Error while passing date parameters in procedure and commit issue
Hi
1) I am doing a archiveing records and pls find my code below and i have couple of issue,pls find my code and want to ensure the commit is happening every 100000 rows inserted but i am archeiving a huge table but when i checks the table frequently it shows 0 records and after it shows count the actual rows around 20 million records.How can i ensure it commiting on every 100000 records. pls find my code my db version is 10g on windows
CREATE OR REPLACE PROCEDURE doins as
cnt number:=0;
FOR x IN (select * from Call_log
where trunc(c_date) = to_date('11-Aug-2008','DD-MON-YYYY'))
LOOP
INSERT INTO call_arch
select * from Call_log
where trunc(c_date) = to_date('11-Aug-2008','DD-MON-YYYY');
cnt := cnt + 1;
IF( cnt = 10000 )
THEN
cnt := 0;
commit;
END IF;
commit;
END LOOP;
2) Error while passing date as parameter i am getting following errors while passing date parameter pls find my code and errors
CREATE OR REPLACE PROCEDURE doins(p_date date) as
cnt number:=0;
begin
FOR x IN (select * from Call_log
where trunc(c_date) = to_char(p_date,'DD-MON-YYYY'))
LOOP
INSERT INTO call_arch
select * from Call_log
where trunc(c_date) = to_char(p_date,'DD-MON-YYYY');
cnt := cnt + 1;
IF( cnt = 10000 )
THEN
cnt := 0;
commit;
END IF;
commit;
END LOOP;
end;
exec doins(11-Aug-2008) then gives
SQL> exec doins(11-Aug-2008);
BEGIN doins(11-Aug-2008); END;
ERROR at line 1:
ORA-06550: line 1, column 16:
PLS-00201: identifier 'AUG' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
if i gave exec doins(11-08-2008) it gaves
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'DOINS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
rgds
roshCREATE OR REPLACE PROCEDURE doins(p_date varchar2) as
cnt number:=0;
begin
FOR x IN (select A.rowid,A.* from Call_log A
where trunc(c_date) = to_date(p_date,'DD-MON-YYYY'))
--hope that's c_date columne is DATE datatype
LOOP
INSERT INTO call_arch
select * from Call_log
where rowid=x.rowid;
cnt := cnt + 1;
IF( cnt = 10000 )
THEN
cnt := 0;
commit;
END IF;
commit;
END LOOP;
end;
thats your correct procedure - but NOT CORRECT ISSUE.
You should use bulk collect with limit clause and forall clause to do it faster!!! Or Merge clause. -
Problem with passing date parameters in cursor
Is there any problem in passing date parameters and like clause as below
CURSOR eftcursor(start_date DATE, end_date DATE, where_clause varchar2) IS
select * from r_records
where created_date between start_date and end_date and description like where_clause;
and in the open statement
select to_date('01/06/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into startDate from dual;
select to_date('01/07/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into endDate from dual;
str := '%something%aaaaa%';
open eftcursor(startDate ,endDate , str);
Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.Almora wrote:
Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.No, your code looks correct -- ou're passing a date to the cursor.
You might consider whether you really need an explicit cursor though. An implicit cursor is easier to code and performs better. -
Passing data b/w applet and apache server
Hi all,
I have an application that runs in the JApplet.I have to pass data b/w server and applet.The
datas are brought from the server using php to the browser and passed to applet using param
tags.
1.Is it possible to set value for the param tag from applet?
2.How to retrieve data from the param tag to the applet in the form of an array.
In the getParameter it is required to specify the param name.
Is it possible to retrieve data from param tag similar to that of getting data from command
line arguments array.Hi all,
I have an application that runs in the JApplet.I have
to pass data b/w server and applet.The
datas are brought from the server using php to the
browser and passed to applet using param
tags.
1.Is it possible to set value for the param tag from
applet?Why do you ever want to do it? It sounds like setting arguments passed to a program's main method from command line after the main method has been invoked. It is possible though to dynamically set any values for any applet params using php before the applet gets loaded to the browser window as you generate an html file on the server side.
2.How to retrieve data from the param tag to the
applet in the form of an array.
In the getParameter it is required to specify the
param name.
Is it possible to retrieve data from param tag similar
to that of getting data from command
line arguments array.You can use some naming/numbering convention for your params. For example settings1, settings2 ... Then you can loop in your code retrieving the values like getParameter("settings" + i) checking to see that it is not null or empty.
However, if you don't want to reload the applet (together with the page) just to get some new data from the server, you can establish a tcp/ip connection as elchaschab recommended.
Cheers! -
Passing an argument in the SQL Query of a View Object
Hi,
It is possible that this question has been asked before, however I have searched for a half an hour in the forums and couldn't find a solution.
I am also new to using JDeveloper and ADF. Here's the situation:
I am developing an application that doesn't have to do anything else then displaying data from a database. Pretty straightforward actually.
Now I have made a vew pages with several collapsible panels (af:showDetailHeader) and have setup the datasources (or so I thought).
All that remains is:
- drag & drop a view object, from the application module that I created, onto the collabsible panels, so a child element gets created which displays data from the database.
- hack the layout so it looks like I want it to.
The problem that I have is the following:
I am using a 'User'-class that contains values I need when quering the database.
That User-object is part of a user-session.
What I want, for example, is to use the 'getPersonId()' function of that User-object and pass the argument to a SQL-query of a certain view-object.
The query would become something like:
'SELECT * FROM people WHERE people.personId = :someNumber'.
Now I've read some stuff about variable binding, which is complemented by something like (backing bean code):
getDBTransaction().getRootApplicationModule().getACertainViewObject().setWhereClauseParameter(1, user.getPersonId());
The examples I have found that might match my wishes are not using business components, but EJB's. I am having difficulty with understanding the 'how'-part of variable binding.
Also, I do not know enough of ADF to be able to create a situation like:
'User loads page, collapsible panel 1 is fully shown, the others are undisclosed.'
(meaning, that for panel1 a query has been executed.)
'User clicks on collapsible panel 2 which triggers a backingbean that somehow retrieves data from a view object'.
I would appreciate any help that somebody can give.
If it is not too much of a problem, please provide code snippets in case you have a solution. I am new to ADF :(.
-edit
I am using JDeveloper 10.1.3.3.0 in case that is of any importance.
Message was edited by:
Hugo BoogHello Stijn,
I didn't think about a referenced bean rule in the faces-config.
I added it right away and I am now able to set parameters of a View-object, not using a page button and before the page loads. You made my day!
In case anyone ever reads this post again, the summary of how to generate a table based on a View-object using dynamic parameters.:
1a: Go to faces-config.xml -> Overview tab'
1b: Go to the menuitem "Referenced Beans"
1c: Click on 'new' and select the existing bean you want to access data from and input a name. In this example I use name="user"
2: Create a View-object using the wizard.
2a: Specify the query you want in the menuitem 'SQL Statement'.
Add the 'parameters' you want to. You will have something like:
"SELECT * FROM someTable WHERE table.columnname LIKE :someArgument".
- hint: if you want the result to become something like:
"SELECT * FROM someTable WHERE table.columnname LIKE '%someArgument%'" then you have to add the '%'-characters in your code itself (read: someClass.setParameter("%" + someArgument);).
2b: In the menuitem 'Bind Variables' you have to add the variables you are referring to in the query. If you look at the query in 2a, then you have to add a variable with name "someArgument".
2c: Add the View-object to a Application Module (create one if nessecairy).
3a: Open a .jsp(x) file. Drag the View-object created in step 2 from the 'Data Controls'-pane to the page.
3b: Click on the '+' of the View-object in the 'Data Controls'-pane and open 'Operations' and drag 'ExecuteWithParams' to your page as a button.
3c: We do not want to use a button, the action has to be executed immediatly. So In the page source remove the lines that were created after dropping 'ExecuteWithParams'.
3d: Right-click on the page and select "Go to Page Definition".
3e: Go to the action id that is called 'ExecuteWithParams#', where # is a number.
Change the id to something useful.
3f: Change the NDValue so it corresponds with the value you want.
Example:
<action id="getAddressData" IterBinding="AddressesView1Iterator"
InstanceName="MyHRServiceModuleDataControl.AddressView1"
DataControl="MyHRServiceModuleDataControl" RequiresUpdateModel="true" Action="95">
<NamedData NDName="someArgument" NDType="java.lang.String"
NDValue="#{user.personId}"/>
</action>
Note: It is possible to use the value of a Backing Bean in NDValue.
Note 2: user is the bean I referred to in the faces-config.xml!
3g: Under the executables item, add an 'invokeAction' to pass the parameter to the View-object before your JSP-file loads:
<executables>
<invokeAction Binds="getAddressData"
id="loadAddressDataOfPersonIdInSession"
Refresh="prepareModel"/>
Thank Stijn Haus for this :) -
How to auto login and pass data (parameter) to ApEx at the same time
Does anybody know how to automatically login to apex (e.g. from JSP page) and pass a parameter value at the same time? I can use wwv_flow_custom_auth_std to login, I can even choose a page but I cannot pass any data (at least I do not know how). If I use f?p URL syntax I can pass data but there is no way to pass login/password information.
Any idea? Thanks JarosJaros -
You could copy your login page and make the new page "public". On the new page, add a process before the login process that sets the value of application item FSP_AFTER_LOGIN_URL to the report page URL (with the arguments), e.g., :FSP_AFTER_LOGIN_URL := 'f?p=&APP_ID.:100:&SESSION.::NO::P100_X,P100_Y:&RPT_VALUE1.,&RPT_VALUE2.';Create application-level items RPT_VALUE1 and RPT_VALUE2 in the application.
From your external page, POST to this new "login" page, passing values for the username, password, rpt_value1, and rpt_value2 items.
Let us know if it works.
Scott -
Passing date format in sys.dbms_xmlgen
hello all,
i am using following query to generate insert SQL statements
SELECT
'insert into ' || table_name || ' (' || (select rtrim(extract(xmlagg(xmlelement(e, t.column_value.getrootelement() || ',')),'//text()'),',') from table(xmlsequence(t.column_value.extract('ROW/*'))) t) || ') values (' ||
(select dbms_xmlgen.convert(rtrim(extract(xmlagg(xmlelement(e, '''' || t.column_value.extract('//text()') || ''',')),'//text()'),','),1) from table(xmlsequence(t.column_value.extract('ROW/*')))t) || ');' ins_stmt
from user_tables,
table(xmlsequence(dbms_xmlgen.getxmltype('select * from ' || a_TblName ||' WHERE MODIFIEDON >'||a_date).extract('ROWSET/ROW'))) t
where table_name in (select table_name from user_tables where table_name =a_TblName);but when i execute the procedure as
sql> exec Gen_Insert_Statement('11-jun-2009');
ORA-19202: Error occurred in XML processing
ORA-00904: "JUN": invalid identifier
ORA-06512: at "SYS.DBMS_XMLGEN", line 288
ORA-06512: at line 1
ORA-06512: at "MRILDATA17TEST.GEN_INSERT_STATEMENT", line 22
ORA-06512: at line 2 and if i do this
SQL> exec Gen_Insert_Statement('11-06-2009');
begin Gen_Insert_Statement('11-06-2009'); end;
ORA-01843: not a valid month
ORA-06512: at line 2is there any format to pass date while using XML packages??? i am also not getting in which this issue is occuring??
any suggestion will be appreciable
thanks and regards
VD
Edited by: dixit on Aug 13, 2009 6:15 AM
Edited by: dixit on Aug 13, 2009 6:21 AMThe date issue is coming from
dbms_xmlgen.getxmltype('select * from ' || a_TblName ||' WHERE MODIFIEDON >'||a_date)It is due to the implicit conversion from the internal Date object type to a String type for display. The format is based off the NLS_DATE_FORMAT so varies from system to system. When dealing with dates, it is always best to use either to_char or to_date to ensure there are no errors in converting from one format to the other. That would include adding to_date with a format mask making it part of your Select SQL statement around a_date, such as to_date(a_date, 'DD-MON-YYYY')
Also, if you have any dates in the tables that are being queried, you will run into a similar implicit conversion issue. Oracle does not format dates in the proper XML format of YYYY-MM-DD when building XML in this manner as it uses the NLS_DATE_FORMAT. So you cannot guarantee the INSERT statement will work on another DB with a different NLS_DATE_FORMAT.
As others have asked, why you are trying to build insert statements this way as there is a lot to take into consideration regarding data formats. It seems this has been discussed on the {forum:id=75} forum but that has been some time ago. -
Passing data from Oracle stored procedures to Java
We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
We're considering one of the 2 following scenarios:
passing objects and lists of objects (DB object types defined on the schema level)
passing a sys_refcursor
We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
I'd appreciate any hints.user1754151 wrote:
We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
We're considering one of the 2 following scenarios:
passing objects and lists of objects (DB object types defined on the schema level)
passing a sys_refcursor
We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
I'd appreciate any hints.If logic is already written in DB, and the only concern is of passing the result to java service side, and also from point of maintenance problem and flexibility i would suggest to use the sys_refcursor.
The reason if Down the line any thing changes then you only need to change the arguments of sys_refcursor in DB and as well as java side, and it is much easier and less efforts compare to using and changes required for Types and Objects on DB and java side.
The design and best practise keeps changing based on our requirement and exisiting design. But by looking at your current senario and design, i personally suggest to go with sys_refcursor. -
Help understanding how to pass dates to procedures in a package?
When I run the following script in SQL*Plus, I get no obvious errors, but the truncate does not happen and all the other processing doesn't happen. I ran a similar version in another tool and it worked. Much of the code is deleted here but I believe I don't fully understand passing dates in the procedure. I figure if one of the dates ends up null or something invalid, the procedure will run and give no results. If someone could correct me on how to pass variables, it would help greatly. As you can see, I am passing 2 dates in from an ACCEPT statement, passing them to 1 shell type procedure which runs other procedures and passes the dates to the procedures below it. This procedures calls the 3rd procedure and passes the same dates to it:
ACCEPT CUR_PERIOD PROMPT 'Current Period (MM/DD/YYYY): ';
ACCEPT PRIOR_PERIOD PROMPT 'Prior Period (MM/DD/YYYY): ';
EXEC RCO.MONTH_END_PACK_1.MONTHENDPHASE1PROC('&CUR_PERIOD','&PRIOR_PERIOD');
The spec looks like this:
CREATE OR REPLACE PACKAGE MONTH_END_PACK_1 AS
PROCEDURE MonthEndPhase1PROC(get_cur_period IN DATE, get_prior_period IN DATE);
PROCEDURE W_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE);
PROCEDURE WO_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE);
END MONTH_END_PACK_1;
The body looks like this:CREATE OR REPLACE PACKAGE BODY MONTH_END_PACK_1 AS
PROCEDURE MonthEndPhase1PROC(get_cur_period IN DATE, get_prior_period IN DATE) IS
BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE RPT_DS1_CNT';
EXECUTE IMMEDIATE 'TRUNCATE TABLE RPT_DS1_CNT_CAT';
W_CAT_INFO_RPT_PROC(GET_CUR_PERIOD, GET_PRIOR_PERIOD);
END;
PROCEDURE W_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE) IS
CUR_PERIOD DATE;
PRIOR_PERIOD DATE;
BEGIN
-- Assign the dates to this procedure that were passed in above.
CUR_PERIOD := GET_CUR_PERIOD; --07/27/2007
PRIOR_PERIOD := GET_PRIOR_PERIOD; --06/27/2007
-- Execute stored procedure, passing in dates.
WO_CAT_INFO_RPT_PROC(CUR_PERIOD, PRIOR_PERIOD);
-- Other code goes here
END; -- W_CAT_INFO_RPT_PROC
PROCEDURE WO_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE) IS
CUR_PERIOD DATE;
PRIOR_PERIOD DATE;
BEGIN
CUR_PERIOD := GET_CUR_PERIOD;
PRIOR_PERIOD := GET_PRIOR_PERIOD;
INSERT INTO RPT_DS1_CNT
(select distinct trim(CVBI_KEY) as CVBI_KEY, vendor_id
from
(select m.cvbi_key, v.vendor_name
from rco.cogs_resource m,RCO.COGS_SRVCTYP st,rco.cogs_mkt ms,RCO.COGS_VENDOR v,
(select distinct cvbi_key, vendor_id
from RCO.COGS_resource
where period = CUR_PERIOD)ak
where ak.cvbi_key = m.cvbi_key
and trim(m.cvbi_key) = trim(st.cvbi_key(+))
and period = CUR_PERIOD));
END;
END;
/EXEC RCO.MONTH_END_PACK_1.MONTHENDPHASE1PROC(to_date('&CUR_PERIOD','MM/DD/YYYY'),to_date('&PRIOR_PERIOD','MM/DD/YYYY'));
As you can see, I am passing 2 dates in from an ACCEPT statementUntil you convert them using TO_DATE they are just strings
Message was edited by:
3360
Fixed date formats -
Is it possible to pass an argument to the function triggered by an event handler?
Hello All,
Trying to migrate my way of thinking from AS2 to CS4/AS3.
Ok, I have 2 buttons on the stage. Each button does almost
the same thing, so I want to create a single function, and each
button calls that same function (we'll name that function
"Navigate")... however, the function will need to end up doing
something different dependant on which button was clicked.
So, previously, in AS2, I would've added some code onto the
buttons themselves with on(release) methods (see CODE EXAMPLE 1)
So, each button effectively calls the Navigate function, and
passes a different frame label to the function.
Now, I'm trying to recreate this functionality in AS3. As you
all know, on(release) has been done away with (still don't know
why), but we now have to use event handlers, so I'm trying to
figure out a way to pass a different frame label argument to the
Navigate function. Currently I can achieve that by using a switch
statement to test which button was clicked, and act accordingly
(see CODE EXAMPLE 2).
In this over-simplified example, this works fine, but in the
real world I'm going to have more than 2 buttons, and the Navigate
function would probably be much more complicated...
So, I would like to be able to pass an argument(s) (like in
the AS2 example) to the Navigate function... perhaps in the
addEventListener() method? I tried this, but got compiler errors
(see CODE EXAMPLE 3):
The Million Dollar Question:
Is it possible to dynamically pass/change an argument(s) to a
function which is triggered by an event listener? (Or is the event
that triggered the function the only argument you can have?)
If this isn't possible, I'd greatly like to hear how you
folks would handle this (other than having a switch statement with
12 cases in it)???I've found a couple solutions that I'll post below for
prosperity...
You could create a Dictionary keyed by the prospective event
targets and store any information in there you want associated with
them. Then the navigate function can check that dictionary to get
it's parameters:
// Code //
Button1.addEventListener(MouseEvent.CLICK, Navigate, false,
0, true);
Button2.addEventListener(MouseEvent.CLICK, Navigate, false,
0, true);
var buttonArgs:Dictionary = new Dictionary();
buttonArgs[Button1] = "FrameLabel1";
buttonArgs[Button2] = "FrameLabel2";
function Navigate(e:MouseEvent):void{
gotoAndStop(buttonArgs[e.target]);
This in my eyes, is about the same amount of work as writing
a long switch statement, but a little more elegant I suppose.
I had a little trouble understanding the next solution,
because I didn't quite understand an important piece of information
about event listeners. The addEventListener () requires a Function
as the 2nd argument passed to it.
It didn't quite click until someone pointed it out to me:
Navigate is a Function...
Navigate("FrameLabel1") is a Function
call...
So by writing just
Navigate, I'm not actually calling the function at the time
of the addEventListener call, I'm just supplying the event listener
with a reference to the name of the function. Then, when the
listener is triggered, the listener will call (and pass a
MouseEvent argument to) the Navigate function.
Conversely, by writing
Navigate("FrameLabel1") as the 2nd argument, the event
listener trys to execute the Navigate function at the time the
addEventListener is instantiated. And, since, in this example, the
Navigate function returned as ":void" a compile error would occur
because as I stated, an event listener requires a Function data
type as the 2nd argument. This would basically be like writing
addEventListener(MouseEvent.Click,
void, false, 0, true)
However, there is a way around this... basically, instead of
defining the Navigate function as returning a void data type, you
define it as returning a Function data type, and then nest another
function (which actually contains the actions you want to perform)
inside of it.
Button1.addEventListener(MouseEvent.CLICK,
Navigate("FrameLabel1"), false, 0, true);
Button2.addEventListener(MouseEvent.CLICK,
Navigate("FrameLabel2"), false, 0, true);
function Navigate(myLabel:String):Function{
return function(evt:MouseEvent):void{
gotoAndStop(myLabel); -
Passing dynamic argument in Named Query
I created a class Zoneclass.java in which i defined the toplink mappings of attributes for a table viz. zone.
Now i created a named query as q1 which require a runtime argument arg1.
Basically the query wants to say "select * from Zone(or zoneclass) where zonename='arg1' ." this arg1 should be taken from a textfield for search criteria.
Now when i created the Data Control Pallete of this class and q1(String) is generated in Data Control Pallete.
Now finally i want to use this q1(String) from Data control Pallete on a UIX page .
I will drag it as read only table in a UIX page but it dosen't works bcoz the parameter is not passed so how and where i can pass that argument so that before coming to the tabledata, this query will fire with this argument.
Regards
SomvirI created a class Zoneclass.java in which i defined the toplink mappings of attributes for a table viz. zone.
Now i created a named query as q1 which require a runtime argument arg1.
Basically the query wants to say "select * from Zone(or zoneclass) where zonename='arg1' ." this arg1 should be taken from a textfield for search criteria.
Now when i created the Data Control Pallete of this class and q1(String) is generated in Data Control Pallete.
Now finally i want to use this q1(String) from Data control Pallete on a UIX page .
I will drag it as read only table in a UIX page but it dosen't works bcoz the parameter is not passed so how and where i can pass that argument so that before coming to the tabledata, this query will fire with this argument.
Regards
Somvir -
ICWC: Passing data b/w views without using CuCo!.
Hi All,
I am using CRM 4.0, for my custom development i got many custom views, i have a requirement to pass a value from one custom view to another!.
All my custom views i developed in a custom application, also the workbench is not allowing me to create a new custom controller of my own, in this context is there any alternative for passing data b/w view without using a Custom Controller?.
or else anyway to create a new CuCo in my custom application!..
Thanks in Advance,
sudeep v d..Hi all,
I have an application that runs in the JApplet.I have
to pass data b/w server and applet.The
datas are brought from the server using php to the
browser and passed to applet using param
tags.
1.Is it possible to set value for the param tag from
applet?Why do you ever want to do it? It sounds like setting arguments passed to a program's main method from command line after the main method has been invoked. It is possible though to dynamically set any values for any applet params using php before the applet gets loaded to the browser window as you generate an html file on the server side.
2.How to retrieve data from the param tag to the
applet in the form of an array.
In the getParameter it is required to specify the
param name.
Is it possible to retrieve data from param tag similar
to that of getting data from command
line arguments array.You can use some naming/numbering convention for your params. For example settings1, settings2 ... Then you can loop in your code retrieving the values like getParameter("settings" + i) checking to see that it is not null or empty.
However, if you don't want to reload the applet (together with the page) just to get some new data from the server, you can establish a tcp/ip connection as elchaschab recommended.
Cheers! -
Can not pass data after while loop
Hello.
I have created a VI for my experiment and am having problem passing data outside a while loop to save on an excel file. The VI needs to first move a probe radially, take data at 1mm increment, then move axially, take data radially at 1mm increment, then move to the next axial position and repeat. It would then export these data to an excel file. The VI is a little complicated but it's the only way I know how to make it for our experiment. I have tested it and all the motion works correctly, however I can not get it to pass the data after the last while loop on the far right of the VI where I have put the arrows (Please see the attached VI ). Is it because I'm using too many sequence, case, and while loops? If so, what other ways can I use to make it export data to the excel file?
Any help would be appreciated.
Thank you,
Max
Attachments:
B.Dot.Probe.Exp.vi 66 KBUmmmm .... gee, I'm not even sure where to begin with this one. Your VI is well .... ummmm... You have straight wires! That's always nice to see. As for everything else. Well... Your fundamental problem is lack of understanding of dataflow programming. What you've created is a text program. It would look fantastic in C. In LabVIEW it makes my heart break. For a direct answer to your question: Data will not show up outside a while loop until the while loop has completed. This means your most likely problem is that the conditions to stop that specific loop are not being met. As for what the problem is, I don't even want to start debugging this code. Of course, one way to pass data outside of loops is with local variables, and hey, you seem to be having so much fun with those, what's one more?
This may sound harsh, and perhaps be somewhat insulting, but the brutal truth is that what I would personally do is to throw it out and to start using a good architecture like a state machine. This kind of framework is easy to code, easy to modify, and easy to debug. All qualities that your code seems to lack.
Message Edited by smercurio_fc on 08-17-2009 10:00 PM -
How to pass date parameter from one page to other in BSP application
Hello gurus,
In my BSP application i have taken an input field and made its type "date" and its value also of type date and have set showhelp .
Now once a particular date is given as an input i want to pass its value to next page. And in next page i have to fire a query based on the date entered in previous page...
Now my prb is that my date value is not getting passed to the next page.
I have used
navigation->set_parameter( name = 'BEGDA' value = BEGDA ).
to pass date parameter.....still parameter is not getting passed.
plz help me with this.....
thankx.....Hi Eddy,
By truncation i mean the entire date becomes 10 char including the ' . ' eg(06.12.2006).
so with begda being 8chars it takes my date as 06.12.200
as a result my query is not getting executed.
now i have tried to use a FM 'CONVERT_DATE_TO_INTERN_FORMAT'.
in my 1st page but still in 2nd page its giving me following error.
<b>The data that was read could not be written to the specified target field during a SELECT access. Either the conversion is not supported for the type of the target field, or the target field is too short to accept the value, or the data is not in the appropriateformat for the target field.
</b>
Regards
Swati -
Passing date parameter from prompt
Hi experts
I am getting some problem while passing date from a dashboard prompt.
In RPD i have changed the date column properties as DATE only so that i will get the DATE part of the data not the time stamp.
Now in the dashboard prompt i added a prompt for the date column.
I initialized the date prompt with a server variable of sysdate
when i am running the dashboard i am getting default value in the prompt(04/15/2011)
when i am changing the date it is selected as(04/15/2011)
but when i am clicking the 'Go' button the date is converting to 2011-04-15 00:00:00 due to which my report is not running and i am getting error as
View Display Error
A date value was expected (received "2011-04-15 00:00:00").
Error Details
Error Codes: QABPH2PO
can anyone help me to pass only date part
thanks in advance
regards
GourisankarHi J / Srikanth
Sorry to restart the thread again.
As we discussed i have downloaded the patch and applied to my windows 32 bit machine.
But now when i run the report the report is running only for the default value(Server Variable) which is specified to the prompt. when i change the date there is no effect to the report.
When i drill down to the report i found that the date column(is prompted) is changed to teh server variable name which is might be the cause.
any input on this???
regards
Gourisankar
Maybe you are looking for
-
In excise invoice the transaction calls a standard program J_1I_EXCP which is not firing the standard layout J_1I_EXC_INVOICE
-
How to place a binary zip files using sftp receiver adapter
Hi experts, we got one scenario , where we need to pick the file (.zip) from local source path and place it in SFTP server path. we have done all configuration setting and processed a zip to SFTP server. but the client are saying the .zip file is not
-
hi gurus, This ramesh. Please telme anybody HOW DO WE GET ALPHA NON CONFORMING VALUE (ERROR)? WHAT IT MEANS?
-
Problem connect to oracle using ORACE
Hi, Has anybody been able to connect to Oracle 10g using the latest ORACE(Free PL/SQL code editor)? The application hangs when I click on connect. Do I have to install the Oracle Instant Client if I have Oracle 10g Enterprise Edition installed? Any s
-
Hello, I'm facing a problem in PR05 about the barcode, because when i run this transaction to make a travel expense, i dont see the barcode in the spool of the simulation mode neither in the accounting document (transaction PRRW), i should say that i