Simplicty and flexibility!


Support::

Input Using


Parameters


Returns/Result


Examples


Reference

input using

image\Dql_0024.gifinput using

Type

Processing Command

Purpose

The input using command provides all the facilities of record entry but allows DQL to process records before they are entered into the database. It can be used at any point in a procedure.

Syntax

input using TABLENAME into "TEMPFORM" via form EXISTINGFORM .

In the input using command syntax, FORMNAME is the name of a table. TEMPFORM is the name DataEase uses to reference an input using record. You can assign any name you want for this purpose except the name of a form in the same application. The first time that the TEMPFORM name is specified in the script, it must be enclosed in quotation marks.

The optional “via form EXISTINGFORM” displays the form document EXISTINGFORM, which is the name of an existing form that uses as its main table the table specified by TABLENAME.

If no form name is specified, DataEase displays the form that has the same name as the table, usually the form that defines the table.

There is no limit to the number of input using commands you can use in a script; however, each DataEase form must be assigned a unique TEMPFORM in the input using statement.

Usage

The input using command tells DataEase to display a specified record entry form. When the specified form is displayed, you can either enter or modify a record (in Form View), or scroll through the form (in Form or Table View) and select any existing record. You can also use the Goto>>Related Form menu option (or F10 key) to view records in related forms.

When you execute a processing action (e.g., File>>Close, Edit>>Save As New Record), the input record is copied into memory and a number that corresponds to the processing key is stored in the current status variable. DataEase then resumes processing the procedure, using the input using record data just like values entered in a Data-entry form. The current status value can be used to control subsequent processing. The table below summarizes the current status values returned by each processing action:

 

This

Menu Selection

Performs

This Action

And Returns

This Value

 

File>>Close

Close the active document

1

Edit>>Save As New Record

Save a new record

2

Edit>>Save

Modify an existing record

3

Edit>>Delete

Delete a record

4

 

 

Like a Data-entry form, the input using command is used to enter data for use in a procedure (rather than to permanently store the data in a table in the database). Unlike a Data-entry form, however, more than one input using statement can be used to enter data at any point during a procedure.

The input using command can only hold one record in memory at a time for a given TEMPFORM name. Therefore, if you want to save the contents of an input using record, you must use the enter a record command in the script to save the current record before processing another. Example 2 demonstrates the use of the input using command and current status variable within a loop to process multiple records.

 

Because input using can only hold one record in memory, the form must be displayed in Form View when a processing key is pressed. Table View is used for selection purposes only.

Example 1

input using MEMBERS into "TEMPMEMBER" .

for RESERVATIONS with ( MEMBER ID =

TEMPMEMBER MEMBER ID) ;

list records

RESERVATION ID ;

TOTAL DUE ;

DATE .

end

 

This script tells DataEase: (1) Display the MEMBERS form, (2) when the user selects a specific MEMBERS record and presses F2, store that record in memory (using the name TEMPMEMBER to reference it, (3) find all the RESERVATIONS records with the same MEMBER ID as the MEMBER ID in the TEMPMEMBER record, and (4) for each related reservation, list the RESERVATION ID, the TOTAL DUE, and the RESERVATION DATE. The output from this script might look as follows:

 

Reservation ID

Total Due

Reservation Date

00164

$2780.00

08/17/92

00312

$3150.00

04/30/93

00515

$2942.00

12/20/93

 

Example 2

while current status not = 1 do

input using MEMBERS into "TEMPMEMBER" .

case ( current status )

value 1 : exit .

value 2 : enter a record in MEMBERS

copy all from TEMPMEMBER .

value 3 : modify records in MEMBERS with

( MEMBER ID = TEMPMEMBER MEMBER ID)

copy all from TEMPMEMBER .

value 4 : delete records in MEMBERS with

( MEMBER ID = TEMPMEMBER MEMBER ID) .

end

end

 

The script in Example 2 tells DataEase: (1) Display the MEMBERS form, (2) each time the operator enters a record and executes a processing action (e.g., Edit>>Delete), check the value of the current status variable. If current status =1 (the user chose File>>Close when the input using record was on the screen), stop script processing without entering a record in the MEMBERS table and close the procedure. If current status = 2 (the user chose Edit>>Save As New Record when the input using record was on the screen), copy the input using record into the MEMBERS table.

If current status = 3, (the user chose Edit>>Save when the input using record was on the screen), modify the record in the MEMBERS table with a MEMBER ID (a Unique field) that is the same as the MEMBER ID on the input using record. If current status = 4, (the user chose Edit>>Delete when the input using record was on the screen), delete the record in the MEMBERS table with a MEMBER ID (a Unique field) that is the same as the MEMBER ID on the input using record, and (3) display the MEMBERS form again so the user can enter, modify, or delete another record.

Example 3

while current status not = 1 do

input using MEMBERS into "TEMPMEMBER" .

case ( current status )

value 1 : exit .

value 2 : if TEMPMEMBER MEMBER ID <= 20000 then

enter a record in MEMBERS

copy all from TEMPMEMBER .

else

message " Invalid ID. Re-enter the record. " .

end

others : message " You are not authorized to

modify or delete records. " .

end

end

 

This script tells DataEase: (1) Display the MEMBERS form, (2) each time the user enters a record and presses a processing key, check the value of the current status variable. If current status = 1, stop script processing without entering a record in the MEMBERS table. If current status = 2, verify that a valid MEMBER ID (<= 20000) was entered in the input using record. If it is valid, copy the input using record into the MEMBERS table. If it is not valid, display an error message. If current status =3or4, display a message telling the user that he/she is only authorized to enter records, and (3) display the MEMBERS form again so the user can enter another record.

 

Using the input using Command with Multiforms

When using the input using command on a Multiform, DataEase treats Main forms and Subforms differently. If you enter, modify, or delete a Main form record, the information is copied into the specified temporary form where it can be validated and processed by the script.

If you enter or modify a Subform record, however, the new or modified record is entered directly into the Subform in the database. This is because DataEase is unable to hold all of the entered or modified Subform records in memory (up to 5000 Subform records can be entered or modified at once) and still continue processing the script.

If the user chooses Edit>>Save As New Record to enter a Multiform record, you can use enter a record to enter the record into the Main form (the Subform records were automatically entered when the user pressed F2). If the script tests the Main form for validity (e.g., MEMBER ID >= 20000 in Example 3) and it fails, you must use the delete records command to remove the Subform records that were entered.

If the user chooses Edit>>Save to modify a Multiform record, you can use the modify records command to modify the Main form record (the Subform records are automatically modified). If the script tests the Main form for validity (e.g., MEMBER ID >= 20000 in Example 3) and it fails, it is up to the user to remember which Subform records were modified and then go back to the Subform and undo the modifications. DataEase cannot automatically undo modified Subform records.

If you delete a Multiform record using the input using command, the records are not directly deleted from the table. You must use the script to verify that a valid record was entered and then use the delete records command to explicitly delete the appropriate Main and Subform records.

Example 4

while current status not = 1 do

input using RESERVATIONS into "TEMPRESV" .

case ( current status )

value 1 : exit .

value 2 :

if TEMPRESV RESERVATION ID <= 50000 then

enter a record in RESERVATIONS

copy all from TEMPRESV .

else

message " Invalid ID. Re-enter the record. " .

delete records in RESERVATION DETAIL

with ( RESERVATION ID =

TEMPRESV RESERVATION ID ) .

end

others : message " You are not authorized to

modify or delete records. If you have

modified Subform records, you must

manually delete the modifications. " .

end

end

 

This script tells DataEase: (1) Display the RESERVATIONS form, (2) each time the user enters a record and presses a processing key, check the value of the current status variable. If current status = 1, stop script processing without entering a record in the RESERVATIONS table. If current status = 2, verify that a valid RESERVATION ID was entered in the input using record. If the RESERVATION ID is valid, copy the input using record into the RESERVATIONS table. If the RESERVATION ID is not valid, display an error message and delete the records that were automatically entered in the Subform (RESERVATION DETAIL). If current status = 3 or 4, display a message telling the user that he/she is only authorized to enter records, and (3) display the RESERVATIONS form again so the user can enter another record.

See Also


On the forum about Input Using

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien.&nbsp;le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 è poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about Input Using


dg3_HelpView