1 Revision on Foxpro Commands Print command (?) e.g.? 6/2 * 3 9 SET DECIMAL TO integer e.g.SET DECIMAL TO 4 ? 2 / 3 0.6667 SET( ) function e.g.? SET (‘DECIMAL’)

Slides:



Advertisements
Similar presentations
N.G.Acharya & D.K.Marathe college Chembur-E, Mumbai-71
Advertisements

CC SQL Utilities.
Purpose : To convert this string to a new character array. Return Type : char[ ] Parameters : none Declaration : public char[ ] toCharArray() Returns.
Manipulating Strings String Functions. VB provides a large number of functions that facilitate working with strings. These are found in Microsoft.VisualBasic.Strings.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Strings.
Copyright © 2007, Oracle. All rights reserved Using Single-Row Functions to Customize Output Modified: October 21, 2014.
Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
PL/SQL.
Slide 1 VB Programming Fundamentals. Slide 2 Visual Basic Language v VB language is powerful and easy to use v Descendent of BASIC (Beginner's All-Purpose.
CS 3630 Database Design and Implementation. SQL Query Clause Select and From Select * From booking; select hotel_no, guest_no, room_no from booking; select.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
1 Pertemuan 04 Expression Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Databases Lab 5 Further Select Statements. Functions in SQL There are many types of functions provided. The ones that are used most are: –Date and Time.
Introduction to Oracle9i: SQL1 Selected Single-Row Functions.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
On to… string operations & functions. Concatenation (&) §When we want to combine two character strings into one new (longer) string, we can concatenate.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
Pasewark & Pasewark 1 Access Lesson 6 Integrating Access Microsoft Office 2007: Introductory.
Lecture 6 29/1/15. Number functions Number functions take numbers as input, change them, and output the results as numbers. 2.
Chapter 9 Creating Formulas that Manipulate Text Microsoft Office Excel 2003.
Strings PART II STRING$ AND SPACE$. Create strings of specified number String$ creates string of specified character Space$ creates string of spaces Example:
Access Level Three [Functions] & “ And “ & [Expressions]
Working with a Database
Manipulation Masterclass By the VB Gods. In this masterclass, we will learn how to use some of the string manipulation function such as Len, Right, Left,
Analyzing Data For Effective Decision Making Chapter 3.
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Chapter 5 Selected Single-Row Functions. Chapter Objectives  Use the UPPER, LOWER, and INITCAP functions to change the case of field values and character.
EPIB 698C Lecture 2 Notes Instructor: Raul Cruz 2/14/11 1.
 Agenda: 4/24/13 o External Data o Discuss data manipulation tools and functions o Discuss data import and linking in Excel o Sorting Data o Date and.
Oracle 11g: SQL Chapter 10 Selected Single-Row Functions.
Visual FoxPro Ch5 by CHANG YU 1 Chapter Five Index and Search The concept of index. Create, open and close index file. Type of index files. Set the master.
An Introduction to Java Programming and Object-Oriented Application Development Chapter 7 Characters, Strings, and Formatting.
SET DEFAULT Command Function: Specifies the default drive and directory. Syntax: SET DEFAULT TO [cPath]
Manipulating Strings. What is a string? Data composed of text characters. The data is stored in consecutive bytes of memory. Each byte stores the ASCII.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
Chapter 3 Selected Single-Row Functions and Advanced DML & DDL.
Guide to Oracle 10g ITBIS373 Database Development Lecture 4a - Chapter 4: Using SQL Queries to Insert, Update, Delete, and View Data.
A Guide to SQL, Seventh Edition. Objectives Understand how to use functions in queries Use the UPPER and LOWER functions with character data Use the ROUND.
Visual FoxPro Ch2 By CHANG YU1 Chapter Two Database Management Part one Database definition Record and Field Type of columns Expression.
EXPRESSION Transformation. Introduction ►Transformations help to transform the source data according to the requirements of target system and it ensures.
Operations on Strings. 8/8/2005 Copyright 2006, by the authors of these slides, and Ateneo de Manila University. All rights reserved L: String Manipulation.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
IFS Intro to Data Management Chapter 5 Getting More Than Simple Columns.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 13 File Input and.
Lecture 8 – SQL Joins – assemble new views from existing tables INNER JOIN’s The Cartesian Product Theta Joins and Equi-joins Self Joins Natural Join.
1 Creating and Maintaining Database Objects Part 1 Database Systems.
SQL Functions. SQL functions are built into Oracle Database and are available for use in various appropriate SQL statements. These functions are use full.
Last Week Modules Save functions to a file, e.g., filename.py The file filename.py is a module We can use the functions in filename.py by importing it.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
1 Inside Module 8 Extracting Data Page n Using the Extract command2 n Coercion3 n $-functions4 n Extract from a table7.
CHAPTER FOUR Performing Calculations and Manipulating Data: Expressions.
Sept 2001 cylauFoxpro Chapter 41 Chapter 4 Accessing Database Tables.
CSC 162 Visual Basic I Programming. String Functions LTrim( string ) –Removes leading spaces from the left side of string RTrim( string ) –Removes trailing.
3 A Guide to MySQL.
CS 3630 Database Design and Implementation
Open Source Server Side Scripting MySQL Functions
A Guide to SQL, Seventh Edition
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL
Introduction to Databases
Updating Records in a Table
CS 3630 Database Design and Implementation
SQL Text Manipulation Farrokh Alemi, Ph.D.
Chapter 2 Functions in Foxpro April 2003 cylau
VBScript Session 10.
CHAPTER 3: String And Numeric Data In Python
Inside Module 8 Extracting Data Page Using the Extract command 2
CSE 231 Lab 3.
MapInfo SQL String Functions
Introduction to SQL Server and the Structure Query Language
Presentation transcript:

1 Revision on Foxpro Commands Print command (?) e.g.? 6/2 * 3 9 SET DECIMAL TO integer e.g.SET DECIMAL TO 4 ? 2 / SET( ) function e.g.? SET (‘DECIMAL’) 4

2 SET FIXED ON|OFF e.g.SET DECIMAL TO 3 SET FIXED ON ? 3 * , -, *, /, ^, % mathematical operators e.g.? -7^ ? -14%4 or ? MOD(-14,4) 2

3 + concatenation, - concatenation e.g.? ‘Chan ‘ + ‘Tai ’ - ‘Man’ Chan TaiMan SET CENTURY ON|OFF e.g.? {12/20/1999} /19/00 SET CENTURY ON ? {12/20/1999} /19/2000

4 SET CENTURY TO e.g.SET CENTURY TO 19 ROLLOVER 50 SET CENTURY ON ? {12/24/20} 12/24/2020 ? {12/24/65} 12/24/1965 SET (‘CENTURY’) e.g.? SET (‘CENTURY’) ON

5 SET DATE TO (DMY|MDY|YM) DATE ( ) system date function e.g.SET DATE TO DMY ? DATE( ) 25/12/99 =, !=or<>or #,, =, = = relational operators SET EXACT ON|OFF e.g.? ‘123’ = ‘12’.T. ? ‘123’ = = ‘12’.F.

6 e.g.SET EXACT ON ? ‘123’ = ‘12’.F. SET (‘EXACT’) ON SUBSTRING ($) operator e.g.? ‘an’ $ ‘Chan’.T. e.g.STORE ‘Hello’ TO x ? x Hello

7 ?? Print Command e.g.? ‘Hello!’ ?? ‘Hi!’ ? ‘How are you?’ Hello!Hi! How are you? LEN ( ) ~ returns the number of characters e.g.? LEN(‘How are you?’) 12

8 UPPER ( ), LOWER ( ) e.g.? LOWER(‘Chan Tai Man’) chan tai man ? UPPER(‘Chan Tai Man’) CHAN TAI MAN SPACE ( ) e.g.? ‘Hello!’+SPACE(3)+’Hi!’ Hello! Hi!

9 LTRIM( ), RTRIM( ) / TRIM( ), ALLTRIM( ) e.g.X=‘ Hello! Hi! ’ ? LTRIM(X) Hello! Hi! (with trailing spaces) ? RTRIM(X) Hello! Hi! ? ALLTRIM(X) Hello! Hi! LEFT( ), RIGHT( ) e.g.? LEFT(RIGHT(‘How are you?’, 8), 3) are

10 SUBSTR( ) ~ returns specified numbers of characters e.g.? SUBSTR(‘How are you?’, 2, 4) ow a STUFF( ) ~ returns a string with certain replaced char e.g.? STUFF (‘How are you?’, 1, 3, ‘Who’) Who are you AT( ) e.g.? AT(‘o’,’How are you?’) 2

11 VAL( ) ~ converts string to numeric value e.g.? VAL(‘2’)+VAL(‘3’) 5.00 ? VAL(‘-1234E-3’) STR( ) ~ converts numeric value to string e.g.? STR( ,7,2) ? STR( ,3,2) ***

12 ASC( ), CHR( ) e.g.? ASC(‘APPLE’) 65 ? CHR(66) ‘B’ ROUND( ), INT( ) e.g.? ROUND( ,2) ? INT( ) 456

13 ABS( ) e.g.? ABS(-12.34) FLOOR( ), CEILING( ) e.g.? FLOOR (123.4) 123 ? CEILING(123.4) 124 ? CEILING(-123.4) -123

14 SQRT( ) e.g.? SQRT( ) DAY ( ), MONTH( ), YEAR( ) e.g.? DAY ({12/25/2000}) 25 ? MONTH({12/25/2000}) 12 ? YEAR({12/25/02}) 2002

15 DOW( ), CDOW( ), CMONTH( ) e.g.? DOW({01/01/2000}) 7 ? CDOW({01/01/2000}) Saturday ? CDOW({02/30/2000}) *bad date* ? CMONTH ({12/25/2000}) December

16 CTOD( ) ~ converts string to date expression e.g.? CTOD(‘02/29/2000’) 02/29/2000 DTOC( ) ~ converts date expression to string e.g.? DTOC ({12/25/2000}) 12/25/2000 IIF( ) function e.g.mark=65 ? IIF(mark>=50, ‘passed’, ‘failed’) passed

17 CREATE ~ create a table USE ~ open a table USE ~ close a table CLOSE DATABASES ~close all opened tables CLOSE ALL ~ close all tables and windows MODIFY STRUCTURE ~ design table structure SET DEFAULT TO SET PATH TO e.g.SET DEFAULT TO a: SET PATH TO a:\trading

18 LIST LIST FIELDS LIST FIELDS FOR LIST [FIELDS ……] [ FOR… …] [TO PRINT] BROWSE BROWSE FIELDS BROWSE FIELDS …… FOR BROWSE FIELDS…… FOR…… NOEDIT BROWSE [FIELDS [:R],…] [FOR…] [NOEDIT]

19 EDIT EDIT FIELDS EDIT FIELDS …… FOR EDIT [FIELDS [:R],…...] [FOR…...] DIR ~ view the names of tables DISPLAY STATUS GO/GOTO GOTO TOP, GOTO BOTTOM

20 BOF( ) & EOF( ) functions ~ check whether the record pointer is at the beginning or at the end e.g.GOTO TOP ? BOF( ).F. SKIP -1 ? BOF ( ).T. GOTO BOTTOM SKIP 1 ? EOF( ).T.

21 RECNO( ) ~ returns the record number of the current record RECCOUNT( ) ~ returns the total number of records SET FIELDS TO, … | ALL ~ restricts access to specified fields only e.g.SET FIELDS TO name, class, class_no SET FILTER TO ~ restricts access to specified rows only e.g.SET FILTER TO class=‘3A’ AND mark>0

22 REPLACE WITH,... ~ replace the data of certain fields REPLACE … WITH … [ADDITIVE] ~ append text to memo field REPLACE … WITH … [FOR ] REPLACE … WITH … [ALL] e.g.REPLACE term WITH ‘1’,; mark WITH (test+exam)/2 ; FOR class=‘6S’

23 BLANK ~ clears all fields of the current record BLANK [FIELDS,...] [ALL] BLANK [FIELDS…] [ALL] [FOR ] e.g.BLANK FIELDS mark,conduct FOR term=‘2’ APPEND APPEND BLANK APPEND FROM FIELDS APPEND FROM…FIELDS…[FOR ] e.g.USE class6A APPEND FROM class6S FIELDS name; FOR sex=‘M’

24 APPEND FROM … FIELDS TYPE DELIMITED APPEND FROM … FIELDS TYPE SDF e.g. of delimited file “Peter”, “M”, 14, 60 “Paul”, “M”, 13, 62 “Mary”, “F”, 15, 61 e.g. of SDF file PeterM1460 PaulM1362 MaryF1561 DELETE [ALL] DELETE FOR e.g.DELETE FOR leave=“Y” SET DELETE ON/OFF RECALL ALL

25 DELETED( ) ~ returns boolean to indicate whether the current record is marked as deleted PACK ~ kills all records marked as deleted DELETE ALL + PACK = ZAP COPY FILE TO COPY TO [FIELDS,…] COPY TO … [FIELDS …] [FOR ] e.g.USE class6S COPY TO pass_6S FIELDS name, mark; FOR mark>=40 COPY TO … TYPE DELIMITED COPY TO … TYPE SDF COPY STRUCTURE TO... [FIELDS…] ~ copy the fields structure to a new table

26 TOTAL TO ON FIELDS e.g.MARK.DBF e.g. TOTAL TO stat ON subject FIELDS qty USE stat BROW