help with mysql query..

ahmed anas

Proficient
Feb 26, 2010
588
0
21
Lahore, Model town
salam, hey guys, was hoping u could help me out...

ok i do know some sql, but im new to mysql... and theres this simple query that i just cant figure out whats wrong with it...

CREATE PROCEDURE inserttoscrapbookSD
(owner1 VARCHAR(50),
poster1 VARCHAR(50),
Scrap1 VARCHAR(50),
Date_time1 DECIMAL,
InsertedOrNot DECIMAL
)
BEGIN

INSERT INTO scrapbook (Owner)

VALUES(owner1)

END
i know there are a lot of variables being passed, but just using one variable atm because if it works for one, itll work for all.. i tried with and without a semicolon ( ; ) at the end of "END" but no luck.. it says

#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 'END' at line 14
 
Last edited:

umairhaque

Talented
Nov 19, 2009
51
0
11
Boss i think issue in Date_Time you are passing in Decimal format and time format is different than that... I did not use mysql.. but i use sql.
 

umar

Intermediate
Jun 13, 2007
143
0
21
I never used stored procedures in mysql so im not sure, but i think the delimiter is causing the problem. try this

Code:
[INDENT]
mysql> DELIMITER $$
[/INDENT]
Note that there is no semicolon after the ‘$$’ symbol, which we will use as the delimiter for our purposes. 
You have to choose a delimiter that does not appear in your procedure, and it can be more than one character.[INDENT]
mysql> CREATE PROCEDURE usp_ins (P VARCHAR(10))    
-> BEGIN   
->  SET @x=CHAR_LENGTH(P);    
->  SET @y = HEX(P);    
->  INSERT INTO tmptest(id,txt) VALUES(@x,@y);    
-> END$$

Query OK, 0 rows affected (0.05 sec)

mysql> CALL usp_ins('ABC');   
 -> $$Query OK, 1 row affected (0.00 sec)[/INDENT]
so you need to set the delimiter and use "@" in values in your insert statement, hope this helps
 
General chit-chat
Help Users
IMPORTANT: Please Change Your Passwords to avoid being botted. | Click for Discord
  • No one is chatting at the moment.
  • Chandoo Chandoo:
    LegacyGamerGuy said:
    Gradually transitioning from console gaming to PC as the games are not worth it. 6 hours of Hellblade 2 is just not worth the $50 price tag.
    Score 1 for game pass. I wouldn't pay full price for this at retail either.
    Link
  • L LegacyGamerGuy:
    Gradually transitioning from console gaming to PC as the games are not worth it. 6 hours of Hellblade 2 is just not worth the $50 price tag.
    Link
  • L LegacyGamerGuy:
    Just downloaded my first legit digital PC game on GoG at a discount of $8: Two Point Hospital. The same team behind Theme Hospital Two Point Studios now part of Sega. And I am having more fun than most recent AAA games except of course BG3.
    Link
  • Chandoo Chandoo:
    gottdamnnn HB2 looks amazing. UE5 finally living up to its potential.
    Link
  • L LegacyGamerGuy:
    Still, I don't like either Sony or Microsoft as they are focusing more on corporate greed than delighting customers. PC gaming is best of gaming and worth every penny.
    Link
  • L LegacyGamerGuy:
    PC Gamer score of 58/100 for Hellblade 2??? Is it really worse than Gollum that was 64/100? Microsoft games can't even come close to high scores of Sony exclusives apparently.
    Link
  • Necrokiller Necrokiller:
    Chandoo said:
    Hellblade 2 83 OpenCritic, not bad at all. 2 points higher than the first game.
    first one is 84 Opencritic. Saga dropped to 82.
    Link
  • Necrokiller Necrokiller:
    Saeen abhi tak to first one was better in every way. Atleast the first hour-ish
    Link
  • Chandoo Chandoo:
    Hellblade 2 83 OpenCritic, not bad at all. 2 points higher than the first game.
    Link
  • L LegacyGamerGuy:
    About the Microsoft (and Sony) debate, I feel both have become too greedy and losing their minds over corporate greed. Personally, I will never buy any console next gen and switch to PC gaming where democracy reins.
    Link
  • L LegacyGamerGuy:
    No news about Google Play Store hacking. What is the source?
    Link
  • Link
  • Aciel Aciel:
    This is the error.
    Link
  • Aciel Aciel:
    Online session is enabled for UBL. I have an active subscription with my NayaPay card (it is already added to Google Payment Methods).
    Link
  • B Baghi:
    did you try setting up Google Payments? For UBL you may have to get it enabled for internet transactions, Naya should work without it!
    Link
  • Aciel Aciel:
    I tried both NayaPay, and UBL, but I keep getting "correct country selected..." error. I already have PK set there 🤦‍♂️
    Link
  • Aciel Aciel:
    Baghi said:
    Link
  • B Baghi:
    Yes
    Link
  • Aciel Aciel:
    Does your VISA Cards work on Google Play Store?
    Link
  • M murtaza12:
    XPremiuM said:
    Why? Was the site hacked or something?
    Yes
    Link
  • XPremiuM XPremiuM:
    GloriousChicken said:
    Everyone, please change your passwords.
    Why? Was the site hacked or something?
    Link
  • GloriousChicken GloriousChicken:
    Everyone, please change your passwords.
    Link
  • Necrokiller Necrokiller:
    The only valid thing from his pov he said in the video is AC dead since Black Flag. According to woke police that game was woke too. Welsh man in West Indies. So atleast he's consistent I guess lol
    Link
  • Link
  • XPremiuM XPremiuM:
    Necrokiller said:
    It's based on an actual real life person so I don't think the woke police have a valid case here.
    Nope. They have a very valid case. The above video explains it all.
    Link
    Chandoo Chandoo: Gradually transitioning from console gaming to PC as the games are not worth it. 6 hours of...