Chatee ahora con Soporte
Chat con el soporte

Toad Data Studio Subscription 1.0 - Release Notes

Example Script: Populate Tables and Data

Toad Script Example

The following script demonstrates how to use Toad Script functions. This script creates the number of tables you specify. The script prompts you for the number of tables to create and the number of rows to create.

For more information about Toad Script functions and how to use them, see About Toad Script.

--: PROMPT tableCount = 'Enter the number of test tables to create'

--: SET i = 0

--: WHILE i < tableCount

--: SET i = i + 1  

CREATE TABLE testTable{{Unquote(:i)}} ( id INT PRIMARY KEY );

--: ENDWHILE

--: NOTIFY 'Done creating tables.'

--: ASK addData = 'Fill tables with test data?'

--: IF addData

--: PROMPT rowCount = 'Enter number of rows to create'  

--: SET i = 0  

--: WHILE i < tableCount  

--: SET i = i + 1    

--: SET j = 1    

--: WHILE j <= rowCount    

INSERT INTOtestTable{{Unquote(:i)}} VALUES (:j);

--: SET j = j + 1      

--: ENDWHILE    

--: PRINT 'Completed filling table ' || i    

--: ENDWHILE  

--:ENDIF

 

Documentos relacionados

The document was helpful.

Seleccionar calificación

I easily found the information I needed.

Seleccionar calificación