AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

I want to save select query data to a variable.
 
 

Hello, I’m a Korean developer.

I want to save ‘select’ query data to a variable.

For example,
Select age from student where id = 2;

—result—
age |
20   |

I have to store ‘20’ values in variables and use it.
I use Postgresql.

Please help me with my problem.

 

 
  [ # 1 ]

if you have to save 20 values, you need to save in facts, either via ^createfact OR better as a JSON array using ^jsoncreate and ^jsonarrayinsert

 

 
  [ # 2 ]

If you are just saving it to a variable as a single value, do you know what variable you want to store it on?

IS your issue the 20 |  form of the answer, in which case you could ^burst($_pganswer ” |”)

 

 
  [ # 3 ]
Bruce Wilcox - Jan 24, 2018:

If you are just saving it to a variable as a single value, do you know what variable you want to store it on?

IS your issue the 20 |  form of the answer, in which case you could ^burst($_pganswer ” |”)

I put the query results into variables.
I want to calculate variables.

i have to the pull in the variable to convert.
And, Using variable, modify values.


Thanks to you, I have a lot of studying.

 

 
  [ # 4 ]

Can I write the script as shown below?

^burst($_pganswer ”select qa_content from bot_qa where qa_num=3;”)

 

 
  login or register to react