Passing Date as IN parameter
Hi Gurus,
I have already searched teh discussion forums but couldn't find any solution.
I have a SP in which I want to pass an IN parameter as Date datatype.
While running the SP how to pas Date value as IN param?
For eg If I need to pass 05-09-2007
Thanks
SQL> create or replace function f1(p1 date)
2 return varchar2 is
3 begin
4 return p1||' is '||to_char(p1,'Day');
5 end;
6 /
Function created.
SQL> exec dbms_output.put_line(f1(sysdate));
16-OCT-07 is Tuesday
PL/SQL procedure successfully completed.
SQL> exec dbms_output.put_line(f1(to_date('05-09-2007','dd-mm-yyyy')));
05-SEP-07 is Wednesday
PL/SQL procedure successfully completed.
Similar Messages
-
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 data parameter between SWF files
Hello Xcelsius Gurus,
Is it possible to pass data parameter between SWF files?
If possible, how to achieve it?
Thank you.
JustineHi,
Thank you for the reference. Little bit confused, please let me clarify.
I do not understand how the receiver SWF receieved the data parameter and process.
For example, I have a parent dashboard and a child dashboard. In the parent dashboard, I have set up combo box to filter the data. And I want the data that I have selected in combo box to the child dashboard.
To do this, first I need to setup the flash variable at the parent dashboard to fetch the data I selected.
After this, how to link this data to the child dashboard?
Furthermore, after the child dashboard received the data parameter, I need this data to insert into the spreadsheet so I can filter the data. Is this possible?
Thanks.
Edited by: Justine Liu on Jan 19, 2010 3:11 PM -
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 -
Parameter Form to Pass Dates to Report
Hi,If anyone have a sample Form that passing
date parameters to a report so that a report can select only the Date ranges passed from the Parameter Form. I need to set up a trigger at the Form Control block. Thanks.For your 1st problem it seems to be a bug in Forms 6i - you can visit this site:
http://pipetalk.revealnet.com/~plsql/
and find there 41211.
Helena -
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 -
How to pass a date as a parameter?
So what i'm trying to do is call a proc. by passing a paramter that takes the date.
The table used in the cursor outputs date like so: "4/14/2009 7:00:00 PM"
So the query looks something like this...
select game_id
from cs.years
where trunc(game_date) in pGameDatepGameDate is defined as: date default sysdate - 15
So the call of the proc looks like this... call xt.GameIDs (pGameDate)
My question is how would I pass that date in the call?
I've tried the following call xt.GameIDs ('25-April-2009') but that didn't seem to work...am I writing out the date incorrectly in the call?user652714 wrote:
I've tried the following call xt.GameIDs ('25-April-2009') but that didn't seem to work...am I writing out the date incorrectly in the call?
you are not passing date here its a string you need to convert it into date use to_date('25-april-2009','DD-MONTH-RRRR') -
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. -
In Drill through report pass hyperlink value as parameter to another report using ssrs 2008 R2
Hi All,
I have one drill through SSRS report in which if I click one hyperlink in the summmary report it should be passed as parameter for detail report, like this....
Summary:
AccountType
A1
A2
If I click A1 then that should be passed as parameter to detail report and display A1 data in detail report
If I click A2 then that should be passed as parameter to detail report and display A2 data in detail report.
Please give me some ideas or expression code to achieve this in using SSRS 2008R2. Its very urgent.
Thanks,
RH
sqlThanks the folowing is my source data for the parameter I am including to the drill through
SELECT DISTINCT
case
when EA_STATUS in ('E4', 'U4', 'P5', '02', '03', '04','B2','B3','B4','12')
then CAST('Project' AS VARCHAR(15))
else CAST('Non-Project' AS VARCHAR(15))
end as EA_PROJECT_GROUP_DESC
FROM TEAMS.FMPROD_V_EA
As you can see it has only 2 values.So how do you suggest I wirte the expression to include in the report.
The name of the parameter I will be using is EAProjectGroup.but below is the error I am getting trying to run the report
rsMissingFieldInDataSet] The dataset Trends contains a definition for the Field EA_PROJECT_GROUP_DESC. This field is missing from the returned result set from the data source.
[rsErrorReadingDataSetField] The dataset Trends contains a definition for the Field EA_PROJECT_GROUP_DESC. The data extension returned an error during reading the field. There is no data for the field at position 45.
Preview complete -- 0 errors, 72 warnings
what does the position 45 mean? -
Pass table name as parameter in prepared Statement
Can I pass table name as parameter in prepared Statement
for example
select * from ? where name =?
when i use setString method for passing parameters this method append single colon before and after of this parameter but table name should be send with out colon as SQL Spec.
I have another way to make sql query in programing but i have a case where i have limitation of that thing so please tell me is it possible with prepared Statment SetXXx methods or not ?
Thanks
Haroon Idrees.haroonob wrote:
I know ? is use for data only my question is this way to pass table name as parameterI assume you mean "how can I do it?" As I have already answered "is this the way?" with no.
Well, I would say (ugly as it is) String concatenation, or stored procedures. -
How to Pass a multi-select parameter in BI to a PL/SQL Program
I am trying to pass a BI report parameter which is multi-select enabled in BI Enterprise Stand-Alone reporting tool. eg. it comes out in the data model like this: <P_CLASS_CODE>[DISABLED_VETERAN_OWNED, HUB_ZONE, LARGE_BUSINESS]</P_CLASS_CODE>
to a pl/sql stored procedure. (this is some kind of record set)
This works when passing the parameter as bind variable being passed to and IN CLAUSE. However, In my case I need a little bit more flexibilty with the programming so I need to get the value into PL/SQL so I can work with the individual values in the record set.
I am trying to figure out which collection type or record type I can use in pl/sql to be able to parse out the elements in the collection from within a stored procedure so I can loop through the elements.
I am trying to call the BI before report trigger in the data template like this:
<dataTrigger name="beforeReportTrigger" source="XXAPRPT03_SUPPLIER_DIVERSITY.before_report_trigger(:p_class_code)"/>
this call refers to the default package
I get this error: 'Invalid column type'
what type should I be using in my procedure definition to support the multi-selection record set which my parameter is passing from BI.Hi,
Okie :) please feel free to post any problem :)
Please apply the patch that has the fix for this issue:
[Patch 9791839|https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=9791839]
The above link worked fine for me .
Ideally, you should pick up the latest patch, which is [ Patch 11846804|https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=11846804]
Click on View Read me for install instructions. Let me know if you find any problem with patch install.
Regards,
Ajay Kumar -
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. -
Hi Experts,
i am new to the SRM, i am facing problem in passing data from one screen to another.
my requirement is that when we select one shopping cart and press the PROPOSE SOURCES OF SUPPLY button, we will fetch all the contracts that are attached to the shopping cart.
we have implemented a BADI implementation of BBP_SOS_BADI (method BBP_SOS_CHECK) for passing some changed values to the contracts of the shopping cart into the popup screen that is displayed when we press PROPOSE SOURCES OF SUPPLY button and when we select any contract and press ASSIGN ONLY button in the popup screen the badi BBP_DOC_CHANGE_BADI is triggered.
i have implemented another BADI implementation of BBP_DOC_CHANGE_BADI for fetching the selected contract and pass the values to another screen, but the problem is that when we select one contract and press the assign only button we are fetching the wrong contract number ( that is in the BADI method BB_SC_CHANGE parameter IT_ITEM we are fetching the wrong contract), if we again do the same procedure for the second time we are getting the correct contract.
i am unable to understand why we are getting the wrong contract in the first time( that is we are getting contract other than the selected one).
as per my understanding i think when we are passing data to the popup screen using BBP_DOC_CHANGE_BADI we are not updating the shopping cart with the changed data.
can anyone tell me how we can update the SHOPPING CART with the changed contracts data, i have used BBP_PD_SC_UPDATE, BBP_PD_SC_SAVE and other shopping cart FM but nothing is happening.
Thanks
TanveerHello,
What version of SRM are you on? Have you check for OSS Notes? I have had trouble with BBP_DOC_CHANGE_BADI but it was because of other issues. The BADI works pretty well and it is called almost every time something happens to the shopping cart.
I have noticed that sometimes that values are not changed til the second calling of the BADI. I have yet understand why but I think it has to do with prompt processing. Usually, we train our requisitioners to click the 'Check' button to flush things out.
I don't know if I was helpful.... another thought.... could there be an error caught by BBP_DOC_CHECK_BADI that is preventing change in BBP_DOC_CHANGE_BADI?
Regards, Dean. -
Passing data from one bsp application to another
Hi,
I have few queries that most of you would have done in ur projects:
1. I want to pass data from one bsp application to another:
eg based upon selected row of table view which populates material no and descriprion to another application which open the entire material master data.
Now, i have both the pages in diff bsp applications in place but unable to pass the selected material code to the second bsp application.
Had it been two different pages of same application I was able to achieve it with set parameter()
2. To stop the application from reprcessing the data:
eg: Suppose I have a bsp page where user fill details of a customer and on submitinng the details a customer is created in background and the entire page is disabled by my code. Even now if the user press refresh (F5) button then another customer gets created in the background. So basically i want to avoid the reprocess of the onSubmit event
Few lines of sample code would be very helpful.
Best Regards,
Saurabh TripathiHi,
When I am writing the following code in appl1/page1:
export abc from transactionID
to data buffer lv_page_data.
CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE
EXPORTING
NAME = 'TRANSACTIONID'
APPLICATION_NAME = RUNTIME->application_name
APPLICATION_NAMESPACE = RUNTIME->application_namespace
USERNAME = ls_name
SESSION_ID = runtime->session_id
DATA_VALUE = lv_page_data
DATA_NAME = 'lv_page_data'
and following code in appl2/page2:
CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>GET_SERVER_COOKIE
EXPORTING
NAME = 'TRANSACTIONID'
APPLICATION_NAME = RUNTIME->application_name
APPLICATION_NAMESPACE = RUNTIME->application_namespace
USERNAME = ls_name
SESSION_ID = runtime->session_id
DATA_NAME = 'lv_page_data'
CHANGING
DATA_VALUE = lv_page_data
IF lv_page_data IS NOT INITIAL.
IMPORT abc to transactionid
FROM data buffer lv_page_data.
ENDIF.
still the code doesn't work. Please explain and guide
Best Regards,
Saurabh Tripathi -
How to pass more than one parameter using common...
Hi,
I am using ODP.NET with my 2005 VB
I want to create function from where I can pass more than one parameter to execute SP, or query just like i created for SQL SERVER as below
Public shared Function CreateParameter(ByVal paramname As String, ByVal paramvalue As Object) As DbParameter
Dim param As DbParameter
param = New SqlParameter
param.ParameterName = paramname
param.Value = paramvalue
Return param
End Function
Public Shared Function ExecuteQuery(ByVal sql As String, ByVal commtype As CommandType, ByVal ParamArray parameter As DbParameter())
Dim cmd As DbCommand = New SqlCommand()
cmd.Connection = OpenConnection()
cmd.CommandType = commtype
cmd.CommandText = sql
cmd.Parameters.AddRange(parameter)
Dim RetVal As Integer = cmd.ExecuteNonQuery()
Return RetVal
End Function
specially part is in bold to be converted
I tried like but oracleCommand.parameters doesnt support AddRange
please help me out
RegardsHello,
I used the following way:
pCommand.CommandText = "Update " + sDataTable + " set "
+ sColumnName + " = :1 ";
pCommand.Parameters.Add("ValueToDb",
this.DefaultDbType,
this.m_Value,
System.Data.ParameterDirection.Input);
Of course, you can add :2,... to your command text, too.
The way back is:
sEndOfTheClause += " RETURNING " + sDataTable + "." + sColName + " INTO :iNewValue";
pCommand.CommandText = ... + sEndOfTheClause;
pCommand.Parameters.Add("iNewValue", this.DefaultDbType,
ParameterDirection.Output);
bool bReturn = (pCommand.ExecuteNonQuery() != 0);
if ((bReturn == true) && (pCommand.Parameters.Count > 0))
this.Value = DataService.Convert<DATA_TYPE>(pCommand.Parameters[0].Value);
....
Maybe you are looking for
-
How do I make a single row with 6-8 images in css?
I would like to make a header row with 6-8 icons of different dimensions and use them as links. I am having trouble getting them to align horizontally in a container. How do I do this?
-
Simplest way to duplicate a website?
Hi! I'm new to iWeb, but I have rather proudly managed to make and publish a site. The site is in my native language, now I wish to make a second version in English (with some help with the translation , that is!) My question is: Can I just "copy-pas
-
Corrupted library points to /usr/share/emacs/...
Advice on fixing a corrupted iTunes Library would be appreciated. The symptoms are invalid links to certain files, such as: file: "TED Sirena Huang" link: iBook/usr/share/emacs/21.2/lisp/net/webjump.el file: AC: Ray Kurzweil link: iBook/usr/share/ema
-
I have shot in camer raw on a canon mark 3 and the shots will not open in light room how dod I solve
How do I open shots from a Canon Mark 3 (RAW )?
-
I purchased Lightroom 5 Student teacher edition in June 2013,
I purchased Lightroom 5 Student teacher edition in June 2013, and installed it on my laptop and desktop computers. Recently my laptop crashed and I had to replace it. When I visit my account and try to re download it, it says it is not available to d