Variable array sizes with PQexecParams

Поиск
Список
Период
Сортировка
От Garcia, Joshua
Тема Variable array sizes with PQexecParams
Дата
Msg-id E00A3B716AD4C84FB97E42367015E8A00BFF0D@usa5911mf01.na.xerox.net
обсуждение исходный текст
Ответы Re: Variable array sizes with PQexecParams  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice

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

 

В списке pgsql-novice по дате отправления:

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Copy Data Question
Следующее
От:
Дата:
Сообщение: Table Merge Successful, Primary Keys Missing