Results 1 to 8 of 8

Thread: about SQL

  1. #1
    Join Date
    Jun 2012
    Location
    Iran , Tehran
    Posts
    93
    Thanks
    5
    Platforms
    Unix/X11 Windows Android

    Smile about SQL

    hi all
    what is the syntax to use a UPDATE within a function ??

    thanks
    Life is about making the right decisions and moving on.

  2. #2
    Join Date
    Jun 2010
    Location
    Pretoria, South Africa
    Posts
    22
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: about SQL

    UPDATE syntax is the same whether you're inside a function or not.

  3. #3
    Join Date
    Jun 2012
    Location
    Iran , Tehran
    Posts
    93
    Thanks
    5
    Platforms
    Unix/X11 Windows Android

    Default Re: about SQL

    No , i think this is difference. bkz gives error.
    Life is about making the right decisions and moving on.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: about SQL

    No, the syntax is the same.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jun 2012
    Location
    Iran , Tehran
    Posts
    93
    Thanks
    5
    Platforms
    Unix/X11 Windows Android

    Default Re: about SQL

    but the following code gives me some error
    Qt Code:
    1. create function myfunc (@S# int , @Grade dec(5,2))
    2. returns int
    3. as
    4. begin
    5. update std
    6. set garde=@grade
    7. where s# = @s#
    8. end
    To copy to clipboard, switch view to plain text mode 
    Life is about making the right decisions and moving on.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: about SQL

    What about the semicolons?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jun 2012
    Location
    Iran , Tehran
    Posts
    93
    Thanks
    5
    Platforms
    Unix/X11 Windows Android

    Default Re: about SQL

    in SQL semicolons is optional.
    Life is about making the right decisions and moving on.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: about SQL

    Quote Originally Posted by Ali Reza View Post
    in SQL semicolons is optional.
    Not really.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.