Unibasic EVAL explained with full demo | Must use EVAL in your Uniquery | Unibasic Programming

Опубликовано: 19 Октябрь 2024
на канале: Technical Lab
698
40

In this tutorial, we are going to see a full demo on using EVAL in your uniquery. Eval is very useful tool if you use it in your unibasic statements.
You can also accept input for a column right from uniquery using EVAL.
EVAL
The UniQuery EVAL keyword allows you to define a virtual
attribute expression for the current execution of a UniQuery
statement only. expression can be any expression valid in a
virtual attribute. You must enclose expression in single or
double quotation marks.

Note: UniQuery only supports the EVAL keyword in ECLTYPE U.

1. PUT A CONDITION ON A COLUMN
EVAL 'IF COUNTRY = USA THEN CITY ELSE FOREIGN'
2. ADD THE VALUES FROM 2 COLUMNS
EVAL 'FNAME:" ":LNAME"
3. GIVE COLUMN HEADER A NAME
LIST CLIENTS PHONE_NUM PHONE_TYPE EVAL 'LEN(PHONE_NUM)' COL.HDG 'LENGTH'
EG
LIST CLIENTS FNAME LNAME EVAL 'FNAME:" ":LNAME' COL.HDG "FULLNAME"

LIST CLIENTS PHONE_NUM PHONE_TYPE EVAL 'IF LEN(PHONE_NUM) lt 22 THEN LEN(PHONE_NUM)
ELSE INVALID' COL.HDG 'VALID LEN'
4. ACCEPT COLUMN VALUE AS INPUT
LIST CLIENTS NAME CITY ADDRESS WITH CITY=EVAL 'Which city? '
5. CONVERT A VALUE AND SHOW USING EVAL
6. USE EVAL INTO YOUR VOC.
Please subscribe to my youtube channel for such tutorials

Please watch the split a file by line number here:
   • Split utility in Linux/Unix : to brea...  

Split utility in Linux/Unix : to break huge file into small pieces
   • Split utility in Linux/Unix : to brea...  

How to keep sessions alive in terminal/putty infinitely in linux/unix : Useful tips
   • How to keep sessions alive in termina...  

Random value generator and shuffling in python
   • Random value generator and shuffling ...  

Intro to class in python
   • Introduction to Class in python  

Lists, tuples, dictionary in python
   • Introduction to Lists, tuples and dic...  

Python basic tutorial for beginners
   • Python basics tutorial for beginners  

Python basics tutorial for beginners part 2 -variables in python
   • Python basics tutorial for beginners ...  


Vi editor basic to advance part 1
   • VI editor basic to advanced : Part 1  

Vi editor basic to advance part 2
   • VI editor basic to advanced tutorial ...  

Keyboard remapping in linux, switching keys as per your own choice
   • Keyboard remapping in linux, switchin...  

How to install/open an on sceen keyboard in Linux/Unix system
   • How to install/open an on sceen keybo...  

Python IDE for windows , linux and mac OS
   • Python IDE for windows , linux and ma...  

How to record screen or sessions in Linux/Unix
   • How to record screen or sessions in L...  

How to download and install PAGE GUI builder for python
   • How to download and install PAGE GUI ...  

Create a basic Login page in python using GUI builder PAGE
   • Create a basic Login page in python u...  

Working with RadioButton in python in PAGE builder
   • Working with RadioButton in python in...  

Basic program on Multithreading in python using thread module
   • Basic program on Multithreading in py...