-
1. Re: Prompt order for multiple bind variables
BluShadow Jun 15, 2018 9:31 AM (in response to Notorious)Well, firstly I'll point you at this community document: PL/SQL 101 : Substitution vs. Bind Variables which may help to answer your question.
Nextly, I'll point out that you're asking a product question in the Getting Started space. Whilst this space is great for introducing yourself and getting to know how to use the community, you should really post product questions in the product related spaces, so you can get the question in front of the experts for those products.
In this case, I'll move your question over to the SQL and PL/SQL space.
-
2. Re: Prompt order for multiple bind variables
Jarkko Turpeinen Jun 15, 2018 9:42 AM (in response to Notorious) -
3. Re: Prompt order for multiple bind variables
Etbin Jun 15, 2018 11:39 AM (in response to Notorious) -
4. Re: Prompt order for multiple bind variables
Notorious Jun 15, 2018 12:01 PM (in response to BluShadow)I appreciate the assistance BluShadow. As a brand new user, I was having difficulty finding a space I had access to post to.
-
5. Re: Prompt order for multiple bind variables
Notorious Jun 15, 2018 12:02 PM (in response to Jarkko Turpeinen)Hi Jarkko. I am using SQL Developer 3.2.10.09.
-
6. Re: Prompt order for multiple bind variables
Notorious Jun 15, 2018 12:05 PM (in response to Etbin) -
7. Re: Prompt order for multiple bind variables
The Real Rob the Relic Jun 15, 2018 12:11 PM (in response to Notorious)Could you post examples of the bind variable prompting along with why the order is an issue.
Have you tried pre-prompting for the values e.g.
accept bind_value1 prompt "Enter value for bind_value1 : "
select '&bind_value1' from dual;
EDIT: Looking back at Etbin's post, maybe I've misunderstood the issue
-
8. Re: Prompt order for multiple bind variables
Notorious Jun 15, 2018 12:46 PM (in response to The Real Rob the Relic) -
9. Re: Prompt order for multiple bind variables
The Real Rob the Relic Jun 15, 2018 12:55 PM (in response to Notorious)Hmm, do they maybe appear in the following order?
Reference order within where clause, then reference order within select clause?
-
10. Re: Prompt order for multiple bind variables
Notorious Jun 15, 2018 1:21 PM (in response to The Real Rob the Relic)I don't think so. Because if you remove the where clause, they still appear in the same order, which isn't the select clause order.
-
11. Re: Prompt order for multiple bind variables
The Real Rob the Relic Jun 15, 2018 1:29 PM (in response to Notorious)I'm sure there's a logical methodology behind the order Oracle prompts for the values, just maybe not one mere mortals can identify
-
12. Re: Prompt order for multiple bind variables
Jarkko Turpeinen Jun 15, 2018 1:32 PM (in response to Notorious)Notorious wrote:
Hi Jarkko. I am using SQL Developer 3.2.10.09.
Okay, why you care about order?
-
13. Re: Prompt order for multiple bind variables
Notorious Jun 15, 2018 1:33 PM (in response to The Real Rob the Relic)That's my take. I just wish I knew what it was so that maybe I could manipulate the naming or use of my variables in such a way that they would appear in the order that makes the most sense. It can get a little more chaotic as the number of variables increases.
-
14. Re: Prompt order for multiple bind variables
Jarkko Turpeinen Jun 15, 2018 1:43 PM (in response to Notorious)Notorious wrote:
That's my take. I just wish I knew what it was so that maybe I could manipulate the naming or use of my variables in such a way that they would appear in the order that makes the most sense. It can get a little more chaotic as the number of variables increases.
Bind variables are not intended for user interaction. Don't try to force them to serve as user interaction. Substitute variables in Sql*plus got accept and prompt for user interaction.
https://docs.oracle.com/database/121/SQPUG/ch_twelve005.htm#SQPUG026
ACCEPT
ACC[EPT] variable [NUM[BER] | CHAR | DATE | BINARY_FLOAT | BINARY_DOUBLE] [FOR[MAT] format] [DEF[AULT] default] [PROMPT text|NOPR[OMPT]] [HIDE]
Reads a line of input and stores it in a given substitution variable.
...
PROMPT text
Displays text on-screen before accepting the value of variable from the user.
PROMPT
PRO[MPT] [text]
where text represents the text of the message you want to display.
Sends the specified message or a blank line to the user's screen. If you omit text, PROMPT displays a blank line on the user's screen.