User Profile

Collapse

Profile Sidebar

Collapse
zensunni
zensunni
Last Activity: Dec 7 '08, 06:02 PM
Joined: May 17 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • zensunni
    started a topic C++ library for SQL/ODBC (non VC++)
    in C

    C++ library for SQL/ODBC (non VC++)

    Is there a library for those going the g++ route?

    I've just discovered MinGW + Qt and if I can find something really good for SQL or ODBC, then I can say goodbye to Microsoft dependency.

    The only thing I don't want to do is waste a bunch of days and have learner's remorse.
    See more | Go to post

  • zensunni
    started a topic List a number of fields

    List a number of fields

    I've often wanted to just list the first 5 or 10 fields in a select statement without typing their names out all the time. If I use "*", it's usually too wide for the sql client.

    Is there any way to just say "SELECT <the first five fields> from mytable"?

    Thanks for any help.
    See more | Go to post

  • I found an alternative.

    1. Edit the file "/etc/my.cnf":
    Under "[mysqld]", enter "max_allowed_pa cket=100000000M "

    2. Then use command:
    mysql -p'<password>' --max_allowed_pac ket=10000000M <database_nam e> < "/home/<user>/Desktop/<upload_file>.s ql"
    See more | Go to post

    Leave a comment:


  • Got a packet bigger than 'max_allowed_packet' error

    Okay...

    I got this error, so I thought, fine, I'll change the max_allowed_pac ket variable.

    So, I went to the documentation, and found this
    http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html

    But, the command it gives you for changing the packet size variable doesn't work.

    This command:
    Code:
    mysqld --max_allowed_packet=32M
    gives me the "command not found"...
    See more | Go to post

  • zensunni
    started a topic Converting an .SQL file to CSV/TSV with apache?

    Converting an .SQL file to CSV/TSV with apache?

    Apparently you can use Apache (or an Apache product?) to take .SQL database backup files and turn it into a CSV file.

    Would it be easier to install MySQL, then execute the SQL backup file, then export from the database? Or does apache have something neat that converts it directly?
    See more | Go to post

  • Thanks for the help.



    How would I do this? Can I get the insert statement to return fields after it has been executed?

    I'm using ASP....
    See more | Go to post

    Leave a comment:


  • zensunni
    started a topic Best practice for inserting many to many records

    Best practice for inserting many to many records

    This is the way I do this:

    Tables:
    Departments
    Departments_to_ employees
    Employees

    Add employee function:
    -Lock employee table
    -Insert employee
    -Search for last employee record to find newly added employee ID
    -Unlock employee table
    -Insert employee id and department id into Departments_to_ employees table

    There has got to be a better way of doing this....
    See more | Go to post

  • Never thought to put it together like that. Thanks!
    See more | Go to post

    Leave a comment:


  • You assumed that the relationship was one-to-many. That would be easy. But, this scenario is a many-to-many relationship. An employee can have more than one department and a department can have more than one employee.

    Department_to_e mployee is a lookup table....
    See more | Go to post

    Leave a comment:


  • zensunni
    started a topic how to find maximum occurences of distinct value?

    how to find maximum occurences of distinct value?

    Say we have a couple of tables like so:

    Departments_to_ Employees
    department_id
    employee_id

    Employee
    employee_id

    I want to find how many employees the department with the maximum amount of employees has.

    On other words, I want to find the department with the most amount of employees, then find out how many employees are in that department.

    Is there any...
    See more | Go to post

  • zensunni
    replied to Am I missing something about join tables?
    The inner join you used wasn't exactly what I needed, but it put me on the right path. Thanks for the help :)
    See more | Go to post

    Leave a comment:


  • zensunni
    replied to Am I missing something about join tables?
    I'll develop my question a little better.

    I'm looking to display all the categories with the reports listed underneath them. A report can be listed in multiple categories. So, a report might show up in more than one category list.
    See more | Go to post

    Leave a comment:


  • zensunni
    replied to VBScript won't run..
    I'm not sure I understand exactly. I know that anything between <%%> brackets will run asp like so:

    Code:
    <% response.write "Hello from ASP!" %>
    If I wanted to write VBScript server side, would I do this:

    Code:
    <%
    <script type="vbscript">
    document.write("Hello from VBScript!")
    </script>
    %>
    Or, does asp run certain...
    See more | Go to post

    Leave a comment:


  • zensunni
    started a topic Am I missing something about join tables?

    Am I missing something about join tables?

    Say I have a database like so:
    Code:
    USER
    user_id
    user_name
    
    REPORT
    report_id
    report_name
    
    CATEGORY
    category_id
    category_name
    
    USER_TO_REPORTS
    user_id
    report_id
    
    REPORT_TO_CATEGORY
    report_id
    category_id
    Now, If I wanted to pull out all the reports and their categories, I would have to make three...
    See more | Go to post
    Last edited by Atli; Jun 25 '08, 06:36 AM. Reason: Added [code] tags.

  • zensunni
    started a topic Secure injection defense functions.

    Secure injection defense functions.

    I'm looking to make a few asp functions to defend against attacks. The function will loop through an array, checking each item against the incoming statement. So, my question is, what are all the things I need to check for in my incoming statement?

    Here are my arrays:

    Code:
    SQLCheck=array("select", "drop", ";", "--", "insert", "delete", "'")
    ...
    See more | Go to post

  • zensunni
    replied to VBScript won't run..
    I realize now that VBScript is a CLIENT SIDE script, meaning it was only intended to run in internet explorer. Basically, it's just Microsoft's answer to javascript.

    Please correct me if I'm wrong.
    See more | Go to post

    Leave a comment:


  • zensunni
    started a topic VBScript won't run..

    VBScript won't run..

    I hope I'm in the right category, and assume that VBScript is a part of asp.net.

    Anyways, here is the code that will not run:

    Code:
    <html>
    <head>
    </head>
    <body>
    
    <script type="vbscript">
    
    document.write("Hello from VBScript!")
    </script>
    
    </body>
    </html>
    I have no idea...
    See more | Go to post

  • Ha, DrBunch,

    I've tried this with no avail. This is why I went with the assumption that the record set is looking for an actual date object. But just to make sure we're talking about the same thing, this is what I did:

    Insert("DATEBOR N") = "TO_DATE('1 1/11/08', 'mm/dd/08')"
    See more | Go to post

    Leave a comment:


  • Can I insert date into oracle using addnew and update?

    I like to use this method when inserting into a database:

    Code:
    Set Insert = Server.CreateObject("ADODB.Recordset")
    Insert.Open "test", objConn, 1, 3, 2
    Insert.AddNew
    Insert("FIRSTNAME") = "Joe"
    Insert("LASTNAME") = "bob"
    Insert("DATE_BORN") = "10/10/80"
    Insert.Update
    Insert.Close
    t RSInsert = nothing
    ...
    See more | Go to post

  • zensunni
    replied to Command hangs and doesn't end.
    Actually, I used trigger as a generic name, just for purposes of listing it here. The real name was something else.

    But, I've solved the problem. Apparently, this command needed a slash ("/") at the end.

    Thanks anyways for the post.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...