If your considering copy and pasting your latest drive by spam here because you cant find any other place.
DONT!
Oprano has a ZERO tolerance policy for spam. Yours WILL be deleted. If you are looking for more exposure for your product please contact advertising@oprano.com for more information.
Legacy Archived Main BoardBusiness chat and general industry chat. All participation is welcome. Dont post your fucking spam here.
Originally posted by sarettah@Oct 24 2003, 12:49 AM What is the logical output from this code snippet....... (language is VFP but should be fairly discernible to anyone who has read code before.....)
procedure brandon
parameter username, password
clear
if empty(username)
username='opranaut'
endif
if empty(password)
password='intelligent'
endif
sqlport=sqlconnect('brandon',usernam,password)
sql_str='select * from brandon_master order by value'
&sql_str
*********************************************
clue:
brandon_master looks like this:
Property value
-------------------
age ???
shoesize ???
iq ???
Originally posted by sarettah@Oct 23 2003, 05:49 AM What is the logical output from this code snippet....... (language is VFP but should be fairly discernible to anyone who has read code before.....)
...
sqlport=sqlconnect('brandon',usernam,password)
sql_str='select * from brandon_master order by value'
&sql_str
No output, because you didn't send your SQL query to some function like sqlquery()
Or was the "&sql_str" meant to imply it was executing a query with that string?
The query would be returned as an array, so unless you're wanting the error code for trying to display an array you'll need to split that sucker up and then print it.
But I would suspect a return ordered by value would be Brand0n's age > shoesize > IQ.
edit: had to make that clearer
Last edited by Carrie at Oct 23 2003, 12:27 PM
__________________
Need a kick-ass design done quickly?
I recommend Sex Creator - they absolutely ROCK.
Originally posted by Carrie@Oct 23 2003, 12:25 PM The query would be returned as an array, so unless you're wanting the error code for trying to display an array you'll need to split that sucker up and then print it.
But I would suspect a return ordered by value would be Brand0n's age > shoesize > IQ.
edit: had to make that clearer
nopers
=sqlexec(sqlport,sql_str,'Temptable')
returns a cursor called temptable
that is the vfp sql execution routine.....
and you return results are obviously in descending order
actual return would be iq, shoesize, then age.........
I'm surprised the board didn't smack you for having a post that long!
You're right, my results are DESC and you didn't specify an ORDER BY, but you know darn well I'm a phper and in that language, you'd get an array error.
(Unless you previously specified a dbquery function that would do key->value splits, methinks.)
Bah. Either way you work it, his age has a higher value than his IQ, and being that he was born in '74, that doesn't bode well for him!
Last edited by Carrie at Oct 23 2003, 12:43 PM
__________________
Need a kick-ass design done quickly?
I recommend Sex Creator - they absolutely ROCK.
Originally posted by brand0n@Oct 24 2003, 06:23 AM
that code wouldnt work, 30 run would never be seen do to the loop 20 makes, and to save you some time print = "?"
In Spectrum +3 Basic it would work. And the "?" substitution for print, would not. I did say it was for the Spectrum.