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

user defined variable per session

Hello,

I need to create user defined variable in every database session.
In Sybase ASA is equivalent:
CREATE VARIABLE name TYPE;

I need use this in views. Is it possible???

thanx, miso
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #1
3 3028

On Sunday, December 7, 2003, at 11:38 PM, Miso Hlavac wrote:
Hello,

I need to create user defined variable in every database session.
In Sybase ASA is equivalent:
CREATE VARIABLE name TYPE;

I need use this in views. Is it possible???


Would it be possible to use a temp (very simple) temp table to do this?
For example

CREATE TEMP TABLE variable (value INT);

for an integer variable. Then just use UPDATE and SELECT to set and
return the variable.

Michael
grzm myrealbox com
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2
> I need to create user defined variable in every database session.
In Sybase ASA is equivalent:
CREATE VARIABLE name TYPE;

I need use this in views. Is it possible???


What about

test=> \set myvar 5
test=> select :myvar;
?column?
----------
5
(1 row)

hth
cl.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3
On Sun, 2003-12-07 at 19:57, Claudio Lapidus wrote:
I need to create user defined variable in every database session.
In Sybase ASA is equivalent:
CREATE VARIABLE name TYPE;

I need use this in views. Is it possible???


What about

test=> \set myvar 5
test=> select :myvar;
?column?
----------
5
(1 row)


But that is specific to psql. It's not something you can use in an
application, as you might the Sybase command.

--
Oliver Elphick Ol************@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"And if thy hand offend thee, cut it off; it is better
for thee to enter into life maimed, than having two
hands to go into hell, into the fire that never shall
be quenched." Mark 9:43
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jon Grieve | last post by:
Having come to PHP from another CGI, there's one thing I really miss... The previous tool used was Witango, which had one major difference: the interpreter ran as a service/daemon. One benefit...
3
by: Simon Niederberger | last post by:
How can I give a user-defined object session scope? From http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/windows2000/en/server/iis/htm/asp/iiwaobu.htm I gather that it can...
15
by: Tom Nowak | last post by:
I am writing a webapp in which a user is required to enter a login id and password on a login form. I have forms authenticaion coded in my web.config. Once the user is logged in, I want to use the...
7
by: fisab | last post by:
I apologise in advance for such a basic question, but I'm hoping someone will take the time to answer my question. In my code I define a Dataset : Partial Class Default_aspx Dim dsExcel As...
3
by: voro.cibus | last post by:
I have been reading up on this all day, and I can't find the answer (or more likely, don't understand the answers I have found) to my problem. I have a table that stores the name of my ascx page....
3
by: c676228 | last post by:
Hi all, I have an event in user control email to handling email change when user want to change the input for email address. Here it is In email.ascx.vb: Protected Sub UpdateEmail(ByVal sender As...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
2
by: rn5a | last post by:
Assume that a user control has a TextBox (Page1.ascx) <asp:TextBox ID="txtName" runat="server"/> I am encapsulating the above user control in a ASPX page named Page1.aspx i.e. the ASPX page...
5
by: Andy | last post by:
I have an admin section of my asp.net 2 application, and I want to be able to automatically login as a different user (Forms Authentication) whilst keeping my current session going too. The problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.