Re: multi line Livecode field uploaded to MySQL
> Le 16 févr. 2019 à 07:59, Tim Selander via use-livecode > a écrit : > > I have a routine to take data from fields on a card and upload to a mysql > database. Has worked well for years, got the original script off the Livecode > learning site. > --- > # Construct SQL > put "INSERT INTO > podcast(IP,accesstime,access_date,pgm_name,access_code,bytes,agent,city,region,country)" > & \ > " VALUES(" & tRowData & ")" into tSQL > # Execute SQL > put revdb_execute(gconnection,tSQL) into tTmp > > if the result is not 1 then > put the result && tSQL & return after message > end if > - > > tRowData has the data from the card fields, comma delimited. > > Now, I'm needing to upload fields with multiple lines. But the returns in the > data mess it up. Tried enclosing the field data in quotes, like .csv files, > but that didn't work either. > > MySQL can handle multi-line text fields so how do I upload them from LC? > Any hints greatly appreciated. > Hello, use this syntax : put "INSERT INTO podcast(IP,accesstime,access_date,pgm_name,access_code,bytes,agent,city,region,country)" & \ " VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9)" into tSQL # Execute SQL revExecuteSQL gconnection,tSQL,"IP","accesstime","access_date","pgm_name","access_code","bytes","agent","city","region », "country ») put the result into tTmp // where IP, accesstime… are variables Ludovic ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
multi line Livecode field uploaded to MySQL
I have a routine to take data from fields on a card and upload to a mysql database. Has worked well for years, got the original script off the Livecode learning site. --- # Construct SQL put "INSERT INTO podcast(IP,accesstime,access_date,pgm_name,access_code,bytes,agent,city,region,country)" & \ " VALUES(" & tRowData & ")" into tSQL # Execute SQL put revdb_execute(gconnection,tSQL) into tTmp if the result is not 1 then put the result && tSQL & return after message end if - tRowData has the data from the card fields, comma delimited. Now, I'm needing to upload fields with multiple lines. But the returns in the data mess it up. Tried enclosing the field data in quotes, like .csv files, but that didn't work either. MySQL can handle multi-line text fields so how do I upload them from LC? Any hints greatly appreciated. Tim Selander Tokyo ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Need crash course in Dropbox library
under the documentation for dropboxUpload, it states it shouldn't be used for files larger than 150MB, the video files will all be around 800MB I've been looking through the stack, but cannot find the answers I am looking for. SO I am still not clear how I should get my file into pData and pData is just a chunk of the data? How do I make that chunk out of the whole and where do I get pOffset from? Matthias Rebbe via use-livecode wrote > Hey, pink, thanks for the clarification. > First of all, is there a reason why you are doing it this way instead of > using dropboxUpload? If you use dropboxUpload you can do it all in one > shot. > Gerard's stack explains the process and how to use the various commands > Doing it the way you are doing it, you would start with sessionStart and > then you would repeatedly call sessionAppend > pOffset is the length of what you have already sent because there are no > guarantees that dropbox will get your file stream in order, so if it gets > them out of order and pData isn't the same length for each call to append, > the only way dropbox knows where to put the data it just received is if > you > tell it where to put it. > pData should be at most 150mb per call. > ___ > use-livecode mailing list > use-livecode@.runrev > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode - --- Greg (pink) Miller mad, pink and dangerous to code -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Need crash course in Dropbox library
Hey, pink, thanks for the clarification. First of all, is there a reason why you are doing it this way instead of using dropboxUpload? If you use dropboxUpload you can do it all in one shot. Gerard's stack explains the process and how to use the various commands Doing it the way you are doing it, you would start with sessionStart and then you would repeatedly call sessionAppend pOffset is the length of what you have already sent because there are no guarantees that dropbox will get your file stream in order, so if it gets them out of order and pData isn't the same length for each call to append, the only way dropbox knows where to put the data it just received is if you tell it where to put it. pData should be at most 150mb per call. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Need crash course in Dropbox library
Unfortunately, looking at the other library isn't making things clearer... Let me get more specific, here are the main commands I'm trying to learn: dropboxUploadSessionStart pAccessToken, pData dropboxUploadSessionAppend pAccessToken, pSession, pOffset, pData dropboxUploadSessionFinish pAccessToken, pSession, pOffset, pPath, pMode, pAutorename, pMute, pData I understand how to get the access token, and how to get the sessionID but... 1. what do I put into pData? I assume pData is the file I am supposed to be uploading, but how do I put it in there? do I just open file, then read from file and then put it into pData? 2. do i just use the same value for pData in all commands? 3. Where do I get the pOffset value? 4. Do I control how much data is sent with each request? If so, how? If not, how do I know how many append sessions to use before I send the finish? Matthias Rebbe via use-livecode wrote > Then I would suggest > Grab Gerard's LC dropbox v2 goodies that are at > https://github.com/macMikey/dropboxapi_v2 > The LC dropbox library was "inspired by" Gerard's library. The command > names are different, but I'm pretty sure it's one-to-one and I'm pretty > sure the syntax is identical. Where it isn't (or where a return value > didn't correlate) I'm pretty sure I submitted PR's to LC's library to fix > theirs, and I'm pretty sure all the PR's have been integrated. > One thing that is different/better with LC's library is that LC's library > adds optional support for asynchronous calls if you have one of the > not-free LC versions. > Gerard's library also has a tester built in, which is helpful for > debugging > purposes. When you have the syntax right, switch the calls to the LC > library. > If you still need help check back here and we'll see what else you might > need. > > On Thu, Feb 14, 2019 at 8:24 PM pink via use-livecode < > use-livecode@.runrev >> wrote: > >> was planning on using the LC Dropbox library >> >> >> >> - >> --- >> Greg (pink) Miller >> mad, pink and dangerous to code >> -- >> Sent from: >> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html >> >> ___ >> use-livecode mailing list >> > use-livecode@.runrev >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode >> > > > -- > On the first day, God created the heavens and the Earth > On the second day, God created the oceans. > On the third day, God put the animals on hold for a few hours, >and did a little diving. > And God said, "This is good." > ___ > use-livecode mailing list > use-livecode@.runrev > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode - --- Greg (pink) Miller mad, pink and dangerous to code -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Standalone builder tells me that there is a stack ... already open and so on
I just had an, "AHA!" moment. Bob S > On Feb 14, 2019, at 10:15 , Richard Gaskin via use-livecode > wrote: > > The example there is uses two paths that differ based on the Unix shortcut of > "~" for the user's home folder, e.g.: > > /home/matthias/workfolder/somestack.livecode > > ...vs: > > ~/workfolder/somestack.livecode > > Both paths refer to the same file system object, but apparently the engine > maintains its handle to the file based on the given path rather than the > fully resolved path, so it believes those are two different files in which > the stack objects happen to have the same name. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Need crash course in Dropbox library
Then I would suggest Grab Gerard's LC dropbox v2 goodies that are at https://github.com/macMikey/dropboxapi_v2 The LC dropbox library was "inspired by" Gerard's library. The command names are different, but I'm pretty sure it's one-to-one and I'm pretty sure the syntax is identical. Where it isn't (or where a return value didn't correlate) I'm pretty sure I submitted PR's to LC's library to fix theirs, and I'm pretty sure all the PR's have been integrated. One thing that is different/better with LC's library is that LC's library adds optional support for asynchronous calls if you have one of the not-free LC versions. Gerard's library also has a tester built in, which is helpful for debugging purposes. When you have the syntax right, switch the calls to the LC library. If you still need help check back here and we'll see what else you might need. On Thu, Feb 14, 2019 at 8:24 PM pink via use-livecode < use-livecode@lists.runrev.com> wrote: > was planning on using the LC Dropbox library > > > > - > --- > Greg (pink) Miller > mad, pink and dangerous to code > -- > Sent from: > http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > -- On the first day, God created the heavens and the Earth On the second day, God created the oceans. On the third day, God put the animals on hold for a few hours, and did a little diving. And God said, "This is good." ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode