Jump to content
  • 0

SQL table resetter script


K e o u g h

Question


  • Group:  Members
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  257
  • Reputation:   170
  • Joined:  12/06/11
  • Last Seen:  

Hello, as the title says, how can i truncate a table like picklog in script command? like query_sql? 

 

its like making a menu in NPC like:

 

"Reset Picklog"

"Reset Zenylog"

 

if click the picklog the whole picklog table will reset or truncate.

 

anyone can help me please? thank you in advance!

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


prontera,150,150,5 script jopijip 75,{

setarray .@table$, "zenylog", "picklog";

.@s = select( "truncate zenylog", "truncate picklog" ) -1;

query_logsql "truncate table `"+ .@table$[.@s] +"`";

mes "you truncate table "+ .@table$[.@s];

close;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  257
  • Reputation:   170
  • Joined:  12/06/11
  • Last Seen:  

@capuche

 

THANK YOU VERY MUCH!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

how about deleting 1 column only?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

alter table drop column x;

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

alter table drop column x;

I think he wants to delete the value in 1 column lol

Use update sql command and set the default value (google please)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

hihi sorry sir|!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...