DB Error: 1064 - 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 2

SELECT * FROM `user` the_table WHERE the_table.userid = DB Error: 1064 - 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 2

SELECT * FROM `user` the_table WHERE the_table.userid = use of variables in postgreSQL? - iTechForums
Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 3
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2008, 05:23 PM
saumya saumya is offline
Junior Member
 
Join Date: May 2008
Posts: 1
Default

use of variables in postgreSQL?


I HAVE A PROBLEM REGARDING DECLARATION/ INITIALISATION OF VARIABLES IN POSTGRESQL FUNCTIONS AND PROCEDURES. MY CODE PRESENTLY LOOKS LIKE
CREATE FUNCTION ins_into_std_values() RETURNS void AS
$BODY$
myflag CHAR(1) :='y';
dbms_output.put_line('enter the values sequentially');
loop
if myflag='n' then
exit;
end if;
insert into std_values
values('&tree_species_name','&location',&p,&c1,&c2 ,&q,&c3,&a,&b,&sp_gravity,&exp_factor);
commit;
dbms_output.put_line('records inserted sucessfully');
dbms_output.put_line('enter n to exit or y to continue entering values');
myflag:= '&y or n';
end loop;
commit;
$BODY$
LANGUAGE 'sql' VOLATILE;

BUT IT SHOWS ERROR AT INITIALISATION OF MYFLAG... CAN ANYONE TELL ME HOW TO DECLARE VARIABLES IN POSTGRESQL..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old Today, 10:53 AM
hijk869 hijk869 is offline
Senior Member
 
Join Date: May 2008
Posts: 420
Smile

斯潘


  S-斯潘  Silvio Spann   国籍:特立尼达和多巴哥  生日:1981月8月21日  身高:1米75  体重:68公斤  位置 :前卫  现效力球队:暂无  世界杯经历:无   西尔维奥-斯潘是特立尼达和多巴哥足球名宿勒罗伊-斯潘的儿子。作为将门虎子,西尔维奥攻守兼备,他精于控球和传球,并且有一脚右脚的远射。  1981年出 生的西尔维奥-斯潘曾经是特立尼达和多巴哥国奥队的队长,并入选了中北美及加勒比海地区奥运会预选赛的最佳阵容。作为特立 尼达和多巴哥队内为数不多的80年代球员,斯潘或许将为主教练本哈克所重用。不过,不管怎么样,能到世界杯 的球场上走一遭,也算是完成了职业球员的最大梦想了。
__________________
网站优化
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Forum Jump

Your Ad Here

All times are GMT. The time now is 10:27 PM.