473,386 Members | 1,867 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,386 software developers and data experts.

how passing sequence name in postgresql using php statement?

I'm using Zend framework for building my application,
when I need to get the next value of a sequence, the system doesn't respond.
I use this code:
Expand|Select|Wrap|Line Numbers
  1. public function nextSequenceId($sequenceName)
  2. {
  3.   $this->_connect();   
  4.   $value = $this->fetchOne('SELECT '.new Zend_Db_Expr('nextval(\'"'.$sequenceName.'"\')'));
  5.   return $value ;
  6. }
  7.  
note:
1- when I use the statement in pgadminIII:
Expand|Select|Wrap|Line Numbers
  1.   SELECT nextval('"SEQ_QUT_QUOTATION"')
the statement returns a rigth value.
2- all objects in my database have names in capital letters, so I can't access to them with out double quotes.


may any one help me to fix this issue?

THANKS.
Jun 7 '11 #1
0 1060

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

Similar topics

5
by: Marek Lewczuk | last post by:
I'm curious if the default scheme for sequence name (which is created with SERIAL data type) can be changed -- currently all sequences are named like this: <table_name>_<field_name>_seq -- can it...
8
by: J-T | last post by:
I have a class like below I have a couple of questions about that: 1) I like to use "Using statement" when creating an object of this class,so I had to implement IDisposable.Am I doing this right...
3
by: Secrétariat | last post by:
Hello ! I use a PostgreSQL server 7.4 on Linux Mandrake 10 with IP 192.168.0.15, a database gestix is created. An PostegreSQL user "postgres" id defined on this server, I add in the...
15
by: Robby Russell | last post by:
I am trying to track down a method of determining what a sequence name is for a SERIAL is in postgresql. For example, CREATE TABLE foo (id SERIAL PRIMARY KEY NOT NULL, bar TEXT); \d foo...
5
by: nephish | last post by:
hey there, can anyone tell me if this is legal php/mysql ? i am trying to write a simple function to get a single stat from a single table. eg.. $field = 'phone_number'; $customer = 'fred';
1
by: filip1150 | last post by:
I'm trying to find if there is any performance diference between explicitly using a sequence in the insert statement to generate values for a column and doing this in an insert trigger. I...
3
by: jojo41300000 | last post by:
Hi, I am trying to pass the table name to stored procedure and then use the passing table name in select, update or delete query statement. When I tried to do that, I got the error such as...
0
by: petemcg | last post by:
I am trying to create a wrapper function to allow me to get the next value for any sequence I would like to pass a sequence name into the function, and return the next value. It looks like DB2...
23
by: Tony Johansson | last post by:
Hello! I just wonder what is the point of having the reader variable declared as TextReader in the snippet below.. Is it because of using the polymorfism on the reader variable perhaps. using...
5
by: Hillbilly | last post by:
MSDN Remarks "as a rule" the using statement should be used when instantiating objects which inherit IDisposable. Other than the obvious unmanaged objects like the file system example, fonts and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.