Navigation:  Programming Cookbook > Database Connectivity > Preparing SQL for Later Execution >

Parameterization and Execution

Previous pageReturn to chapter overviewNext page

At this stage the prepared statement is fully initialised and can be retained for future execution. Obviously, before actually executing the statement the appropriate parameter substitutions must be made. This is done using #value:.

ps values: #('Object Arts Ltd' 'http://www.object-arts.com').

ps exec.

ps numRows. "Display it"

 

You should find that this has inserted one row into the database. Let's try adding a couple more:

ps values: #('Bernies Burgers Inc' 'http://www.burgers.com').

ps exec.

ps values: #('Cajun Spice Ltd' 'http://www.hot-spice.com').

ps exec.

 

Just to check that we have indeed added three rows, you can query the following:

c query: 'select * from Suppliers where SupplierID>=30'. "Inspect it"