SQL LOGIC - How to accept USER input and use that data in SQL Logic?
Hello Experts
Can anyone of you please explain in detail how to acheive the above task am a begginner, it would be great help for me.
Thanks in Advance.
Hi,
You mean to say, you need to use inputs from Data manager Prompts in your Script Logic.
From Help File
You can use the EvDTSModifyPkg task to dynamically pass a text string to logic in Data Manager. For example, a user who wishes to dynamically pass a text string representing a year (which is a portion of the *XDIM_MEMBERSET instruction) could use the following steps:
Using the EvDTSModifyPkg task, prompt for the year, i.e., PROMPT(TEXT,%TEXT%,"select a year")
Pass the returned %TEXT% to the FormulaScript of the RunLogic task as follows: TASK(RUNLOGIC,FORMULASCRIPT,"*FUNCTION MYYEAR=%TEXT%u201D)
In the Data Manager logic, use the dynamically created function as follows: *XDIM_MEMBERSET TIME=MYYEAR.INPUT.
The logic name in the RunLogic task must be specified with the .LGF extension to enforce its validation at run time.
BPC NW 2.0 Version Works differently.
Hope this Helps,
Kranthi
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 -
Accepting user input and executing a PL/SQL block using it
Hi All,
I am working on a requirement wherein I have to accept values from the user for the various arguments to be supplied to a PL/SQL block and then execute it using these values. For now, I am using the following logic:
PROMPT Enter value for the Category
ACCEPT cCategory CHAR PROMPT 'Category:'
DECLARE
cCategry CHAR(1) := '&cCategory';
BEGIN
DBMS_OUTPUT.PUT_LINE('The value of the Category as entered by you is' || cCategory);
END;
PROMPT Press y if you want to proceed with the current values, or press n if you want to re-enter the values
ACCEPT cChoice CHAR Prompt 'Enter y or n:'
DECLARE
cCategry CHAR(1) := '&cCategory';
sErrorCd VARCHAR2(256);
sErrorDsc VARCHAR2(256);
BEGIN
IF '&cChoice' = 'y'
THEN
DBMS_OUTPUT.PUT_LINE('Starting with the process to execute the stored proc');
--- schema1.package1.sp1(cCategry, sErrorCd, sErrorDsc);
--- DBMS_OUTPUT.PUT_LINE('Error Code :' || sErrorCd);
--- DBMS_OUTPUT.PUT_LINE(' Error Description :' || sErrorDsc);
ELSIF '&cChoice' = 'n'
THEN
Now I want that the proc again start executing in the loop from the 1st line i.e. PROMPT Enter value for the Category. However i see that this is not possible to do that PROMPT statements and accepting user inputs execute only on the SQL prompt and not inside a PL/SQL block.
Is there an alternate method to establish this?
Thanks in advance.Hi,
You can write a genric procedure to achive the desired output. Pass 'Y' or 'N' in the procedure.
Call that procedure in simple pl/sql block during runtime using substituton operator.
For ex
create or replace procedure p1(category_in in varchar2)
IS
BEGIN
if (category_in='Y')
then
prcdr1()
/** Write your logic here ***/
elsif(category_in='N') then
prcdr2()
/** write your logic here***/
end if;
exception
/***write the exception logic ***/
end p1;
Begin
p1('&cat');
end;Regards,
Achyut K
Edited by: Achyut K on Aug 6, 2010 5:20 AM -
How to compare user input and database data?
hi, I am new to JAVA, i hope i didnt post wrong forum :P
I would like to know how to get user data input from web page(client side) and compare with the data in database (server side)?
What i doiong is using the JavaScript to get the user input and compare with the JSP. but this way it seem like not a good way! Because i facing a lot of problem to get the user input!!
Thx a lot!!
function pasteData(obj){
var em_num_select = obj;
//document.write(em_num_select);
<%
SQLSelectNO = "SELECT em_num FROM emmast ";
try {
getEmpNo = db.execSQL(SQLSelectNO);
}catch(SQLException e){
System.err.println("Query Error!!");
while(getEmpNo.next()){
matchEmpNo = getEmpNo.getString("em_num");
%>if (em_num_select == '<%=matchEmpNo%>'){
<%
String SQLgetAllInfo = "SELECT em_num, em_name, em_init, "+
"em_buyer_flag, em_dsgn_cde, em_proj_all, "+
"em_proj_cde1, em_proj_cde2, em_proj_cde3 "+
"FROM emmast "+
"WHERE em_num = '"+matchEmpNo+"' ";
try{
getAllInfo = db.execSQL(SQLgetAllInfo);
}catch(SQLException e){
System.err.println("Query Error");
while(getAllInfo.next()){%>
document.all.emp_name.value = '<%=getAllInfo.getString("em_num")%>'
document.all.emp_init.value = '<%=getAllInfo.getString("em_name")%>'
document.all.emp_disg.value = '<%=getAllInfo.getString("em_dsgn_cde")%>'
document.all.emp_buyer_flg.value = "<%=getAllInfo.getString("em_buyer_flag")%>";
document.all.emp_basis.value = "<%=getAllInfo.getString("em_proj_all")%>";<%System.out.println(getAllInfo.getString("em_proj_cde1"));%>
document.all.emp_pro_cde1.value = "<%=getAllInfo.getString("em_proj_cde1")%>";
document.all.emp_pro_cde2.value = "<%=getAllInfo.getString("em_proj_cde2")%>";
document.all.emp_pro_cde3.value = "<%=getAllInfo.getString("em_proj_cde3")%>";
<%}%>
}//close if (em_num_select == '<%=matchEmpNo%>')
<%}// close hile(getEmpNo.next())%>
}// close function pasteData(obj)Hi,
This forum is exclusively for Sun Java Studio Creator.
You may need to post this question at:
http://forum.java.sun.com/forum.jspa?forumID=45
Thanks,
Creator Team. -
How to take user input and place it in a variable
All I want to know is how to copy user input from the message pop up and store in a local variable?
Thanks.Hi
Just take a look at thread's example
http://forums.ni.com/t5/NI-TestStand/TestStand-Message-Popup/m-p/1792424/highlight/true#M35397
The trick is done by Message-Popup PostExpression: Locals.strMyResponse = Step.Result.Response
Hope this helps
Juergen
=s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e= -
URGENT!.....accepting user input and string conversion
I have a problem with a text-based menu I am trying to create for a Shape class with rectangle, circle, etc... subclasses below it...here is a code clip
//The menu choices given to the user.
System.out.println("Please select which shape you would like to create:\n");
System.out.println("(1)Rectangle");
System.out.println("(2)Square");
System.out.println("(3)Circle");
System.out.println("(4)Ellipse");
System.out.println("(5)Exit the program\n");
System.out.print("Enter your choice (1,2,3,4 or 5): ");
menuChoice=(char)System.in.read();
switch(menuChoice) {
case '1':
System.out.println("\nTo create a rectangle, please enter the following dimensions below (integers only)...\n");
System.out.print("Center X co-ordinate = ");
while((x=(char)System.in.read()) !='\n')
CentXBuf.append(x);
System.out.print("Center Y co-ordinate = ");
while((y=(char)System.in.read()) !='\n')
CentYBuf.append(y);
The above works fine, however, when the the user inputs the menu choice, it does not let me input the center x co-ordinate and goes on to the second input of the center y co-ordinate then the program crashes with a NumberFormatException
I tried to replace
menuChoice=(char)System.in.read();
with
while((z=(char)System.in.read()) !='\n'){
zBuff.append(z);
String v = new String(zBuff);
int menuChoice = Integer.valueOf(v).intValue();
but the above itself gives me a NumberFormatException also!
What do I do?!?!Try this:
BufferedReader reader = new BufferedReader(
new InputStreamReader(System.in)
String input = reader.readLine(); -
Captivate 6 How to validate user input without using keyboard shortcuts
I've been using Adobe Captivate 6 for about 4 months now. Completely new to the program. The number one function of Captivate for me will to create many software simulations for verifiable training. This means that I will be utilizing the training and assessment modes A LOT. I have run into many hurdles throughout the process, but one of my biggies right now is this:
In the training and assessment modes, I have times where the user must input data such as an address or number. In the actual software they will be utilizing it is not always required to use TAB or ENTER in order to move to the next field. In some instances, it will be necessary to actually click into a field after entering data. My problem is that it seems as if Captivate will not allow this, as a keyboard shortcut is automatically entered even if a TAB or ENTER is not required after input. I assume this is so that the inputted information can be verified. If you decide you do not want to use a keyboard shortcut to validate the inputted information, you must have a submit button. Is there any way to change this?? All I want is for the user to enter information and then click into another field WITHOUT having to press ENTER, TAB, or hit a submit button. Is this even possible if you need user input to be validated?? Any ideas or suggestions would be much appreciated!!Hello,
A while ago I explained the work flow I’m using often in that case, only for the last field you need to have either a shortcut or a submit button AND the sequence has to be imposed. The idea is that you make the Submit button for the first field transparent, delete the ‘Submit’ text and put it over the second field. So if the user clicks on the second field, he also submits the value of the first field.
Here is the blog post I’m referring to:
http://lilybiri.posterous.com/one-submit-button-for-multiple-text-entry-box
Although it was written for previous versions, the idea will still be functional.
Lilybiri -
Accepting user input and then running grant statements
Hi I have a script which creates a database, at the end of this script I need to change user, and then run a number of grants. I need to accept the name of the schema to make the grants to from the user. The code I have been trying to use is below
--Prompt for portal password and connect as portal
connect portal
--Issue grants for portal apis
PROMPT 'Enter the schema name'
ACCEPT schema
@provsyns.sql &schema
PROMPT 'Enter the schema name'
ACCEPT schema
grant select on WWSEC_PERSON to &&schema;
PAUSE
grant select on WWSEC_GROUP$ to &&schema;
PAUSE
grant execute on wwctx_api_private to &&schema;
grant execute on pkg_oid to &&schema;
grant execute on pkg_error_handling to &&schema;
UNDEFINE schema
When I run the code I get and ORA-00987: missing or invalid username(s)
Can anyone help me please?
Many thanks,
DannyHi,
You can write a genric procedure to achive the desired output. Pass 'Y' or 'N' in the procedure.
Call that procedure in simple pl/sql block during runtime using substituton operator.
For ex
create or replace procedure p1(category_in in varchar2)
IS
BEGIN
if (category_in='Y')
then
prcdr1()
/** Write your logic here ***/
elsif(category_in='N') then
prcdr2()
/** write your logic here***/
end if;
exception
/***write the exception logic ***/
end p1;
Begin
p1('&cat');
end;Regards,
Achyut K
Edited by: Achyut K on Aug 6, 2010 5:20 AM -
SQL report how to handle user input
All if i have a simple sql query like
select * from tablename
And in th report page i would like to put in differenet boxs so that someone could say have date, and usersphone etc.
Without using PL/SQL function returning sql query Is there a way to say
select * from table
where
date = :P24_inputdate
and
usersphone = :p24_usersphone
And there would have to be something inclucded if nothing was put in by the user and he/she just wanted everything.How about:
select * from table
where
(date = :P24_INPUTDATE or :P24_INPUTDATE is null)
and
(usersphone = :P24_USERSPHONE or :P24_USERSPHONE is null)
Andrew -
How to Create text file and ammend that file in SQL Server 2005
HI All,
I want to upload some Sql query ouput to .txt file. I have tried using the BCP command. I am not able to create the .txt file dynamically by running this query.
First create the bcptest.txt in File System and run the query, then its copying the data.
But I want to create .txt dynamically and wants to append the .txt data instead of overwriting.
EXEC
xp_cmdshell
'bcp "SELECT * FROM sysfiles" queryout "C:\bcptest.txt" -T -c -t,'
Ram MSBI DeveloperHi Sebastian,
I have used the query and it is working fine. but, How could i include the headers of the query also in to the Excel Sheet.
RehaanKhan. M
see the method discussed here
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/10/10/export-to-excel-with-column-names.aspx
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Passing date to another form and use the date in sql statement
hello! to all programmers
i have some small problem that need some help.
i want to use date value parameter from the first page in the second page sql statement but i get invalid cursor state error so if anyone can solve this problem or give me a better solution to do this process.
thanks in advance
p/s
EBDATE is define as date data type in my database.
this is part of my jsp code...
<---------------------------------------------------------------------->
SimpleDateFormat sdfInput = new SimpleDateFormat( "yyyy-MM-dd" );
SimpleDateFormat sdfOutput = new SimpleDateFormat ( "dd/MM/yyyy" );
String date= request.getParameter("date");
Date date1 = sdfInput.parse(date);
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:wtmis_db","","");
Statement stmt=con.createStatement();
ResultSet set=stmt.executeQuery("select * from ELECTRICBIL where EBDATE="+sdfOutput.format(date1));
if (set!=null)
set.next();
Date bildate =set.getDate ("EBDATE");
Date sdate =set.getDate ("EBSTARTDATE");
Date edate =set.getDate ("EBENDDATE");
int kw =set.getInt ("EBKILOWATT");
int maxdemand =set.getInt ("EBMAXIMUMDEMAND");
int days =set.getInt ("EBDAYS");
<---------------------------------------------------------------------->Try this
<%
while(set.next())
Date bildate =set.getDate ("EBDATE");
Date sdate =set.getDate ("EBSTARTDATE");
Date edate =set.getDate ("EBENDDATE");
int kw =set.getInt ("EBKILOWATT");
int maxdemand =set.getInt ("EBMAXIMUMDEMAND");
int days =set.getInt ("EBDAYS");
%>
<tr>
<td width="211"><div align="left"><b>Bill Date :</b></div></td>
<td width="573"><%=sdfOutput.format(date1)%></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Bill From :</b></div></td>
<td width="573"> <input type="text" name="textfield" value="<%=sdate%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Bill To :</b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=edate%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b><b>kiloWatt Use (Rm)</b>: </b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=kw%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Max Demand kiloWatt (Rm):</b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=maxdemand%>"></td>
</tr>
<tr>
<td width="211"><div align="left"><b>Days In Billing :</b></div></td>
<td width="573"> <input type="text" name="textfield2" value="<%=days%>"></td>
</tr>
<%
%>
i hope. Now u wouldn't get any error message...but...u wouldn't get results as well...Check ur date format with access date format....
Revert back -
How to create a Matrix table using this data in SQL Query Analyzer
Hello all,
I have a problem while I am trying to represent my Sql Table namely table1 in Matrix form
my table Format is
city1 city2 Distance--------------------------------------------------------
Mumbai Delhi 100
Delhi Banaras 50
Mumbai Rajasthan 70
Banaras haryana 40
Mumbai Mumbai 0
784 entries
there are 784 cities each having link to other
Now i want my output as
Mumbai Delhi Banaras haryana
Mumbai 0 100 -- --
Delhi 100 0 50 --
Banaras
haryana
respective distance from one city to other should be shown
final Matrix would be 784*784
I am using SQL Query Analyser for this
Please help me in this regardI'm pretty much certain that you don't want to do this in pure SQL. So that means that you want to do it with a reporting tool. I'm not familiar with SQL Query Analyzer, but if it is in fact a reporting tool you'll want to consult its documentation looking for the terms "pivot" or perhaps "cross tab."
-
How to capture user input for customer exit processing?
I need to calculate the number of working days elapsed in the current fiscal quarter BASED on the USER INPUT on the reporting front. i.e., say the fiscal quarter started on 1 July 2005 and if the user enters 10 July 2005, I should get the value 8 (Assume that Monday through Friday are all workdays). If the user enters 12 July 2005, I should get 10. I have written customer exits and know how to use factory calendar, but <b>THE CHALLENGE</b> is how do I <b>CAPTURE</b> the user input and use it in my exit? During the varible definition, if I select the check box "Ready for input" then the customer exit is not being processed and unless I check that box I can't get a user entry! If I look at the import values in the customer exit, I see i_t_var_range with type rrs0_t_var_range. My strong feeling is that this parameter gets the user input, but I am unable to use it as the customer exit is not being called if I make the user to input the data. Based on the empirical evidence, I felt that user input and customer exit can not co-exist!! Please somebody prove me wrong and let me know how can I use the user input to process my "customer-exit" variable. I would really appreciate any input from the BW community here.
Hi Sameer,
Most likely, I'm missing something, but I think that the answer is very simple.
CASE I_VNAM.
WHEN 'YOUR_CUSTOMER_EXIT_VAR'.
IF I_STEP = 2. After selecting of input variable
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'USER_INPUT_VAR'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
ENDCASE.
In this typical user exit coding you have a user entered value in LOC_VAR_RANGE (originally in I_T_VAR_RANGE) and you construct your user exit variable value in E_T_RANGE.
Best regards,
Eugene
Message was edited by: Eugene Khusainov -
How to connect, add delete and modify sqllite data base.
dear friends,
i am developing a stand alone project, in that i want to
store the datas in the local machine using sql lite. Iam new to
Flex. i know air and flash very well.. any body can help me, how to
connect, add, delete and modify the data in sql lite. i want to
store users option in local machine.. i got struct up. i have to
finish my project...pls..
thanks and Regards,
Syed Abdul RahimHi,
Please find details on how to access SQL Lite database from
AIR applications at the URL below.
http://livedocs.adobe.com/flex/3/html/SQL_01.html
Hope this helps. -
How to use Pl/sql block to edit check user input
Hi,
Please advise on PL/SQL Block code that could be used to Check User input from within a Loop and proceed conditionally based upon User Supplied compliant Input. Thanks in advance.Hi,
yakub21 wrote:
You could use the ACCEPT to get user input and then assign the input to a variable that could then be verified.
I believe that anything is possible because we don't yet have proof that it is not!
I do have code that can accept user input. Is it PL/SQL code? Sybrand was clearly talking about PL/SQL:
sybrand_b wrote:
Pl/sql is for server side code, it is not a front end tool, and it is incapable of the functionality you describe.If you do have PL/SQL code that accepts user input, please post an example. A lot of people, including me, would be very interested.
Pass the user-input value to a variable and then assign that value to another variable from within a Declare of a PL/SQL Block.
The opportunity here is to figure a way to loop with user input until desired input is entered by the user before proceeding with the code. I'm using PL/SQL Block because I don't want the code to persist. I just want to run it as part of database configuration procedure. ThanksIt sounds like you're talking about SQL*Plus, which is a very poor tool for looping or branching.
It's possible, but it's not pretty. The following thread shows one way of looping in SQL*Plus:
Re: How to give the different values to runtime parameters in a loop?
Maybe you are looking for
-
Code could not be generated because an external component or driver is missing
Greetings All, I've using Labview for a little over a year and I have an interesting situation with regards to Labview that I came across today. When I left off yesterday (01/11/12) my TestStand sequence was compiling fine. Today for some reas
-
Is it possible to put a hard limit on how much CPU is used by JavaScript execution?
Even today, there are tons of Web pages with JavaScripts on them that seem to peg the CPU usage. Usually, the browser will completely freeze for a while (15 seconds, and it won't respond to clicks whatsoever - the only thing possible during that time
-
Warning: Don't use Time Machine to backup disk containing existing TM backup files
I ran into a problem while starting a clean TM backup on a new hard drive. I found the solution on this board and wanted to do a clean post of it in case it might help someone else. A few months ago, I had got a new external to put my Aperture refer
-
Hello, I am creating a gui with various swing objects. I put a grouping of various objects within some panels as to allow for simpler layout. The problem however is spaning a jpanel over 2 rows. basically i want one panel on the left that spans 2 row
-
When I try to activate the Read Out Loud function in the Adobe Reader the software closes. Does anyone know how to get this fixed. I am currently using 9.3.2 and it still does not work. My operating system is Windows Vista.