Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Variable array sizes with PQexecParams



I want to use PQexecParams to insert into a field that takes an array of varchars.  I tried something like:

 

INSERT INTO table1(column1) VALUES (‘{$1,$2}’)

 

But, this just inserts {$1,$2} into the field.

 

However, I also want to be able to select at runtime the number of elements I’ll be inserting into the field.  For example, rather than having two elements in the array as I tried above, I just want one element as shown below:

 

INSERT INTO table1(column1) VALUES ($1)

 

How can I do all this?

 

Thanks in advance,

Josh

 



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group