1

Topic: The user functions MYSQL

Hello! I only started to study MYSQL. I transport stored procedures Interbase on MYSQL. Version MYSQL 2008.
Here code  Interbase -
for
SELECT field FROM table where pr=1 into:out_field
do begin
select * from vibor_smen (:out_f1:out_f2:out_f3,855) into:out_p1;
select * from vibor_smen (:out_f1:out_f2:out_f3,854) into:vr_854;
select * from vibor_smen (:out_f1:out_f2:out_f3, 852) into:vr_852;
select * from vibor_smen (:out_f1:out_f2:out_f3,856) into:vr_856;
vibor_smen Is another  Interbase.
Here its code -
if (in_kod> 1) then begin
out_time=0;
for
select f1, f2 from table where kod =:in_kod and f10 =:in_f and
vrem_b> =:in_d1 and vrem_b <=:in_d2 into out_t1, out_t2
do begin
if (out_t2 is null) then out_t2=in_d2;
out_time=out_time + (out_t2-out_t1);
end
end
Question, it is possible-whether in MYSQL to make the similar? On the second piece made scalar function. And here is how with the first piece to be, I do not know. Not to offer, eat cursors on that the reason. In advance, thanks for the help.

2

Re: The user functions MYSQL

Only the beginnings a, and at once not in that section came.
Here the correct: MySQL

3

Re: The user functions MYSQL

eclipse170790 wrote:

Version MYSQL 2008.

Perhaps MS SQL 2008? And that at MySQL is not present such version - and a forum branch under it another...

eclipse170790 wrote:

not to offer, eat Cursors on that the reason.

So FOR SELECT... DO in the source code - same the pure cursor. Only the implicit. Perhaps acquaint with the reasons?

4

Re: The user functions MYSQL

Precisely, was mistaken.

5

Re: The user functions MYSQL

Akina, slowly work.

6

Re: The user functions MYSQL

Itself it was tangled also you I confuse.

7

Re: The user functions MYSQL

eclipse170790 wrote:

slowly work.

Well then use, for example, temporary tables.

eclipse170790 wrote:

the Question, it is possible-whether in MYSQL to make the similar?

without looking At all that there it has been made in  - it is possible.

eclipse170790 wrote:

as with the first piece to be, I do not know.

do not try  the code. Understand the logician and write anew, but already with the registration of singularities of dialect MS SQL.

8

Re: The user functions MYSQL

eclipse170790 wrote:

And here is how with the first piece to be, I do not know.

to Understand that it does, and to rewrite the code.

eclipse170790 wrote:

On the second piece made scalar function.

it is better so not to do, will be slowly.
Either uncover the code, or make inlajn-function.