Topic Options
#57199 - 08/22/19 05:28 AM local variable grab data from database
acezizy Offline
OL Newbie

Registered: 06/12/19
Posts: 6
Hi PlanetPress User!

i have a query regarding on how can i read a data from database and place it into one of local variable in the process.

i do come to both of there ticket(refer below link).

Using PlanetPress Database Action to Get Data

Sample for database output

but i still don't get it on how to place the data that already grab from the database and put it into local variable.

i hope someone who familiar with this can explain to me.

thanks in advance. laugh

#57201 - 08/23/19 03:17 PM Re: local variable grab data from database [Re: acezizy]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4954
Loc: Objectif Lune Montreal
Hi acezizy,

In my example that you linked(Sample for database output), I do explain what to do after you run the SQL to put it in a variable:


It will put it into a "PlanetPress Database" format, so you'll need to switch the emulation to Database. Then you could store the client's email into a variable, using the Set Job Info and Variable, and set it to this: field(1,0,0,'EMAIL',KeepCase,NoTrim)

In other words, after your PlanetPress Database action, you add a Set Job Info and Variable action, you choose your variable, and you use the "field" command to extract from a field. In the example, the field was EMAIL, but feel free to replace it by any other field name.

Hope that helps! If not, feel free to contact Technical Support, they should be able to show you how to extract data from a database, and store it in a variable.

Raphaƫl Lalonde-Lefebvre

#57203 - 08/25/19 10:51 PM Re: local variable grab data from database [Re: acezizy]
acezizy Offline
OL Newbie

Registered: 06/12/19
Posts: 6
Dear Raphael,

thanks a lot! i read that quite a few time in that other ticket but still don't understand but after your explanation, i fully understand it. that solve my problem.