473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Prepared Statement for IN function

Could anyone please tell me if it is possible to use prepared statement in postgresql for IN function? if its possible then hows it done? What I want to have would look something like this,

prepare my_query as
select something from sometable
where some_column IN ($1);
execute my_query('lookup_value','lookup_value','lookup_val ue')

Please let me know how this could be achieved in Postgresql,

Tons of Thanks
Jan 21 '08 #1
3 3921
Does someone have an answer for it? Please let me know as am designing my classes and it depends on this now.

Thanks a lot
Jan 22 '08 #2
rski
700 Expert 512MB
Could anyone please tell me if it is possible to use prepared statement in postgresql for IN function? if its possible then hows it done? What I want to have would look something like this,

prepare my_query as
select something from sometable
where some_column IN ($1);
execute my_query('lookup_value','lookup_value','lookup_val ue')

Please let me know how this could be achieved in Postgresql,

Tons of Thanks
I'm not sure if I get you problem because the query you wrote works fine but you must write that statement will receive a parameter

prepare my_query(int) as
select something from sometable
where some_column IN ($1);

Did't it work with your postgres?
Jan 22 '08 #3
Sorry my bad, query works fine.
Jan 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: David.Tymon | last post by:
>Description: MySQL v4.1.0-alpha only allows a client to prepare a maximum of 254 statements. On the 255th mysql_prepare() call, a failure is returned with no information returned by...
0
by: Prashanth | last post by:
I am getting this error from BEA DB2 Driver in weblogic console. java.sql.SQLException: CURSOR C02 NOT IN A PREPARED STATE java.sql.SQLException: CURSOR C02 NOT IN A PREPARED STATE We keep...
0
by: Rujuta Gandhi | last post by:
Hi all, I want to use prepared statement in which the where clause is to be passed as a parameter. I dont know how to get the where clause from a cube as a tuple as the error coming after the...
2
by: Cyril VELTER | last post by:
I'm converting an application to use the V3 protocol features in the 7.4 libpq. As I need to make a design choice regarding the use of prepared statements, I'm wondering what ressources does a...
3
by: birju | last post by:
Hi, I'm running SQL Profiler on an SQL Server 2000 database. I see that one stored procedure gets repeatedly executed having a handle of '1'. This query takes a long time to complete. How do I...
2
by: toomanyjoes | last post by:
I have written a function that runs a prepared statement and it seems to run just fine but when I check to see the affected rows nothing is affected. Can someone take a look at my code and tell me...
2
by: ojorus | last post by:
Hi! Some questions regarding the mysqli-extension (php5) 1) Prepared statements: If I understand things right, prepared statements will give better performance if you make several similar...
2
by: Pugi! | last post by:
It is by accident that I noticed that I forgot to use mysql_real_escape_string in part of my webapp. I tested input with following text : Hélène 51°56'12'' http://www.mysite.org/folder 3 functions...
4
by: TechieGrl | last post by:
Prepared statements are new to me and having to do this with a multi- dimensional array is beyond me. Here is the prepared statement block: // Prepare to insert a record into table1...
6
by: Gordon | last post by:
I want to search a folder structure represented in a database. I'm using the ID and Parent columns model, and would like to be able to search a folder's subfolders as well as teh folder itself. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.