Dynamic SQL Error SQL error code = -104 Token unknown in procedure

Hi all,
I'm a newbie.

I test my procedure in SQL interactive  but got error:
--------------------------------------------------------
Error at line 1
Dynamic SQL Error
SQL error code = -104
Token unknown - line 5, char 3
:
SQL - CREATE PROCEDURE CreateNewSystem(NewSystemID VarChar(10), CurrentSelection Int, NewSystemName VarChar(20), CheckChild Boolean)
AS
DECLARE VARIABLE LeftRightValue INTEGER;
begin
	IF :CheckChild THEN
		SELECT LeftRightValue = lft FROM "MEP_SYSTEMS"
			WHERE category_id=:CurrentSelection;
	ELSE
		SELECT LeftRightValue = rgt FROM "MEP_SYSTEMS"
			WHERE category_id=:CurrentSelection;
	UPDATE "MEP_SYSTEM" SET rgt = rgt + 2 WHERE rgt > LeftRightValue;
	UPDATE "MEP_SYSTEM" SET lft = lft + 2 WHERE lft > LeftRightValue;
	INSERT INTO "MEP_SYSTEM"(system_id,system_name, lft, rgt)
                       VALUES(:NewSystemID,:NewSystemName, LeftRightValue + 1, LeftRightValue + 2);
end ^
--------------------------------------------------------
I try change the name (CheckChild --> Child), the error still same, put ":CheckChild" in paratheses (), the error still the same.

What is wrong? Please help
-1
Nguyen
6/16/2013 1:25:21 PM
embarcadero.delphi.interbase 331 articles. 1 followers. Follow

0 Replies
1602 Views

Similar Articles

[PageSpeed] 46

Reply:

Similar Artilces:

CIFs Error: Storage Error Unknown error with error code: -602
Server was an Identity Migration target (source single server tree nw6sp5/edir8737/gw8hp1 to oes2sp1x64+latest patches), but I have been having problems with getting cifs to work since the migration. Whenever I go into iManager, file protocols, cifs & try to make any change other than stopping/starting the service I get the error in the subject (even to change something simple like the comment). Other oddities I noticed since the actual IM swap that somehow might have something to do with this: users arent LUM enabled or so it seems the afpProxyUser- & cifsProxyUser- both...

SQL syntax error using dynamic SQL
I have below code:    set @SQL='(select top 1 @idOUT = id from prospects where result=0' + @SQL_excludeprospects + ' order by id ASC)'    print @SQL    SET @ParmDefinition = N'@idOUT int OUTPUT';    EXECUTE sp_executesql @SQL, @ParmDefinition, @idOUT=@id OUTPUT;    SELECT @id; I get this output:(select top 1 @idOUT = id from prospects where result=0 AND id<>2 AND id<>6 AND id<>9 order by id ASC)Msg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'order'.I do...

Clustering error
To whom it may concern We are using SLES SP1- OES2.We have 4 cluster nodes and 8 existing cluster resources. When we want to create a new cluster resource, we follow the following under mentioned steps. > Select cluster Options > Select new resource > resource > next > add new cluster resource name > inherit frame template - select template Generic IP > Define additional properties > next - load script > next - unload script > next - monitor script > next - resource policies > resource preferred nodes > finish Then it shows the foll...

SQL statement failed: (-305) I/O error Fatal error: A disk read from file "SomeDatabase.db" failed with error code: (38)
SQL Anywhere 10.0.1.3831 E. 2009-09-11 21:55:41. SQL statement failed: (-305) I/O error Fatal error: A disk read from file "D:\FHMSL\iFHMS\Data\Feedlot111.db" failed with error code: (38) -- transaction rolled back E. 2009-09-11 21:55:41. Error while executing hook procedure sp_hook_dbmlsync_end. Received this error while running a proc during sync. Tried to validate the db in Sybase Central resulting in the same error. I saw the post at http://groups.google.com/group/sybase.public.sqlanywhere.general/browse_thread/thread/b5d958904160e576?fwc=1 and am wondering if th...

sql stored procedure ( code error )
hello guys.....I am new to writing stored procedures and pretty weak in sql , but I am writing this sql sp and it gives me error ( near as , near if ) please if someone can make it correct for me I'd be really helpful , what am trying to do is 3 types of searching , by uploadername , by id , by name ...search by id is a bit complicated , that when someone enters the id , it'll show the file related to that id , plus all files who has higher id number , and has the same uploaderCREATE PROCEDURE display_results @Name varchar(120),@Uploader varchar(50), @ID int, AS IF ( @ID != NU...

Capturing SQL error codes in Delphi
Anyone know if it is possible to get the SQLERROR or SQLSTATE codes back in Delphi? After an error, you can issue the following queries. select SQLCODE or select SQLSTATE Chris Dean Wooldridge wrote: > Anyone know if it is possible to get the SQLERROR or SQLSTATE codes back in > Delphi? >Anyone know if it is possible to get the SQLERROR or SQLSTATE codes back in >Delphi? There may be more direct ways, but you could always SELECT SQLSTATE INTO somevariable; But keep in mind that this must be the first statement following the failure, as ...

PB Runtime error
I have an PB 7 application, build 8033, where when we run it in the development enviroment it runs fine, but when we try to do an Query by Example with the executable, the application fails with this error. We are using informix 7.03 as our database. Any ideas? Thanks George We tried this on a couple of other non powebuilder development machines, and the application runs fine. It appears either to be an invalid .dll on that machine or an issue with Citrix and PB702. Anyone else using PB702 and Citrix? THanks George Can you get the SQL-Syntax? geocal99@ya...

error error error
These are the 2 new errors i am getting now:   1).  Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error: Line 53: ...

Error, Error and more errors
Okay, all I wanted to do was test this app out and it has been a nightmare. 1.) Didn't install the sql database. I had to manually install it. 2.) I get errors when trying to add a picture to an album. "Procedure or function ngUpdatePicture has too many arguments specified" Any ideas? I've gotten more errors than this, but there is no use in bitchin. Are you using the v1.6.1 installer? Also, did you select to install the SQL Server db and give it a valid admin login? What were some of the error messages? Did you have an existing DB from a previous install? ...

errors errors errors..
Name: harun Email: harunbjk1903hrnatgmaildotcom Product: Firefox Summary: errors errors errors.. Comments: first of all when i launch firefox (3) i cant enter websites via writing.. for example when I type "google" and then press ctrl and enter, it crashes.. and i take lots of error reports. firefox 2 was better.. see you again , harun Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

SQl Server Error: ----> Named Pipes Provider, error: 40
  Hi Friends, Im using .Net2008 and MS SQL Server2005, I Have a web application , i want to connect to the server machine SQL Server,  When i run the application im getting the following error. Im trying to connect to the database from local machine application to server machine database   An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Cou...

"SQL Error: Error mapping failed" with Delphi 6 Application and DBExpress
Im using Delphi 6, Firebird 2.x, dbExpress The problem is only with remote database connection and not with local connection. The following connection gives and error Database := MyServer:C:\DEMO.FDB But when locally connected i.e database in the same computer Database := C:\FBdatabases\dbAccounts.FDB Following solution from Firebird forun worked ----------------------------------------- Actually, the issue is inside Borland's DBX driver for InterBase. It's not very much compatible with Firebird. First of all, it uses some internal (metadata) queries in the...

Problem with SQL Server connection string - provider: SQL Network Interfaces, error: 26
Hi Guys, I am having a wierd problem. The system works perfectly when I am connected to the local network but throws the above error when I disconnect it from the network. Given below are my connectionstrings: integrated security=false;user id=U1;data source=localhost;persist security info=False;password=pwd1;initial catalog=MyDB //connection string to my database Data Source=localhost;Initial Catalog=aspnetdb;User ID=U2;Password=pwd2 //connectionstring to aspnetdb for webparts I have also changed all the providers (SQLMembership, SQLProfile, SQLRole) to use LocalSQLServer and comme...

Connecting to sql server 2000 on Godaddy error: (provider: Named Pipes Provider, error: 40
Facts:1. I am using my account on Godaddy trying to connect to my sql server db.2. I can get into my db using user id and password.3. Godaddy's help file shows this for a connection string: connectstr = "Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" &db_name & ";UID=" & db_username & ";PWD=" & db_userpassword4. My connection string: "Server=whsql-v09.prod.mesa1.secureserver.net;uid=dbasolutions;pwd=***;database=DB_87972;"  & _                    "Trusted_Connecti...

Error using OdbcDataReader.ExecuteReader and Parameters...ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable
This seems to be a common problem but I have not seen any answers yet on this board.   I am porting over to using odbc because I have no choice with my Hosting company,  I was using basically the same code with the SQLDataReader and SQLCommand object and it was fine.  The below code will generate the error.  Help !! Unexpected exception: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@Role'.. string sql = String.Empty ;sql = "Select * from Associate where Role=@Role and Exit_Date > @Exit_Date";string connString = getConn...

Web resources about - Dynamic SQL Error SQL error code = -104 Token unknown in procedure - embarcadero.delphi.interbase

Invasiveness of surgical procedures - Wikipedia, the free encyclopedia
There are three main categories which describe the invasiveness of surgical procedures . These are: non-invasive procedures , minimally invasive ...

Procedure is more a snap than a snip
A QUEENSLAND doctor is bidding to set an unusual world record by performing the highest number of vasectomies in one day, with the help of fellow ...

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 ...

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 ...

Will Paul Ryan Make His Mark As Speaker By Instituting Impeachment Procedures Against President Obama ...
Wisconsin Ayn Rand devotee Paul Ryan just started his new job as Speaker of the dysfunctional House Republicans. And he's already headed for ...

TSA Updates Screening Procedure, Will Mandate Some Passengers Use Full-Body Scanners
... Imaging Technologies, or AIT, in favor of full-body pat-downs by TSA agents. Under the new mandate, not everyone can opt for the pat-down procedure. ...

'Painless' dental cavity procedure regrows tooth enamel
... "cavity" a lot of people sweat thinking about painful injections and relentless drilling. But scientists in Britain have developed a new procedure ...

Why Are Web Login Security Procedures So #$*&!% Dumb And Obnoxious?
The geeks who design our websites talk a lot about user friendliness, but they often let an exaggerated security concerns get in the way of commonsense. ...

Resources last updated: 1/2/2016 9:23:41 PM