473,405 Members | 2,415 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,405 software developers and data experts.

function of IDENTITY_VAL_LOCAL problem

Hi,

I am using DB2 UDB ESE 8.1.5 on a win2000 server.
I tried to use the function IDENTITY_VAL_LOCAL to get the most
up-to-date record with following statement:

VALUES IDENTITY_VAL_LOCAL() INTO :IVAR

in the command center, but it prompt me for the below message:
CLI0100E Wrong number of parameters. SQLSTATE=07001

I've already turned off the auto commit. Could anyone can give me a
helping hand, please? Many thanks!

And also, if I want to use the same function for programming with C#
..NET, by using OLEDB provider, should I bear anything in mind?

Regards,
Chunglun
Nov 12 '05 #1
8 9991
INTO :IVAR
is not supported in command cnetre ...

This clause is supported only in embedded SQL code, SQL Procedures etc

HTH

Sathyaram
www.db2click.com

ch******@chunglun.com (chunglun) wrote in message news:<87**************************@posting.google. com>...
Hi,

I am using DB2 UDB ESE 8.1.5 on a win2000 server.
I tried to use the function IDENTITY_VAL_LOCAL to get the most
up-to-date record with following statement:

VALUES IDENTITY_VAL_LOCAL() INTO :IVAR

in the command center, but it prompt me for the below message:
CLI0100E Wrong number of parameters. SQLSTATE=07001

I've already turned off the auto commit. Could anyone can give me a
helping hand, please? Many thanks!

And also, if I want to use the same function for programming with C#
.NET, by using OLEDB provider, should I bear anything in mind?

Regards,
Chunglun

Nov 12 '05 #2
INTO :IVAR
is not supported in command cnetre ...

This clause is supported only in embedded SQL code, SQL Procedures etc

HTH

Sathyaram
www.db2click.com

ch******@chunglun.com (chunglun) wrote in message news:<87**************************@posting.google. com>...
Hi,

I am using DB2 UDB ESE 8.1.5 on a win2000 server.
I tried to use the function IDENTITY_VAL_LOCAL to get the most
up-to-date record with following statement:

VALUES IDENTITY_VAL_LOCAL() INTO :IVAR

in the command center, but it prompt me for the below message:
CLI0100E Wrong number of parameters. SQLSTATE=07001

I've already turned off the auto commit. Could anyone can give me a
helping hand, please? Many thanks!

And also, if I want to use the same function for programming with C#
.NET, by using OLEDB provider, should I bear anything in mind?

Regards,
Chunglun

Nov 12 '05 #3
... in other words, just leave teh INTO clause out:
Type
VALUES identity_val_local()

identity_val_local() is "just another function" there is nothing special
about it w.r.t. any of the interfaces.
The problem you are encountering is about how to retrieve a scalar
result in CLI/...

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4
... in other words, just leave teh INTO clause out:
Type
VALUES identity_val_local()

identity_val_local() is "just another function" there is nothing special
about it w.r.t. any of the interfaces.
The problem you are encountering is about how to retrieve a scalar
result in CLI/...

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5
Thanks very much!

I also want to know how is the function applied in programming with C#?

Thanks!

Chunglun

Serge Rielau <sr*****@ca.eye-be-em.com> wrote in message news:<c6**********@hanover.torolab.ibm.com>...
.. in other words, just leave teh INTO clause out:
Type
VALUES identity_val_local()

identity_val_local() is "just another function" there is nothing special
about it w.r.t. any of the interfaces.
The problem you are encountering is about how to retrieve a scalar
result in CLI/...

Cheers
Serge

Nov 12 '05 #6
Thanks very much!

I also want to know how is the function applied in programming with C#?

Thanks!

Chunglun

Serge Rielau <sr*****@ca.eye-be-em.com> wrote in message news:<c6**********@hanover.torolab.ibm.com>...
.. in other words, just leave teh INTO clause out:
Type
VALUES identity_val_local()

identity_val_local() is "just another function" there is nothing special
about it w.r.t. any of the interfaces.
The problem you are encountering is about how to retrieve a scalar
result in CLI/...

Cheers
Serge

Nov 12 '05 #7
It's an SQL Fucntion. It doesn't care what your external language is.
You need to find out how to do the equivalent of VALUES INTO/SELECT INTO
In your client language (single row reurn without a cursor).
Worst case you can always open a cursor on
SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1
and fetch the 1 ROW back. That is guranteed to work anywhere.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #8
It's an SQL Fucntion. It doesn't care what your external language is.
You need to find out how to do the equivalent of VALUES INTO/SELECT INTO
In your client language (single row reurn without a cursor).
Worst case you can always open a cursor on
SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1
and fetch the 1 ROW back. That is guranteed to work anywhere.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #9

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

Similar topics

2
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message....
0
by: chunglun | last post by:
Hi, I am using DB2 UDB ESE 8.1.5 on a win2000 server. I tried to use the function IDENTITY_VAL_LOCAL to get the most up-to-date record with following statement: VALUES IDENTITY_VAL_LOCAL()...
3
by: shibing.yu | last post by:
my function is CREATE FUNCTION BOD_SEQ_NEXT () RETURNS NUMERIC(19) LANGUAGE SQL MODIFIES SQL DATA FENCED NOT DETERMINISTIC
1
by: mike | last post by:
If I try and do a "SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1" after I have run a stored procedure in DB2 version 7.2, I get the last generated Key before the CallableStatement was executed...
7
by: Mike D. | last post by:
I have a problem with a dynamic library I am developing, but it is really more of a pointer issue than anything else. Hopefully someone here can lend me some assistance or insight into resolving...
2
by: Fernando Barsoba | last post by:
Dear all, I have been posting about a problem trying to encrypt certain data using HMAC-SHA1 functions. I posted that my problem was solved, but unfortunately, I was being overly optimistic. I...
0
by: ZXDALMA | last post by:
Dear colleagues, I'm programming in ADS-OnLine Language attached to a DB2 V7R1 server which acts as a data repository. I need to know how to use the scalar function IDENTITY_VAL_LOCAL in order...
0
by: Alice Christy | last post by:
Hi, Can anybody say me why the call to identity_val_local() returns null even after inserting a record in a connection pool. I am using commons-pool.jar for connection pooling. But when I call...
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
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?
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
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
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...
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...
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,...

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.