![]() |
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 ??? Last edited by sarettah at Oct 23 2003, 08:58 AM |
Quote:
|
Quote:
Or was the "&sql_str" meant to imply it was executing a query with that string? |
Quote:
Or was the "&sql_str" meant to imply it was executing a query with that string?[/b][/quote] lololol............ damn you are good............. in vfp the '&' means evaluate... So if it had been a local table then it would have executed.... since the whole sqlconnect( was to open a remote table (sqlserver or oracle), I indicated that it was a remote db I was calling from... So you are right... absolutely nothing would conme out except an error message abou the table not existing :) so lessee... we would have to add something like: =sqlexec(sqlport,sql_str,'Temptable') to actually get our return.... :yowsa: It was a dumb joke anyway that got worse when my original entry got screwed up when I hit a [tab] and then an [enter] so the post was only a quarter complete.... :blink: |
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 |
LOST!!!!
:blink: :huh: :unsure: :wacko: |
Quote:
=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......... it would default to ascending :yowsa: |
Quote:
here, try this one: endwith return |
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! :nyanya: Last edited by Carrie at Oct 23 2003, 12:43 PM |
sarettaH,
No offense, but that whole thing looks just like one of brand0n's posts. :P Last edited by voodooman at Oct 23 2003, 11:54 AM |
I was going to quote you Sarettah but that would have made this the longest thread ever with the fewest posts :D
I'm guessing something to do with times/dates and mail? |
Quote:
That a damn good one :wnw: |
my cat's breath smells like cat food.
|
Quote:
;-))) |
10 ? "fuckyou"
20 goto 10 an "end" statement isnt needed due to the loop |
Quote:
every time i'd go into a store that had a TI computer i'd type that in and then go find the toy department to look for star wars stuff. |
Quote:
:yowsa: |
Quote:
10 print "I sale good code" 20 goto 10 30 run ;) |
Quote:
10 print "I sale good code" 20 goto 10 30 run ;)[/b][/quote] that code wouldnt work, 30 run would never be seen do to the loop 20 makes, and to save you some time print = "?" |
Quote:
|
Quote:
Ahh the ZX Spectrum 48k my first love :inlove: :okthumb: |
GOTO s ????
:barfon: :barfon: :barfon: :barfon: |
Quote:
|
Geekiest Thread on Oprano Award!! :nyanya:
|
Quote:
|
Quote:
ahh you like that do ya? so does this mean we should kiss n make up? |
| All times are GMT -4. The time now is 02:24 PM.. |
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright Evil Empire Inc. 2006-2022