For loop mysql procedures


 
Thread Tools Search this Thread
Top Forums Programming For loop mysql procedures
# 1  
Old 09-12-2016
For loop mysql procedures

Hi Forum

how can I make for loop or while loop as below, in mysql language

Code:
for i in (1, 2, 4, 6, 9)
do

......

done

similar to unix...
# 2  
Old 09-12-2016
Hello yahyaaa ,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • Does this need to be with a single mysql call, or would you be okay to loop in the shell calling mysql multiple times?
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.


Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Programming

Loop in bash file for mysql

Hi, I'm having problems with a script which some of you helped me with last week. It's a script to check the status of orders in an SQL database, and if the count(*) is zero, then the script stops. If it's non-zero, the script echos the result to a file and then in cron, I cat the file and mail... (3 Replies)
Discussion started by: davidm123SED
3 Replies

2. Debian

Procedures in the #apt commands.

I have installed squeeze 6.0.0 as a base install from: Network install from a minimal CD. Debian -- Network install from a minimal CD i do see a lot of information on the various #apt commands , yet is is all garble goop as far as trying to make sense of where to begin at to install... (3 Replies)
Discussion started by: cowLips
3 Replies

3. Shell Programming and Scripting

calling two procedures from one ksh ???

Hi to all, This is first posting in this forum. I quite new to this KSH....i guess i ll have some fun...:) Well, I have two indivdual korn shell scripts. i m calling PL/SQL stored procedure from korn shell script. It works absolutely fine. Once its completed the log is updated and data is... (5 Replies)
Discussion started by: shashi369
5 Replies

4. Shell Programming and Scripting

Needed help in understanding these procedures?

Hi all, i needed some help in understanding a few procedures and how exactly is the sequence? FINISHED="Done" COLUMNS=$( stty -a | head -n 2 | cut -d " " -f2 |cut -d " " -f4 ) COLS=$((${COLUMNS} -${#FINISHED} - 5)) RET_ARR="\010" KILLLINE=${RET_ARR}${RET_ARR} for i in $(seq 1... (0 Replies)
Discussion started by: wrapster
0 Replies

5. UNIX for Dummies Questions & Answers

Stored Procedures

Dear friends, can anyone suggest links for online books on stored procedures in oracle. Cheers, (2 Replies)
Discussion started by: thumsup9
2 Replies

6. Shell Programming and Scripting

Procedures are not called ?

My shell script is executing i am having no syntax errors or other errors. When i am testing the shell script i am having a problem that the procedure Prompt, Environment,List are not found. I defined all these procedures in the shell script. Environment() { FULL=N export FULL LOGON=cat... (2 Replies)
Discussion started by: dreams5617
2 Replies
Login or Register to Ask a Question