GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 143 of 166    Print  
how to take DATE as user input in PL/SQL block?

  
Total Answers and Comments: 2 Last Update: August 25, 2008     Asked by: NIKKI_PRIYAL 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 22, 2008 05:52:29   #1  
rajivgupta780184 Member Since: August 2008   Contribution: 32    

RE: how to take DATE as user input in PL/SQL block?
create or replace function get_period (pDate varchar2) return varchar2is pday varchar(20);begin SELECT TO_CHAR(to_date('&DATE' 'MM/DD/YYYY') 'DAY') into pday FROM DUAL;return pday;end get_period;to call the function select get_period(08/03/2008) from dual;
 
Is this answer useful? Yes | No
August 25, 2008 00:17:26   #2  
raghuprasad Member Since: August 2007   Contribution: 23    

RE: how to take DATE as user input in PL/SQL block?
Inputting the date in PL/SQL is same as in SQL. Simply pass the date as a string in the format DD-MON-YYYY.

Eg: SELECT * FROM TABLE WHERE HIRE_DATE 'dd-mon-yyyy'.

Or

You can also use Date functions TO_DATE('25-aug-2008' '......date formate......');

Hope this is the answer you are looking for.

Raghu.

 
Is this answer useful? Yes | No

 Related Questions

In PL/SQL I need to get like this scenario. if I am doing manipulation on a table, I need to display a record as Non-Updateable. It need to show a message to the user. How it is possible.Thanks in Advance.
Read Answers (7) | Asked by : murthy

How can we find the status (enabled/disable) of the trigger and the user who changed the status in SQL-Server.Many thanks.
Read Answers (2) | Asked by : Shahid

I want to convert source Date format "CCYYMMD" to "CCYY-MM-DD23.59.59.999999" in to the target for example source date is 19980224it should be in target 1998-02-24.23.59.59.999999
Read Answers (1) | Asked by : Sachin

Latest Answer : use execute immediate to write DDL statements.but you should have create  system previlege on the schema. ...
Read Answers (1) | Asked by : vasudev

Latest Answer : We can call a function from anonymous block as a part of sql statement written in that block.eg: create or replace function fn_emp(v_empno in number)return varchar2 isbeginselect ename into v_ename from empwhere empno=v_empno;return v_ename;end;this function ...
Read Answers (2) | Asked by : Anuruddha SINGH

Latest Answer : you can use SYSDATE oracle.lv_today := sysdate;or select sysdate into lv_today from dual;both the statements assign sysdate to lv_today ...

How can I use the bind variable in a report to create an output file. For example I give the starting date and end date. I would like to get the report output in a file which has the start date and end date in it's name.
View Question | Asked by : sk

How can I write a function which returns previous business date of given input date1. skip holidays when you find previous day2. skip Sunday and saturday's when you find previous dayUS holidays are 
Latest Answer : if you need to get the previous business date, just change the in_dt variable in declaration to input_dt date := '&Dt';in_dt date := input_dt - 1; ...
Read Answers (2) | Asked by : Rajesh

User Interface accepts the Employee information and this data needs to be compared with the existing data and the differences needs to be populated through a Pl/SQL table.Create a type (EMP_DATA) to populate 
View Question | Asked by : kshasikumar

Latest Answer : Inputting the date in PL/SQL is same as in SQL. Simply pass the date as a string in the format DD-MON-YYYY.Eg: SELECT * FROM TABLE WHERE HIRE_DATE='dd-mon-yyyy'.OrYou can also use Date functions TO_DATE('25-aug-2008','......date formate......');Hope this ...


 Sponsored Links

 
Related Articles

C++ Standard Input Output Stream

C Standard Input Output Stream In this C tutorial you will learn about standard input stream and standard output stream explained along with syntax and examples C programming language uses the concept of streams to perform input and output operations using the keyboard and to display information on
 

JavaScript Date Object

JavaScript Date Object In this JavaScript tutorial you will learn about date object and methods of date object explained along with syntax and example mosgoogle center JavaScript Date Object Usage of Date Object Date object of Java Script is used to work with date and times General syntax for defini
 

How Ajax Can Become as User Friendly as Flash

How Ajax Can Become as User Friendly as Flash There are a number of reasons why Flash has become so popular on the web today and this lies in the fact that users don t have to reload the page Products such as Flash Remoting will allow users to access the background server and Ajax can do the same th
 

How To Fight Against Writer's Block

How To Fight Against Writer s Block Writer s block is something that a lot of people face but it can be especially troubling for students who are in college or high school They will usually be sitting in their class when the instructor gives a writing assignment It will almost always be in the form
 

C Programming - Managing Input and Output Operations

C Programming Managing Input and Output Operations In this tutorial you will learn about Single character input output String input and output Formatted Input For Scanf Input specifications for real number Input specifications for a character Printing One Line Conversion Strings and Specifiers Speci
 

What is User Acceptance Testing?

What is User Acceptance Testing Introduction This article attempts to explain the process of User Acceptance Testing Once the application is ready to be released the crucial step is User Acceptance Testing In this step a group representing a cross section of end users tests the application The user
 

ASP.NET 2.0 Free Training : Personalization: User Profiles and Themes

ASP NET 2 0 Free Training Personalization User Profiles and Themes In this tutorial you will learn about Personalization User Profiles and Themes Inbuilt providers in ASP NET 2 0 and also Create and execute a Shopping cart application with Personalization features mosgoogle Surfers would love to see
 

Oracle 10g Tutorials- SQL*Loader - Input Data and Datafiles

Oracle 10g Free Training SQL Loader Input Data and Datafiles In this tutorial you will learn about SQL Loader Input Data and Datafiles Fixed Record Format Variable Record Format and Stream Record Format mosgoogle SQL Loader Input Data and Datafiles SQL Loader reads data from one or more files or ope
 

Creation of Master Detail Block in Oracle Apps 11i

Creation of Master Detail Block in Oracle Apps 11i In this tutorial you will learn about Creation of Master Detail Block in Oracle Apps 11i its prerequisites and Frequently Asked Questions mosgoogle Creation of Master Detail Block in Oracle Apps 11i Prerequisites There should exist a foreign key re
 

Tutorial 64: MSAS - Securing User Authentication

The enforcement of security defined by the roles must be preceded by user authentication When the user connects to the Analysis server the first thing that happens is authentication The user login is validated and the user is given access to the data on the server in accordance with the roles If aut
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape