f



Stored procedure giving syntax error in different version of informix

Hi,

i am new to informix sql procedures..
the sql below works fine in my development box

IBM Informix Dynamic Server Version 9.40.FC8
 INFORMIX-SQL Version   7.20.UD8
HP-UX B.11.11

but it throws a syntax error in testing box
IBM Informix Dynamic Server Version 9.40.FC5W2
INFORMIX-SQL Version   7.20.UD8
HP-UX B.11.11

 create procedure p (c char(20))
 returning int,
 char(20);

define en int;
define is int;
define r1 int;
define r2 char(20);


..
..
..
..
..

return r1,
         r2;
end procedure;

looking forward for your help.

Regards
Raghu

0
raghu
4/16/2007 9:50:46 AM
comp.databases.informix 16083 articles. 0 followers. Post Follow

7 Replies
564 Views

Similar Articles

[PageSpeed] 29

raghu.shivaiah@gmail.com wrote:
> Hi,
> 
> i am new to informix sql procedures..
> the sql below works fine in my development box
> 
> IBM Informix Dynamic Server Version 9.40.FC8
>  INFORMIX-SQL Version   7.20.UD8
> HP-UX B.11.11
> 
> but it throws a syntax error in testing box
> IBM Informix Dynamic Server Version 9.40.FC5W2
> INFORMIX-SQL Version   7.20.UD8
> HP-UX B.11.11
> 
>  create procedure p (c char(20))
>  returning int,
>  char(20);
> 
> define en int;
> define is int;
> define r1 int;
> define r2 char(20);
> 
> 
> .
> .
> .
> .
> .
> 
> return r1,
>          r2;
> end procedure;
> 
> looking forward for your help.
> 
> Regards
> Raghu
> 

What error do you get ?

NB! I would recommend to use dbaccess instead of isql

Claus
0
Claus
4/16/2007 2:14:59 PM
And the syntax error is reported where ?



Paul Watson
Tel: +44 1414161772        +1 913-400-2620
Mob: +44 7818003457        +1 913-636-2858
Web: www.oninit.com

Failure is not as frightening as regret.

 

> -----Original Message-----
> From: raghu.shivaiah@gmail.com [mailto:raghu.shivaiah@gmail.com] 
> Posted At: 16 April 2007 04:51
> Posted To: comp.databases.informix
> Conversation: Stored procedure giving syntax error in 
> different version of informix
> Subject: Stored procedure giving syntax error in different 
> version of informix
> 
> 
> Hi,
> 
> i am new to informix sql procedures..
> the sql below works fine in my development box
> 
> IBM Informix Dynamic Server Version 9.40.FC8
>  INFORMIX-SQL Version   7.20.UD8
> HP-UX B.11.11
> 
> but it throws a syntax error in testing box IBM Informix 
> Dynamic Server Version 9.40.FC5W2
> INFORMIX-SQL Version   7.20.UD8
> HP-UX B.11.11
> 
>  create procedure p (c char(20))
>  returning int,
>  char(20);
> 
> define en int;
> define is int;
> define r1 int;
> define r2 char(20);
> 
> 
> .
> .
> .
> .
> .
> 
> return r1,
>          r2;
> end procedure;
> 
> looking forward for your help.
> 
> Regards
> Raghu
> 

0
Paul
4/16/2007 4:10:47 PM
On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
> And the syntax error is reported where ?
>
> Paul Watson
> Tel: +44 1414161772        +1 913-400-2620
> Mob: +44 7818003457        +1 913-636-2858
> Web:www.oninit.com
>
> Failure is not as frightening as regret.
>
>
>
> > -----Original Message-----
> > From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com]
> > Posted At: 16 April 2007 04:51
> > Posted To: comp.databases.informix
> > Conversation: Stored procedure giving syntax error in
> > different version of informix
> > Subject: Stored procedure giving syntax error in different
> > version of informix
>
> > Hi,
>
> > i am new to informix sql procedures..
> > the sql below works fine in my development box
>
> > IBM Informix Dynamic Server Version 9.40.FC8
> >  INFORMIX-SQL Version   7.20.UD8
> > HP-UX B.11.11
>
> > but it throws a syntax error in testing box IBM Informix
> > Dynamic Server Version 9.40.FC5W2
> > INFORMIX-SQL Version   7.20.UD8
> > HP-UX B.11.11
>
> >  create procedure p (c char(20))
> >  returning int,
> >  char(20);
>
> > define en int;
> > define is int;
> > define r1 int;
> > define r2 char(20);
>
> > .
> > .
> > .
> > .
> > .
>
> > return r1,
> >          r2;
> > end procedure;
>
> > looking forward for your help.
>
> > Regards
> > Raghu- Hide quoted text -
>
> - Show quoted text -

I am using dbaccess only. below is the error.

   201: A syntax error has occurred.

create procedure p (c char(20))
 returning int,
 char(20);          --------- The cursor points to this line.


0
raghu
4/17/2007 7:41:13 AM
<raghu.shivaiah@gmail.com> wrote in message 
news:1176795673.271660.105850@n59g2000hsh.googlegroups.com...
> On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
>> And the syntax error is reported where ?
>>
>> Paul Watson
>> Tel: +44 1414161772        +1 913-400-2620
>> Mob: +44 7818003457        +1 913-636-2858
>> Web:www.oninit.com
>>
>> Failure is not as frightening as regret.
>>
>>
>>
>> > -----Original Message-----
>> > From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com]
>> > Posted At: 16 April 2007 04:51
>> > Posted To: comp.databases.informix
>> > Conversation: Stored procedure giving syntax error in
>> > different version of informix
>> > Subject: Stored procedure giving syntax error in different
>> > version of informix
>>
>> > Hi,
>>
>> > i am new to informix sql procedures..
>> > the sql below works fine in my development box
>>
>> > IBM Informix Dynamic Server Version 9.40.FC8
>> >  INFORMIX-SQL Version   7.20.UD8
>> > HP-UX B.11.11
>>
>> > but it throws a syntax error in testing box IBM Informix
>> > Dynamic Server Version 9.40.FC5W2
>> > INFORMIX-SQL Version   7.20.UD8
>> > HP-UX B.11.11
>>
>> >  create procedure p (c char(20))
>> >  returning int,
>> >  char(20);
>>
>> > define en int;
>> > define is int;
>> > define r1 int;
>> > define r2 char(20);
>>
>> > .
>> > .
>> > .
>> > .
>> > .
>>
>> > return r1,
>> >          r2;
>> > end procedure;
>>
>> > looking forward for your help.
>>
>> > Regards
>> > Raghu- Hide quoted text -
>>
>> - Show quoted text -
>
> I am using dbaccess only. below is the error.
>
>   201: A syntax error has occurred.
>
> create procedure p (c char(20))
> returning int,
> char(20);          --------- The cursor points to this line.

Please post the entire procedure (or email it to me off-line if you prefer). I 
have a 9.4 HP-UX system here on which I can replicate the problem and then work 
out which syntax is actually being rejected.

-- 
Regards,
Doug Lawry
www.douglawry.webhop.org


0
Doug
4/17/2007 11:01:17 AM
raghu.shivaiah@gmail.com wrote:
> On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:

Your CREATE PROCEDURE .... RETURNING... should end in a semi colon not a comma:

create procedure p (c char(20))
   returning int;
char(20);

Art S. Kagel

>>And the syntax error is reported where ?
>>
>>Paul Watson
>>Tel: +44 1414161772        +1 913-400-2620
>>Mob: +44 7818003457        +1 913-636-2858
>>Web:www.oninit.com
>>
>>Failure is not as frightening as regret.
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com]
>>>Posted At: 16 April 2007 04:51
>>>Posted To: comp.databases.informix
>>>Conversation: Stored procedure giving syntax error in
>>>different version of informix
>>>Subject: Stored procedure giving syntax error in different
>>>version of informix
>>
>>>Hi,
>>
>>>i am new to informix sql procedures..
>>>the sql below works fine in my development box
>>
>>>IBM Informix Dynamic Server Version 9.40.FC8
>>> INFORMIX-SQL Version   7.20.UD8
>>>HP-UX B.11.11
>>
>>>but it throws a syntax error in testing box IBM Informix
>>>Dynamic Server Version 9.40.FC5W2
>>>INFORMIX-SQL Version   7.20.UD8
>>>HP-UX B.11.11
>>
>>> create procedure p (c char(20))
>>> returning int,
>>> char(20);
>>
>>>define en int;
>>>define is int;
>>>define r1 int;
>>>define r2 char(20);
>>
>>>.
>>>.
>>>.
>>>.
>>>.
>>
>>>return r1,
>>>         r2;
>>>end procedure;
>>
>>>looking forward for your help.
>>
>>>Regards
>>>Raghu- Hide quoted text -
>>
>>- Show quoted text -
> 
> 
> I am using dbaccess only. below is the error.
> 
>    201: A syntax error has occurred.
> 
> create procedure p (c char(20))
>  returning int,
>  char(20);          --------- The cursor points to this line.
> 
> 
0
Art
4/17/2007 1:46:09 PM
> -----Original Message-----
> From: Art S. Kagel [mailto:kagel@bloomberg.net] 
> 
> raghu.shivaiah@gmail.com wrote:
> > On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
> 
> Your CREATE PROCEDURE .... RETURNING... should end in a semi 
> colon not a comma:
> 
> create procedure p (c char(20))
>    returning int;
> char(20);
> 

Disagree, to return two variables they are comma separated


> Art S. Kagel
> 
> >>And the syntax error is reported where ?
> >>
> >>Paul Watson
> >>Tel: +44 1414161772        +1 913-400-2620
> >>Mob: +44 7818003457        +1 913-636-2858
> >>Web:www.oninit.com
> >>
> >>Failure is not as frightening as regret.
> >>
> >>
> >>
> >>
> >>>-----Original Message-----
> >>>From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com] 
> >>>Posted At: 16 April 2007 04:51 Posted To: comp.databases.informix
> >>>Conversation: Stored procedure giving syntax error in different 
> >>>version of informix
> >>>Subject: Stored procedure giving syntax error in different 
> version of 
> >>>informix
> >>
> >>>Hi,
> >>
> >>>i am new to informix sql procedures..
> >>>the sql below works fine in my development box
> >>
> >>>IBM Informix Dynamic Server Version 9.40.FC8
> >>> INFORMIX-SQL Version   7.20.UD8
> >>>HP-UX B.11.11
> >>
> >>>but it throws a syntax error in testing box IBM Informix Dynamic 
> >>>Server Version 9.40.FC5W2
> >>>INFORMIX-SQL Version   7.20.UD8
> >>>HP-UX B.11.11
> >>
> >>> create procedure p (c char(20))
> >>> returning int,
> >>> char(20);
> >>
> >>>define en int;
> >>>define is int;
> >>>define r1 int;
> >>>define r2 char(20);
> >>
> >>>.
> >>>.
> >>>.
> >>>.
> >>>.
> >>
> >>>return r1,
> >>>         r2;
> >>>end procedure;
> >>
> >>>looking forward for your help.
> >>
> >>>Regards
> >>>Raghu- Hide quoted text -
> >>
> >>- Show quoted text -
> > 
> > 
> > I am using dbaccess only. below is the error.
> > 
> >    201: A syntax error has occurred.
> > 
> > create procedure p (c char(20))
> >  returning int,
> >  char(20);          --------- The cursor points to this line.
> > 
> > 

0
Paul
4/17/2007 2:54:38 PM
Paul Watson wrote:
>>-----Original Message-----
>>From: Art S. Kagel [mailto:kagel@bloomberg.net] 
>>
>>raghu.shivaiah@gmail.com wrote:
>>
>>>On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
>>
>>Your CREATE PROCEDURE .... RETURNING... should end in a semi 
>>colon not a comma:
>>
>>create procedure p (c char(20))
>>   returning int;
>>char(20);
>>
> 
> 
> Disagree, to return two variables they are comma separated
> 
> 
> <SNIP>
You're right Paul.  I thought the 'char(20) was declaring a variable.  Read 
too quickly.

Art S. Kagel
0
Art
4/17/2007 10:14:41 PM
Reply:

Similar Artilces:

How to copy a sun-database in one informix database to another informix database?
Hi, Sorry I am not an informix dba, and I was faced to copy a sub-database(sorry I don't know the clear name of such concept, as informix is like sql-server, which used multiple database) from one informix database system to another informix database. I know in oracle, we can use transportable tablespace, copy the datafile and transport the metadata, and do something else. How can I do it in informix then? Is there document which talk about the detail step? Thanks It would really help if you knew the versions of the Informix databases. Assuming Informix IDS 7.x or IDS...

Error executing remote system command on an AIX Informix database from an NT Informix Server
Dear All, I realise there are many queries and answers already posted on a similar topic, but none seem to be able to get this working. I have two informix servers, one on Windows NT and one on AIX 4.3. Informix NT (7.31) Informix AIX (7.xx) I have a stored procedure on the unix box with a system command SYSTEM '/usr/bin/ksh /usr/bin/env > /tmp/mylog' I have set up the trust, so that I can connect to the AIX instance as informix from the NT server. I connect from the NT server to the AIX instance as informix and execute the procedure. I get the followin...

get syntax error when loading data to a informix database
Hi I have ids 9.4 oon windows and csdk. l successfully connected to the database using Visula Basic 6. When l build a string for example SQL1 = "select * from hse2 where field1 matches " & "'a*' and execute using : DbaseConn.Execute (SQL1) it works fine. When l try to load data to a table : SQL1 = "load from " & " 'd:\x.unl' " & " insert into hse2" or SQL1 = "load from 'd:\x.unl' insert into hse2 I get a syntax error -201. Anyone know why. Thanks in advance Umesh "Umesh" <...

[OdbcException: ERROR [HY000] [Informix][Informix ODBC Driver][Informix]Transaction not available.]
I 've connected to informix database. i want to begin an odbc transaction in my C# code. then the error occured. ERROR [HY000] [Informix][Informix ODBC Driver][Informix]Transaction not available. pls help me, How can i solve this problem? is it needed to especial setting in the informix db? thanks alot, for the problem, i set the informix : no log--> log and the problem 's solved. Mahta On 31 Dec 2006 23:05:58 -0800, Mahta <mahbahj@gmail.com> wrote: > I 've connected to informix database. i want to begin an odbc > transaction in my C# code. t...

Re: get syntax error when loading data to a informix database
Umesh wrote: > Hi > I have ids 9.4 oon windows and csdk. l successfully connected > to the database using Visula Basic 6. > When l build a string for example > SQL1 = "select * from hse2 where field1 matches " & "'a*' > and execute using : DbaseConn.Execute (SQL1) it works fine. > > When l try to load data to a table : > SQL1 = "load from " & " 'd:\x.unl' " & " insert into hse2" > or > SQL1 = "load from 'd:\x.unl' insert into hse2 > > I get a synta...

ERROR [HY000] [Informix][Informix ODBC Driver]General error
I have this tables: create table 'informix'.corporatemenuelements ( menuid NVARCHAR(128) not null, caption NVARCHAR(255), type NCHAR(1), address NCHAR(2048) ) extent size 32 next size 32 lock mode row; alter table 'informix'.corporatemenuelements add constraint primary key (menuid) constraint pk_corporatemen269; from .net with odbc data provider i try: String sql =3D "INSERT INTO CorporateMenuElements (MenuId, Caption, Type, Address) VALUES (?, ?, ?, ?)"; DbCommand cmd =3D DB.GetSqlStringCommand(sql); DB.AddInParameter(cmd, "MenuId", DbType.String, menuId); DB.AddInParameter(cmd, "Caption", DbType.String, caption); DB.AddInParameter(cmd, "Type", DbType.String, type); DB.AddInParameter(cmd, "Address", DbType.String, address); Int32 mustBeOne =3D DB.ExecuteNonQuery(cmd); I get: System.Data.Odbc.OdbcException was unhandled Message=3D"ERROR [HY000] [Informix][Informix ODBC Driver]General error." Source=3D"iclit09b.dll" ErrorCode=3D-2146232009 StackTrace: en System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) en System.Data.Odbc.OdbcConnection.Open_EnlistTransaction (Transaction transaction) en System.Data.Odbc.OdbcConnectionOpen.EnlistTransaction (Transaction transaction) en Sys...

Re: get syntax error when loading data to a informix database #2
Umesh said: > Hi > I have ids 9.4 oon windows and csdk. l successfully connected > to the database using Visula Basic 6. > When l build a string for example > SQL1 = "select * from hse2 where field1 matches " & "'a*' > and execute using : DbaseConn.Execute (SQL1) it works fine. > > When l try to load data to a table : > SQL1 = "load from " & " 'd:\x.unl' " & " insert into hse2" > or > SQL1 = "load from 'd:\x.unl' insert into hse2 > > I get a syntax error -201. Anyone know why. Because the LOAD statement is specific to DBACCESS, not SQL. -- Bye now, Obnoxio "C'est pas parce qu'on n'a rien � dire qu'il faut fermer sa gueule" - Coluche "I'm trying to see things your way, but I can't get my head up my ass" - JCH "Ogni uomo mi guarda come se fossi una testa di cazzo" - Marco I went to the airport to check in and they asked what I did because I looked like a terrorist. I said I was a comedian. They said, "Say something funny then." I told them I had just graduated from flying school. -- Ahmed Ahmed sending to informix-list ...

Re: get syntax error when loading data to a informix database #3
The second form should work. What are you using as a field delimiter? Informix defaults to a pipe "|". If you are using some other character you will need to include the delimiter phrase ... LOAD FROM "pathname" [DELIMITER "char"] INSERT INTO table-name commbtp@lineone.n et (Umes...

ANNOUNCE: DBD::Informix
IBM Informix Database Driver for Perl DBI Version 2005.01 (2005-03-14) has been uploaded to CPAN. IBM Informix Database Driver for Perl (also known as DBD::Informix) is the driver code that enables Perl 5.6.1 or later to access Informix databases via the DBI module (but if you are not already using Perl 5.8.5, you should be planning to upgrade to it). You will need the code for DBI version 1.38 or later as well (v1.48 recommended). The code for DBD::Informix is available for download via: http://www.perl.org/CPAN/modules/by-category/07_Database_Interfaces http://dbi.perl.org/ ** When you...

SQLS7&VB6 Date Update Gives Syntax (Not Date Format) Error In Stored Procedure
Hi, I have a problem with updating a datetime column, When I try to change the Column from VB I get "Incorrect syntax near '942'" returned from [Microsoft][ODBC SQL Server Driver][SQL Server] '942' is the unique key column value However if I update any other column the syntax is fine The same blanket update query makes the changes no matter what is updated The problem only happens when I set a unique key on the date field in question Key is a composite of an ID, and 2 date fields If I allow duplicates in the index it all works perfectly I am trying to trap '...

How can I get different Match Patterns in data stored in BLOB (Text) Variable in INFORMIX Database ?
Hi All, How can I get different Match Patterns in data stored in BLOB(Text)Variable in INFORMIX Database ? For Example : Suppose in my Database named "Employee" in INFORMIX ,there is a BLOB Text Field named "Address".I want to write a SQL Query to search different Match Patterns for data stored in that BLOB Address field. When I use "Select" statement using "like" with search patterns,it produces error with "error no -615 ". Can we have Alternate Solutions also ? Regards, Durgesh Sharma On Tue, 26 Oct 2004 08:07:03 -0400, ...

informix databases (dbaaccess)(Informix-SE)
How to get the informix databases. i tried to get from net but i didnot get . the ibm site is asking for password. how can we get it . i am asking this because we can de database acess from unix shell scrpting using informix databses. do any one know how to install and download the dbaaccess or informix SE. uday <kariudaykiran@yahoo.co.in> wrote: > How to get the informix databases. i tried to get from net but i didnot > get . the ibm site is asking for password. Type your password. > how can we get it . i am asking this because we can de database acess > from unix shell ...

Informix Stored Procedure
Hello! I am using Informix 7 se and having problems with updating the stored procedure everytime I run it. Basically, I have made changes to the sql file that drops and create a store procedure, but it still shows outputs from the old copy of the same stored procedure. The only way I am able to see changes in the results is by creating a stored procedure with a different name. I am using DBACCESS to create and execute my stored procedure. Pls help. Thanks, Ahmer sending to informix-list On Fri, 12 Sep 2003 16:13:52 +0800, "Ahmer Sajjad" <ahmer@conceptf...

Stored procedure in database X, executes stored procedure in database Y, wrapped in transaction?
Is it possible to execute a stored procedure in one database, which then itself executes a stored procedure from another database? We have decide to split our data into a tree structure (DB1) and data blobs (DB2) (we are using MSDE and we have a 2gb limit with each DB so we've done it this way for that reason). I would like to, say, execute a stored procedure in DB1, passing in the data blob and other details, DB1 will create a tree node in DB1 and then add the blob record to DB2. DB1 will wrap in a transaction of course, as will DB2 when it adds the blob. Is this possible? [poste...

.NET TransactionScope -> ERROR [HY000] [Informix][Informix ODBC Driver]General error
Hi using Microsoft Enterprise Library Data access App Block i have this code using (TransactionScope scope =3D new TransactionScope(TransactionScopeOption.Required)) { Database db1 =3D new GenericDatabase( ConnStringBuilder.ConnString, OdbcFactory.Instance); String sql1 =3D "insert into test_text values (51, 'holas1')"; db1.ExecuteNonQuery(CommandType.Text, sql1); scope.Complete(); } The ExecuteNonQuery causes this exception: No se control=F3 System.Data.Odbc.OdbcException Message=3D"ERROR [HY000] [Informix][Informix ODBC Driver]General error." Source=3D"iclit09b.dll" ErrorCode=3D-2146232009 StackTrace: en System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) en System.Data.Odbc.OdbcConnection.Open_EnlistTransaction(Transaction transaction) en System.Data.Odbc.OdbcConnectionOpen.EnlistTransaction(Transaction transaction) en System.Data.Odbc.OdbcConnection.EnlistTransaction(Transaction transaction) en System.Data.Odbc.OdbcConnection.Open() en Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection() en Microsoft.Practices.EnterpriseLibrary.Data.TransactionScopeConnections.GetCo= nnection(Database db) en Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnect...

Difference between Informix connect and Informix Client SDK
Does Somebody would tell me the difference between those Informix products? And the estimated cost of each one (for Linux) ? Thanks in advance regards sending to informix-list Go to http://www-3.ibm.com/software/data/informix/tools/ The Client SDK can be downloaded from there for free. "Francisco Roldan" <froldan@5b.com.gt> wrote in message news:bef377$h7m$1@terabinaries.xmission.com... > > Does Somebody would tell me the difference between > those Informix products? > > And the estimated cost of each one (for Linux) ? > &...

Storing all stored procedures in one database to minimize different connection strings
In order to minimize the number of connection strings I have to use to access different databases on the same Sql Server, I was considering storing all stored procedures in just one database. I want to do this because connection pooling in my application - ASP.NET is based on this connection string. So if I need to access 6 different databases on one sql server & set 6 different connection strings, I end up creating 6 different connection pools. Other than it might create more management work for the DBA, are there any performance implications with implementing this scheme? Do stored p...

Syntax error in stored procedure
Hi, I have problems with one stored procedure that I am trying to develop in my informix database. The procedure is at folloews create procedure updateFlags(emp LIKE employee.idEmployee,check like dailycheck.checkdate) DEFINE selected integer; FOREACH cursor FOR select first 1 iddailycheck into selected from dailycheck DC where DC.idEmployee=emp and DC.checkdate=check and DC.modificationtype='PLANNED' order by DC.modificationdate desc; update dailycheck set lastPlanned=1 where iddailycheck=selected; ...

Stored procedure syntax error
Hello everybody. I know this is kind of lame problem, but I realy cannot get over it. So, I want create a procedure: CREATE PROCEDURE delete_subject_if_no_program(subjectoid INT) DEFINE ref INT; LET ref=(SELECT count(*) FROM dbs_sub_spr_relation WHERE ssr_sub_oid=subjectoid); IF ref=0 THEN ---SOME DELETE STATEMENTS END IF; END PROCEDURE; The problem is I always get a syntax error. The problem is for sure in the IF statement itself. even i try CREATE PROCEDURE delete_subject_if_no_program(subjectoid INT) DEFINE ref INT; LET ref=(SELECT count(*) FROM dbs_sub_spr_relation WHERE ssr_sub_oid=subjectoid); IF ref=0 THEN LET ref=1; END IF; END PROCEDURE; im getting a syntax error. I searched the web but nothing. Please, any ideas are welcomed. I will appreciate any help thx. Martin Try: CREATE PROCEDURE delete_subject_if_no_program(subjectoid INT) DEFINE ref INT; SELECT count(*) into ref FROM dbs_sub_spr_relation WHERE ssr_sub_oid=subjectoid; IF ref=0 THEN LET ref=1; END IF; END PROCEDURE; Superboer. On 22 mei, 10:13, MartinJe...@gmail.com wrote: > Hello everybody. > I know this is kind of lame problem, but I realy cannot get over it. > So, I want create a procedure: > > CREATE PROCEDURE delete_subject_if_no_program(subjectoid INT) > DEFINE ref INT; > LET ref=(SELECT count(*) FROM dbs_sub_spr_relation WHERE > ssr_sub_oid=subjectoid); > IF ref=0 THEN > ---SOME DELETE STATEMENTS ...

Stored Procedure Syntax error.
I have this statement in a SQL file. CREATE PROCEDURE HAPPINESS (IN player BIGINT, IN turn INT) BEGIN UPDATE something SET something=player; UPDATE something2 set something2=turn; END; When I run this command: bash$ mysql -p table < storedprocedure.sql I get this error. ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE something SET something=player;' at line 3 If i take out the BEGIN and END it works fine, but only includes the first UPDATE statement. The second one get ommited. Which is expected. It seems to have something to do with the BEGIN statement and I can't seem to figure it out. Any Suggestions? "Ryan Knopp" wrote ... >I have this statement in a SQL file. > > CREATE PROCEDURE HAPPINESS (IN player BIGINT, IN turn INT) > BEGIN > UPDATE something SET something=player; > UPDATE something2 set something2=turn; > END; > > When I run this command: > > bash$ mysql -p table < storedprocedure.sql > > I get this error. > ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; > check the manual that corresponds to your MySQL server version for the > right syntax to use near 'UPDATE something SET something=player;' at > line 3 > > If i take out the BEGIN and END it works fine, but only includes the > first UPDATE statement. ...

stored procedures
Hi all, I am using mysql 5.0.54, i want to create procedure, i tried an example in mysql link "CREATE PROCEDURE sp1 (x VARCHAR(5)) BEGIN DECLARE xname VARCHAR(5) DEFAULT 'bob'; DECLARE newname VARCHAR(5); DECLARE xid INT; SELECT xname,id INTO newname,xid FROM table1 WHERE xname = xname; SELECT newname; END;" but i see an error "ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3", In all links &...

Informix stored procedure #2
Sorry Informix newbie !!! I need to create a stored procedure, but keep getting a syntax error. Error message : Error: A syntax error has occurred. (State:37000, Native Code: FFFFFF37) The code is : create procedure test() DECLARE lv_tk CHAR(15), ln_tk_count INT declare get_timekeeper CURSOR FOR SELECT tkinit FROM timekeep WHERE tktmdate IS NULL foreach get_timekeeper INTO lv_tk SELECT COUNT(*) INTO lv_tk_count FROM bo_calendar boc WHERE NOT EXISTS ( SELECT 1 FROM timecard tc1 WHERE tc1.ttk = lv_tk AND tc1....

Convert Informix Stored Procedure
I would like to convert a couple informix stored procedures to SQL Server stored procedures. I have no idea how to accomplish this. Here is an example of one of the procedures I need to convert. drop function mnaf_calc_calendar_quarter; CREATE FUNCTION mnaf_calc_calendar_quarter(pEndDate Date) --***************************************************************************** -- Name: mnaf_calc_calendar_quarter -- Description/Notes: -- Calculates the most recent calendar quarter based on the end date. -- -- Parms: -- End Date. -- Returns: -- The calculated period start date and end date. -...

Re: Informix Stored Procedure
Ahmer Sajjad wrote: > Hello! > > I am using Informix 7 se and having problems with updating the stored > procedure everytime I run it. > > Basically, I have made changes to the sql file that drops and create a store > procedure, but it still shows outputs from the old copy of the same stored > procedure. The only way I am able to see changes in the results is by > creating a stored procedure with a different name. I am using DBACCESS to > create and execute my stored procedure. Have you updated statistics for the procedure after recreating it? ...

Web resources about - Stored procedure giving syntax error in different version of informix - comp.databases.informix

Parliamentary procedure - Wikipedia, the free encyclopedia
... of the House of Commons of the Parliament of the United Kingdom , from which it derives its name. In the United States, parliamentary procedure ...

Eye tattoos: Tattooist Luna Cobra defends practice following calls to ban procedure
IT SOUNDS like the really gross scene in a horror movie.

Rushed cosmetic procedures a 'recipe for disaster'
&#8203;When Chanelle O'Hare went searching online for a deal on potential cosmetic procedures, she could not have imagined that what she ended ...

Jetstar procedures under investigation after planes took off too heavy
Jetstar's procedures for calculating the weight of its aircraft are under review by the Australian Transport Safety Bureau after two of its planes ...

Survivors of female genital mutilation outraged by 'compromise' which could legalise procedure
Survivors of female genital mutilation are fighting back against a so-called compromise, which could let a modified form of the procedure continue. ...

Doctors Perform Medical Procedure On Wrong Newborn
The procedure was meant for another child.

Old Lady Lawyer: Uncivil Procedure
What is some of the worst behavior you've witnesses by attorneys?

NFL Announces Changes to Officiating Procedures for Playoffs - Bleacher Report
The NFL formally approved changes to its postseason officiating procedures to allow referees the opportunity to consult Vice President of Officiating ...

We need to reform the culture of law enforcement, not just the procedures
We need to reform the culture of law enforcement, not just the procedures by digby I have a new piece up at Salon this morning about police ...

Rescued tiger cub "Himmel" dies during medical procedure - CBS News 8 - San Diego, CA News Station ...
Alpine animal rescue sanctuary Lions, Tigers & Bears is sadly reporting Himmel, the tiger cub found roaming the streets of Hemet and rescued ...

Resources last updated: 2/27/2016 5:52:34 AM