Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
20Activity
0 of .
Results for:
No results containing your search query
P. 1
Embedded SQL (SQL EMBEBIDO en PROGRAMAS RPG)

Embedded SQL (SQL EMBEBIDO en PROGRAMAS RPG)

Ratings: (0)|Views: 3,388 |Likes:
Published by lilisustar
Un documento sencillo que resume lo que es el SQL embebido en un programa RPG.
Un documento sencillo que resume lo que es el SQL embebido en un programa RPG.

More info:

Published by: lilisustar on Jun 06, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/08/2012

pdf

text

original

 
Your partner in System i Education
Embedding SQLin RPG Programs
Susan Gantner
susan.gantner@partner400.com
www.Partner400.comwww.System
i
Developer.com
Many RPG programmers have used interactive SQL as a tool to quickly browse data or to createtest data scenarios, but have stopped short of embedding it into their RPG programs. Come to thissession to learn why, when and how you may want to use SQL in conjunction with RPG. We willcover the basics of embedding SQL into RPG, including using SQL cursors.The authors, Susan Gantner and Jon Paris, are co-founders of Partner400, a firm specializing incustomized education and mentoring services for AS/400 and iSeries developers. After many yearswith IBM, including several years at the Rochester and Toronto laboratories, Jon and Susan arenow devoted to educating developers on techniques and technologies to extend and modernizetheir applications and development environments. This is done via on-site custom classes forindividual companies as well as conferences and user group events.Together with her partner, Jon Paris, Susan authors regular technical articles for the IBMpublication,
IBM Systems Magazine, i5 edition ( 
formerly
iSeries Magazine 
and
eServer Magazine,iSeries edition 
), and the companion electronic newsletter,
i5 EXTRA ( 
formerly
iSeries Extra)
. Youmay view articles in current and past issues and/or subscribe to the free newsletter or the magazineat: http://www.ibmsystemsmag.com.Susan and Jon are also partners in SystemiDeveloper, a company that hosts the
RPG Summit
and
DB2 Summit
conferences. See
SystemiDeveloper.com
for more details.This presentation may contain small code examples that are furnished as simple examples toprovide an illustration. These examples have not been thoroughly tested under all conditions. Wetherefore, cannot guarantee or imply reliability, serviceability, or function of these programs.All code examples contained herein are provided to you "as is". THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLYDISCLAIMED.
 ©Copyright Partner400, 2003 - 2007.SQL in RPG - Page 1-2 .
 
Agenda 
Quick review: What is SQL?Syntax and rules for embedding SQL into programsUsing SQL cursors for processing individual rows in a setError detection and handlingTipsDynamic SQL (appendix only)Data Manipulation Language (DML)
SELECT - retrieves data; one row or multipleUPDATE - updates one row or multipleDELETE - deletes one row or multipleINSERT - adds one row or multiple
Data Definition Language (DDL)
CREATE - creates schemas, tables, views, etc.DROP - deletes schemas, tables, views, etc.ALTER - change the format or attributes of a table
Data Control Language (DCL)
GRANT & REVOKE - manages authorities to DB objects
Programming Statements
DESCRIBE, PREPARE - used for dynamic embedded SQLLogic control statements for SQL procedures, triggers and functions(SPL)
Types of SQL Statements 
 ©Copyright Partner400, 2003 - 2007.SQL in RPG - Page 3-4 .
 
Interactive SQL - Use STRSQL command
Targeted primarily to programmers
Embedded SQL - Put into High Level Language (HLL)
Such as RPG or COBOL
Query Manager - Report Formatter
Targeted primarily to end usersAn alternative to Query/400
iSeries Navigator
SQL wizards, productivity and testing toolsGraphical alternative to Interactive SQL
SQL Stored Procedures and SQL Triggers
Enforce business rules using SQL-based logic
Using SQL on System i Quick Review of SQL SELECT Syntax 
Enter SQL StatementsType SQL statement, press Enter.> SELECT * FROM users WHERE clue > 0________ _0 rows returned._____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________Bottom F14=Delete line F15=Split line F16=Select libraryF17=Select files F18=Select fields F24=More keys
 ©Copyright Partner400, 2003 - 2007.SQL in RPG - Page 5-6 .

Activity (20)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
sudarsan2010 liked this
giocot liked this
fberber liked this
luismacan1244 liked this
reddyjaya939 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->