Page 1 of 1

NWN/SQL question

Posted: Mon Nov 14, 2005 2:28 pm
by Deider
A quick question – is it possible to make a script in NWN that will automatically create a new database table for you?

Posted: Mon Nov 14, 2005 2:36 pm
by Czarcasm
Yes. You can see an example of this in the NWNX2 test mod. It just uses the SQLExecDirect() statement.

You would have to make a script like:

Code: Select all

#include "aps_include"

void main(){

    string sSQL = "CREATE TABLE STATEMENT";
    SQLExecDirect(sSQL);

}

Re: NWN/SQL question

Posted: Mon Nov 14, 2005 4:58 pm
by PlasmaJohn
Deider wrote:A quick question – is it possible to make a script in NWN that will automatically create a new database table for you?
:shock: Only if you have to, as in, if there isn't an existing admin staff and you don't have any other way of creating tables. It's a fairly invasive thing to do, some admins would get a little bent if that should happen without their knowledge.

Not saying that's what you're trying to do of course.

Re: NWN/SQL question

Posted: Mon Nov 14, 2005 6:41 pm
by Deider
PlasmaJohn wrote:Not saying that's what you're trying to do of course.
It's for the holes. Something I'm playing around with in between fishing trips and Matlock reruns. Just wondering if you could set it up so that a table would be made automatically for the buyer when they buy a hole.

Posted: Mon Nov 14, 2005 7:35 pm
by Tesh
you'd create a whole new table for a new PC hole?

Can't say that's 'wrong' without a better understanding, but IMO for this kind of thing shouldn't all PC holes just have their own rows in the PCHole table?

Posted: Tue Nov 15, 2005 10:48 am
by Deider
T'orth wrote:Can't say that's 'wrong' without a better understanding, but IMO for this kind of thing shouldn't all PC holes just have their own rows in the PCHole table?
:shock:

This is why I rode the short bus to school.

Actually, not sure if that will work - need to look at some code...