Jump to content
Larry Ullman's Book Forums
Peter77

Convert Vfp Script Tp Stored Procedure?

Recommended Posts

I'm begging here. Below is a Visual Fox Pro script (just part of it actually). Anyway, I can't for the life of me figure out to get this to work in MySql. This would be run daily against a 100K+ records. The part of it that is tricky (for me) is setting the variable value, since the record order is critical to the script (the data is imported daily from another ancient program). I tried setting the variable within an UPDATE query, but I can't get it to work. I assume that this should be in a procedure? Can some MySQL luminary give this a stab?

 

PUBLIC m.bldtype,cpart

m.bldtype='BLD'

cpart=ALLTRIM(PART)

GO TOP

 

DO WHILE !EOF()

IF cpart<>PART

cpart=PART

m.bldtype='BLD'

ENDIF

IF bnote='***********' AND SUBSTR(bpart,1,3)='EAR' AND m.bldtype<>'EAR'

m.bldtype='EAR'

ENDIF

IF bnote='***********' AND SUBSTR(bpart,1,3)='KIT' AND m.bldtype<>'KIT'

m.bldtype='KIT'

ENDIF

IF bnote='***********' AND m.bldtype='KIT' AND EMPTY(bpart) AND m.bldtype<>'MISC'

m.bldtype=''

ENDif

 

DO CASE

CASE m.bldtype='BLD'

REPLACE bldtype WITH 'BLD'

CASE m.bldtype='EAR'

REPLACE bldtype WITH 'EAR'

CASE m.bldtype='KIT'

REPLACE bldtype WITH 'KIT'

ENDCASE

SKIP

ENDDO

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...