Named parameters in queries Postgres

Questions and answers regarding general SQL and backend databases

Named parameters in queries Postgres

Postby andre1506345542 » Thu Mar 01, 2018 11:37 am

Hi

I use databaseManager.getDataSetByQuery to get a foundset from a query. So I do not use the query builder in this case.
I use Postgres, Servoy 8.2.2, NG Client

I pass parameters in the query as an ?
But I need to use named parameters in my query as I want to use a parameter more then once in my query.

How can I use named parameters?

Thanks
Andre
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm

Re: Named parameters in queries Postgres

Postby sbutler » Mon Mar 05, 2018 10:59 pm

You don't. You'll just need to repeat the parameter. Parameters are just ordered, so the order of the parameters in the arguments array should match the order of the question marks in the query.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Named parameters in queries Postgres

Postby andre1506345542 » Tue Mar 06, 2018 12:06 pm

Thanks Scott
I thought so, I will repeat them
Andre
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 5 guests