User input from pl/sql
How could I get user input from a pl/sql block?
Hope that somebody can help me.
thanx
Amelio.
There is a package DBMS_LOCK that has a SLEEP routine, which suspends the session for a given period of time (in seconds).
However, you can only pause the procedure and not accept user input into the procedure during the pause.
syntax: DBMS_LOCK.SLEEP(1) ;
I need only to run an 'pause' or something like that within a pl/sql block. Do you know if it's possible? Thanks.
Similar Messages
-
How to accept user inputs from sql script
I want to create Tablespace useing sql script , but the location of the data file I need accept from user . (to get the location of the data file ) .
How can I accept user input from pl/sql .
Example :
CREATE TABLESPACE TSPACE_INDIA LOGGING
DATAFILE 'H:\ORACLE_DATA\FRSDB\TSPACE_INDI_D1_01.dbf'
SIZE 500M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;here I need to accept location of the datafile from user ie : 'H:\ORACLE_DATA\FRSDB\TSPACE_INDI_D1_01.dbf'Hi,
Whenenever you write dynamic SQL, put the SQL text into a variable. During development, display the variable instead of executing it. If it looks okay, then you can try executing it in addition to displaying it. When you're finished testing, then you can comment out or delete the display.
For example:
SET SERVEROUTPUT ON
DECLARE
flocation VARCHAR2 (300);
sql_txt VARCHAR2 (1000);
BEGIN
SELECT '&Enter_The_Path'
INTO flocation
FROM dual;
sql_txt := 'CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
DATAFILE' || flocation || ' "\SRC_TSPACE_INDI_D1_01.dbf" ' || '
SIZE 500M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL ';
dbms_output.put_line (sql_txt || ' = sql_txt');
-- EXECUTE IMMEDIATE sql_txt;
END;
/When you run it, you'll see something like this:
Enter value for enter_the_path: c:\d\fubar
old 5: SELECT '&Enter_The_Path'
new 5: SELECT 'c:\d\fubar'
CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
DATAFILEc:\d\fubar
"\SRC_TSPACE_INDI_D1_01.dbf"
SIZE 500M AUTOEXTEND ON NEXT 1280K MAXSIZE
UNLIMITED
EXTENT MANAGEMENT LOCAL = sql_txt
PL/SQL procedure successfully completed.This makes it easy to see that you're missing a space after the keyword DATAFILE. There are other errrors, too. For example, the path name has to be inside the quotes with the file name, without a line-feed between them, and the quotes should be single-quotes, not double-quotes.
Is there some reason why you're using PL/SQL? In SQL, you can just say:
CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
DATAFILE '&Enter_The_Path\SRC_TSPACE_INDI_D1_01.dbf'
SIZE 500M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;though I would use an ACCEPT command to given a better prompt.
Given that you want to use PL/SQL, you could assign the value above to sql_txt. If you need a separate PL/SQL variable for flocation, then you can assign it without using dual, for example:
DECLARE
flocation VARCHAR2 (300) := '&Enter_The_Path';The dual table isn't needed very much in PL/SQL.
Edited by: Frank Kulash on Jan 10, 2013 6:56 AM -
How to prompt for user input in PL/SQL
How do I prompt for user input in PL/SQL?
I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
If the user chooses to input the value I want to update a set of database fields with the value.
I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?
Edited by: desgordon on Sep 3, 2008 10:33 AMdesgordon wrote:
How do I prompt for user input in PL/SQL?
I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?OK, you're doing that in Forms...
>
If the user chooses to input the value I want to update a set of database fields with the value.Write PL/SQL procedure for this purpose...
>
I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?Not clear what you mean with view?
But if you call your procedure in that button then yes 'control will be passed back to the code'...
Cheers!
Edited by: Faust on Sep 3, 2008 7:57 PM
Too slow... -
Where to validate user input from FPM_FORM_UIBB?
I am supporting an ESS OVP app using WDA and FPM.
This question concerns validating/changing user input from an edit page entered through FPM_FORM_UIBB
In a form, on an edit page, we wanted to mask the initially loaded value of a field with asterisks.
I used the feeder class get_data() method to accomplish this.
The user may then overtype the asterisks with content data. At times, the user leaves some of the asterisks there as well.
I want to check the contents of the inpu field, and, if needed, compress out the asterisks.
if not inputfield co '* ' .
translate inputfield using '* ' .
condense inputfield NO-GAPS .
endif .
Where can I put this code? Or, where, generally, do you code validations of form data?
Thanks…
…MikeHi Mark,
You should be able to catch the event in PROCESS_EVENT and GET_DATA. I would put the break-point in both of these methods and check for the field values and based on that decide course of action. So steps would be.
1) Put in the break-points in the obove methods.
2) Check the event and the field values you are intrested in.
3) Code accordingly.
Hope it helps.
Laeeq Siddique -
Hello
I would like to incorporate code into this to allow the script I found on the internet to pull input from a txt file and then wait for the script to end before using the next entry in the text file and run until all entries in the text file have been used.
Any help would be great thx.
Jason
' Get Options from user
GetOptions
If (bInvalidArgument) Then
WScript.Echo "Invalid Arguments" & VbCrLf
bDisplayHelp = True
End If
If (bDisplayHelp) Then
DisplayHelp
Else
If (bCheckVersion) Then
CheckVersion
End If
If (strComputer = "") Then
strComputer = InputBox("What Computer do you want to document (default=localhost)","Select Target",".")
End If
If (strComputer <> "") Then
' Run the GatherWMIInformation() function and return the status
' to errGatherInformation, if the function fails then the
' rest is skipped. The same applies to GatherRegInformation
' if it is successful we place the information in a
' new word document
errGatherWMIInformation = GatherWMIInformation()
If (errGatherWMIInformation) Then
If (bDoRegistryCheck) Then
errGatherRegInformation = GatherRegInformation
End If
GetWMIProviderList
Else
WScript.Quit(999)
End If
If (bHasMicrosoftIISv2) Then ' Does the system have the WMI IIS Provider
GatherIISInformation
End If
SystemRolesSet
If (errGatherWMIInformation) Then
Select Case strExportFormat
Case "word"
PopulateWordfile
Case "xml"
PopulateXMLFile
End Select
End If
End If
End IfUnfortunately the script is too long to be posted but can be found at
http://sydiproject.com/download/and is called Server v.2.3. I have also contacted the author and made the suggestion I
asked about.
Jason
I do not know which script you had in mind but the one I looked at had 1,600 lines of code. As you say, posting it here would be inappropriate. At the same time it is unrealistic to ask for help for such a large script. Asking the author is one option. The
other option would be to identify the module you wish to modify, analyse it until you fully understand it, modify it so that you can run it in a stand-alone manner, then post your question here. You will probably find that you can answer the question yourself
after analysing the code! -
Reading user input from a form within a workflow and perform actions in workflow based on the input
Sharepoint 2013
Need to get input from a user based on some condition within a workflow and based on the input received continue with the workflow. It can be a form with a text box and button to which i can redirect and when user enters a value and clicks on the button
,I should come back to the workflow and perform other processing. I should also be able to manually start this workflow from VS.
Tried different approaches like initiation forms ,user input action of SP2010 etc all of these approaches either add some tasks to task list or force me to click on the workflow link to get input from a user.
Any suggestions on this?Hello
Thanks for the code, but I don't need an array of beans. By the way this code make a bean and an arraylist everytime it's called?
I was looking for something like this:
<form action="myjsp.jsp" method="post">
...so after submitting the result will go to the myjsp.jsp file and in the myjsp.jsp file
<jsp:useBean id="value" class"myBean">
<jsp:setpropertiy name"value" ....>so everytime I click the add button the values will go the mysjp.jsp file and that will set them in the javabean file. this method uses two files but I was looking for doing this in the same jsp file and not sending it to another file.
chers
Ehsan -
Selecting user input from Select option into smart form
Hi,
when i use parameter then i wil show company code in smart-form output
but when i use select option then its throwing error parameter specified here is different
what should i do in this case i want to design a big select option screen for taking user input
REPORT ZMM.
TABLES BSEG.
DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
V_FMNAME TYPE RS38L_FNAM.
*PARAMETERS SO_BUKRS TYPE BUKRS.
SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.
DATA : Z_CONTROL TYPE SSFCTRLOP, "Smart Forms: Control structure
Z_OPTIONS TYPE SSFCOMPOP. "SAP Smart Forms: Smart Composer (transfer) options.
MOVE 'X' TO : Z_control-no_dialog, "SAP Smart Forms: General Indicator
Z_options-tdnewid, "New Spool Request (Print Parameters)
z_control-PREVIEW. "Print preview
MOVE 'LP01' TO Z_options-tddest. "Spool: Output device
MOVE space TO Z_options-tdimmed. "Print Immediately (Print Parameters).
MOVE 'PRINTER' TO Z_control-device. "Output device
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = V_FORMNAME
IMPORTING
FM_NAME = V_FMNAME.
CALL FUNCTION V_FMNAME
EXPORTING
CONTROL_PARAMETERS = Z_CONTROL
OUTPUT_OPTIONS = Z_OPTIONS
USER_SETTINGS = ''
BUKRS = SO_BUKRS.
pls help me in this regards.
ketan..hi
thnx for your reply
can u pls elaborate in my code
now i changed code BUKRS = SO_BUKRS-low.
either i can give low or high but how to select from range
REPORT ZMM.
TABLES BSEG.
DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
V_FMNAME TYPE RS38L_FNAM.
*PARAMETERS SO_BUKRS TYPE BUKRS.
SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.
DATA : Z_CONTROL TYPE SSFCTRLOP, "Smart Forms: Control structure
Z_OPTIONS TYPE SSFCOMPOP. "SAP Smart Forms: Smart Composer (transfer) options.
MOVE 'X' TO : Z_control-no_dialog, "SAP Smart Forms: General Indicator
Z_options-tdnewid, "New Spool Request (Print Parameters)
z_control-PREVIEW. "Print preview
MOVE 'LP01' TO Z_options-tddest. "Spool: Output device
MOVE space TO Z_options-tdimmed. "Print Immediately (Print Parameters).
MOVE 'PRINTER' TO Z_control-device. "Output device
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = V_FORMNAME
IMPORTING
FM_NAME = V_FMNAME.
CALL FUNCTION V_FMNAME
EXPORTING
CONTROL_PARAMETERS = Z_CONTROL
OUTPUT_OPTIONS = Z_OPTIONS
USER_SETTINGS = ''
BUKRS = SO_BUKRS-low.
ketan.. -
How to delete last user session from backend SQL query?
Sometimes user session gets closed between some work by any reason.
When next time that user logs to P6, he gets some error or particular functionaly dosen't work for that user or system hangs.
In that case if i decided to clear last session history of that user from database, how to write SQL query?
I don't want to delete all user sessions from table USESSION and USESSAUD, i simply want to delete last user session of particular user (E.g XYZ).I am quoting this from MOS Doc Id "Why would multiple session records be present in the User Sessions screen in P6 Web, and why might some of them have different IP addresses? (Doc ID 1600172.1)"
Multiple sessions show up for users since different sections of P6 Web have their own sessions associated with them. If a user is authorized to use multiple areas of the software they will have multiple sessions each time they log in. Additionally, if users are closing their browsers before logging out of P6 Web Access you might see some past sessions still appearing in the list. These will eventually be cleared out by background jobs, however you can also reset the sessions in the software by clicking the "Reset User" link (Administer > User Sessions > Manage User Sessions), or by choosing the "Reset All Users" link (Administer > User Sessions > Manage User Sessions) to do this for all past sessions.
Multiple IP addresses for sessions can happen when a user logs in from different machines. For example, a person may login at their desk, but then go to a colleagues workstation to discuss a project, and log in from there. Doing so will leave them with multiple IP addresses in the session records.
Hope this helps
Regards,
Sachin Gupta -
Accepting dynamiv user input using PL/SQL
Hi,
I need to accept dynamic number of user input values.
What i need is i will enter the number of employees to be created.
If i enter 2 then i need to dynamically accept 2 employee details.
DECLARE
v_emp_cnt NUMBER;
v_emp_id VARCHAR2 (15);
v_emp_name VARCHAR2 (200);
BEGIN
v_emp_cnt := &v_emp_cnt;
FOR i IN 1 .. v_emp_Cnt
LOOP
DBMS_OUTPUT.PUT_LINE('INSIDE LOOP');
v_emp_id := &v_emp_id;
v_emp_desc := &v_emp_Desc;
INSERT INTO emp_details (process_id,
column11,
column12,
column13)
VALUES ('EMPLOYEES',
'EMP-' || i,
v_emp_id,
v_emp_desc);
END LOOP;
END;
/Can anyone let me know if this is the right approach to acheive my requirement. Please suggest alternatives.
Thanks
Vamsi KrishnaPL/SQL is a server-side language-- it doesn't have the ability to interact with a user. A client application such as SQL*Plus, can both prompt for input and submit SQL statements to the database. It's probably possible to hack together a SQL*Plus script that could do something like what you appear to be looking for but using SQL*Plus for this sort of thing would generally be the wrong architectural solution. You'd generally be better off with a small shell script that prompted the user for data and then called a stored procedure.
Justin -
I'm using Oracle 10g
From a database procedure, how to select the current user name who is logged inVenkadesh wrote:
sb92075Careless mistake :(You dont need to use SELECT also.. Just simply assign USER to variable (OP stated - in PL/SQL)
SQL> declare
2 lc_user varchar2(30) := user;
3 begin
4 dbms_output.put_line(lc_user);
5 end;
6 /
DCA
PL/SQL procedure successfully completed. -
Requesting user input from UNIX command window
New to this forum, and relatively new to Java......question for you......
Currently, I am able to request a .txt file from a user in my unix command window by having them type in the following command:
java Game (nameOfTextFile).txt
with the following code:
public class Game {
public static void main(String[ ] args) {
try{
reader = args[0];
catch(Exception g){
System.out.println(g);
where 'reader' holds the .txt file.
What I would like to do is as soon as the user types in the command:
java Game
it gives them the line:
"Please type the file to be input"
and at this point they type in:
(nameOfTextFile).txt
and then I can start working with the text file.
Any ideas?
Thankspublic class Game {
public static void main(String[ ] args) {
try{
reader = args[0];
catch(Exception g){
System.out.println(g);
}This class will not compile. The variable 'reader' is not declared anywhere.
You could create a shell program. When the user enters the name of the shell program at the command prompt, it gives them the prompt to enter the file to be input. And then from within the shell program you call the java program with the name of the file. -
Prompt for input from PL/SQL script.
I have PL/SQL script running in SQL*Plus. I need to prompt for user initials (all users log-in with the same username) and make those initials part of the script.
How do I do that?
I know how to do it for SQL script:
ACCEPT X PROMPT 'ENTER X: '
select ....
where column1 = '&X'
But what about PL/SQL?
Thanks a lot.
-JohnPL/SQL is not interactive, so you can't prompt from it, but you can pass parameters :
TEST@db102 SQL> set veri off
TEST@db102 SQL> get inp
1 declare
2 p_inp varchar2(100);
3 begin
4 p_inp := '&1';
5 dbms_output.put_line(p_inp);
6* end;
TEST@db102 SQL> @inp PM
PM
PL/SQL procedure successfully completed.
TEST@db102 SQL> -
Metadata through user input from portal application while new check In
Hi,
We have a requirment to create new doc/html from portal end, and check in it into UCM with user populated metadata's
I have few quetions
- Can I user OOTB RichtextEditor taskflow with little customization.
- Is it a easy option to add a check in form (custom taskflow).
- or we have to create new custom taskflow and use CHECKIN_NEW service using RIDC api.
Thanks
Edited by: 953836 on Aug 21, 2012 2:20 AMYou could go with the standard stuff, but everything depends on what user experience you want to achieve.
a) doc/html
What formats you want to support? HTML is OK, but .DOC (especially if it means MS-Word) might be a challenge
b) you could use SSXA tags (see here: http://docs.oracle.com/cd/E23943_01/doc.1111/e13650/toc.htm ) which could do exactly what you ask for (via Contributor Data Files). Note, however, that this user experience is not often met with understanding. And even more important, mind this: Clarification on SSXA Support with WebCenter Portal
c) you could also use CHECKIN_NEW_FORM (see here http://docs.oracle.com/cd/E23943_01/doc.1111/e11011/c04_core.htm#BABGBCHI ) and somehow consume its output in your custom code. By doing this, you could use Content's standard functionality, profiles, but yet, achieve the user experience similar to what Desktop Integration Suite provides. -
How to capture user inputs from Enter_query command?
When the user enters query(F7) and inputs some field parameters...how do I capture those variables after they execute the query?
Example:
-Table ABC has a column called NAME
-They enter '%BOB% in the NAME field
-They press F8 (enter-query)
I've tried using:
message( get_block_property('ABC', DEFAULT_WHERE)) to see what's in there and it returns a null. I know that if I hit F7 twice, I can see '%BOB%' displayed in the field. Is there a way to see this without hitting F7 twice?
Thanks.-Table ABC has a column called NAME
-They enter '%BOB% in the NAME field
-They press F8 (enter-query)
? F8 = execute-query
however. Use the PRE-QUERY and write your message there and show the value of :ABC.NAME
that's it
Gerd
PS: Without hitting two times F7 you have NO chance to get the value of %BOB%. this is an internal cache mechanism of the forms runtime and only hitting two times F7 gives you the information which forms has remembered in a local cache. -
Hi All,
I am working on OAF 5.7H with a Travel Module for a UN organisation .
I have a pge in which I have table Region.In the table i have a message choice Box displaying different Travel Types.In the same row i have a check box with Yes or No value
my requirement is ,whenever the user selects some particular travel types(the page gets refreshed) from the message choice,the check box should be rendered or hidden.
For example
if the user selects travel type MISSION in the message choice ,the page refreshes and the check box shud not be rendered
and
if the user selects travel type HOME LEAVE,the page refreshes and the check box shud be rendered.
But my problem is i am not able to capture the user selection of the message choice and at the same time render the chek box true or false.
If i kan capture the user selection of the message choice values while the page refreshes then at the same time i kan play around with the chekBox.
First of all is this possible and if kan anyone give me a little clue.Thanks Ram for your reply..I did this but it doesnt seem to work..Because now i realize the problem is somewhere else.
I have a Table RN as i said.
In that table region all the componenets are added in stack layout,i mean to say every stack layout region gets added coloumn wise to the table.
Now i have a Add Anather Row Button.
My requirement is :
Suppose the user selects Travel Type Mission on first row,The page gets refreshed and the chekBox doesnt get rendered.
Now if the user hits Add Anather Row Button and creatres a new row and selects the travel type to be HOME LEAVE whereby the check box shud get rendered in that row.
But the problem is this is not happening.
i am doing as u said..
Now if i choose a Travel type in the second row which shud hide the chekbox then in all the rows the Check Box gets hidden,even in the previous row where it shud be rendered.
This is happening because each of the stack layout region conataining the chek boxes get added as coloumn to the entire table,
So if i do any manipulation on the chek box it gets defaulted for all the rows.
I dont know what to do ..
i need to handl eit row wise.
I am iterating through the row set to capture the travel types in each row.
But on the row set i cannot set any web bean property.
somebody please tell me ho wto crack this.
Thanks
Maybe you are looking for
-
Using JHeadstart to generate shuttles for updates
Hi guys, Using JHeadstart 11.1.1.3 - is it possible to generate shuttle boxes for the simple task of updating records. For example - in the leading list I want to see all employees with a status of 'ACTIVE'. In the trailing list I want to see all emp
-
I'm in a BCS project and designed to be the BW consultant for the project. I know that there is a base named EC-CS that you can read FIGL datas into a cube in BW to import these data later to a BCS cube. But I heared that there is a new solution that
-
I have a singleton class. A method in this class creates an array of structures. This class is shared across different process. So there is a chance that some one unknowigly calls the method to create the array of structures and hence the member vari
-
Hi, I would like to become a PLSQL developer.... I know SQL and PLSQL only... Is there any need to study extra other than SQL and PLSQL.... please advise me and help me out....
-
Multi Row Text Item (Not Text Area)
Is it possible to create a multi-row text item for entering data i.e. a text area WITHOUT a scrollbar?. I know exactly how many rows I need e.g. an address field The scroll bar looks terrible on printouts when printing off data entry forms. Also any