dbTalk Databases Forums  

Parameters inside of functions, possible?

sybase.public.sqlanywhere.ultralite sybase.public.sqlanywhere.ultralite


Discuss Parameters inside of functions, possible? in the sybase.public.sqlanywhere.ultralite forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave Was
 
Posts: n/a

Default Parameters inside of functions, possible? - 02-16-2007 , 02:14 AM






I am trying to insert a record into an Ultralite table, and am using
parameters. Can I use a SQL Parameter within a function? Is there some other
way to do this?

INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf(?, 0))

I get a syntax error on this parameter:
INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf([ERROR->]?, 0))



Reply With Quote
  #2  
Old   
Usmanov A.
 
Posts: n/a

Default Re: Parameters inside of functions, possible? - 02-16-2007 , 02:45 AM






Please show version, build of your ASA and type of UL API.
Is it prepared sql-statement or something else?

--
Sincerely yours,
Alex Usmanov
(ASA 9.0.2.3131, MW CW 9.2)
"Dave Was" <rental (AT) wasden (DOT) com> сообщил/сообщила в новостях следующее:
news:45d567c9$1 (AT) forums-1-dub (DOT) ..
Quote:
I am trying to insert a record into an Ultralite table, and am using
parameters. Can I use a SQL Parameter within a function? Is there some
other
way to do this?

INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf(?, 0))

I get a syntax error on this parameter:
INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf([ERROR->]?, 0))





Reply With Quote
  #3  
Old   
Dave Was
 
Posts: n/a

Default Re: Parameters inside of functions, possible? - 02-16-2007 , 03:27 AM



Oh, thanks Usmanov. The API type is C++. The version is 9.0.2.3249. It is a
prepared sql-statement.

"Usmanov A." <alex_u (AT) pochtamt (DOT) ru> wrote

Quote:
Please show version, build of your ASA and type of UL API.
Is it prepared sql-statement or something else?

--
Sincerely yours,
Alex Usmanov
(ASA 9.0.2.3131, MW CW 9.2)
"Dave Was" <rental (AT) wasden (DOT) com> сообщил/сообщила в новостях следующее:
news:45d567c9$1 (AT) forums-1-dub (DOT) ..
I am trying to insert a record into an Ultralite table, and am using
parameters. Can I use a SQL Parameter within a function? Is there some
other
way to do this?

INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf(?, 0))

I get a syntax error on this parameter:
INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf([ERROR->]?, 0))







Reply With Quote
  #4  
Old   
Usmanov A.
 
Posts: n/a

Default Re: Parameters inside of functions, possible? - 02-16-2007 , 04:53 AM



UL-generator get hint for this error - you must define type of second
parameter by using CAST function (at least, it helps in my case). For
example:
INSERT INTO tblServiceRequests (IDNumber, AreaID) VALUES (?, NullIf(CAST(?
AS INTEGER), 0)).




--
Sincerely yours,
Alex Usmanov
(ASA 9.0.2.3131, MW CW 9.2)
"Dave Was" <rental (AT) wasden (DOT) com> сообщил/сообщила в новостях следующее:
news:45d57905$1 (AT) forums-1-dub (DOT) ..
Quote:
Oh, thanks Usmanov. The API type is C++. The version is 9.0.2.3249. It is
a
prepared sql-statement.

"Usmanov A." <alex_u (AT) pochtamt (DOT) ru> wrote in message
news:45d56f3e$1 (AT) forums-1-dub (DOT) ..
Please show version, build of your ASA and type of UL API.
Is it prepared sql-statement or something else?

--
Sincerely yours,
Alex Usmanov
(ASA 9.0.2.3131, MW CW 9.2)
"Dave Was" <rental (AT) wasden (DOT) com> сообщил/сообщила в новостях следующее:
news:45d567c9$1 (AT) forums-1-dub (DOT) ..
I am trying to insert a record into an Ultralite table, and am using
parameters. Can I use a SQL Parameter within a function? Is there some
other
way to do this?

INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf(?, 0))

I get a syntax error on this parameter:
INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf([ERROR->]?, 0))









Reply With Quote
  #5  
Old   
Dave Was
 
Posts: n/a

Default Re: Parameters inside of functions, possible? - 02-16-2007 , 12:08 PM



Thank you Usmanov. That is what I was missing.

"Usmanov A." <alex_u (AT) pochtamt (DOT) ru> wrote

Quote:
UL-generator get hint for this error - you must define type of second
parameter by using CAST function (at least, it helps in my case). For
example:
INSERT INTO tblServiceRequests (IDNumber, AreaID) VALUES (?, NullIf(CAST(?
AS INTEGER), 0)).




--
Sincerely yours,
Alex Usmanov
(ASA 9.0.2.3131, MW CW 9.2)
"Dave Was" <rental (AT) wasden (DOT) com> сообщил/сообщила в новостях следующее:
news:45d57905$1 (AT) forums-1-dub (DOT) ..
Oh, thanks Usmanov. The API type is C++. The version is 9.0.2.3249. It is
a
prepared sql-statement.

"Usmanov A." <alex_u (AT) pochtamt (DOT) ru> wrote in message
news:45d56f3e$1 (AT) forums-1-dub (DOT) ..
Please show version, build of your ASA and type of UL API.
Is it prepared sql-statement or something else?

--
Sincerely yours,
Alex Usmanov
(ASA 9.0.2.3131, MW CW 9.2)
"Dave Was" <rental (AT) wasden (DOT) com> сообщил/сообщила в новостях следующее:
news:45d567c9$1 (AT) forums-1-dub (DOT) ..
I am trying to insert a record into an Ultralite table, and am using
parameters. Can I use a SQL Parameter within a function? Is there some
other
way to do this?

INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf(?, 0))

I get a syntax error on this parameter:
INSERT INTO tblServiceRequests (IDNumber, AreaID)
VALUES (?, NullIf([ERROR->]?, 0))











Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.