Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Fetching the records from schema based on size

Avatar

Avatar
Validate 1
Level 2
jitendrat766521
Level 2

Likes

2 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
jitendrat766521
Level 2

Likes

2 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
jitendrat766521
Level 2

03-08-2018

Hi Team,

I want to retrieve the records based on size from schema in adobe campaign...so how to implement this one in Adobe campaign.

For Example:

if schema having 100 records then i need to select 20 records only from 100 recors

And next time i need to  retrive from 20 to 40 records and next ineed to retrive the records from 40 to so...

So how to achieve this ...please help me on this..

Regards

Jitendra

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

369 likes

Total Posts

726 posts

Correct Reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

369 likes

Total Posts

726 posts

Correct Reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Vapsy
Employee

07-08-2018

Hi jitendrat76652144,

There is a second queryDef in this code which you have completely skipped 1543516_pastedImage_1.png

Without this, your while loop code will run into an infinite loop.

Regards,
Vipul

Avatar

Avatar
Validate 1
Level 2
jitendrat766521
Level 2

Likes

2 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
jitendrat766521
Level 2

Likes

2 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
jitendrat766521
Level 2

06-08-2018

Hi Vipul,

Thank you for your response,I am not able to fetch the any records from schema by using below  code.Please help me on this if anything i am doing wrong.

1543062_pastedImage_0.png

Schema Data:

1542895_pastedImage_4.png

Avatar

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

369 likes

Total Posts

726 posts

Correct Reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

369 likes

Total Posts

726 posts

Correct Reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Vapsy
Employee

04-08-2018

Hi Jitendra,

You can try this code in a JS activity

var recordsToFetchPerBatch = 20; 

var currentStartLine = 0;

var query = xtk.queryDef.create(

  <queryDef schema="cus:mySchema" operation="select" lineCount={recordsToFetchPerBatch} startLine={currentStartLine}>

    <select>

      <node expr="@id"/>   

    </select>

  </queryDef>);

var result = query.ExecuteQuery();

try

{

while (result != "")

 

for each (var record in result)

{

currentStartLine++;

           

//do your stuff

     

} // end for

query = xtk.queryDef.create(

<queryDef schema="cus:mySchema" operation="select" lineCount={recordsToFetchPerBatch} startLine={currentStartLine}>

<select>

  <node expr="@id"/>   

</select>

  </queryDef>);

var result = query.ExecuteQuery();

} // end while

}

catch (e)

{

  logError("*** FAILED ***");

}

Regards,
Vipul