User Profile

Collapse

Profile Sidebar

Collapse
arachno
arachno
Last Activity: Aug 15 '08, 11:19 AM
Joined: Jul 28 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Maybe you're looking for something in the likes of this:

    Code:
    SELECT direct_mngr_personnel_number, and_the_other_columns_you_need, totalcount.total_child
    FROM MyDataBase
    INNER JOIN (SELECT COUNT(*) AS total_child, direct_mngr_personnel_number FROM MyDataBase
    GROUP BY direct_mngr_personnel_number) totalcount
    ON MyDataBase.direct_mngr_personnel_number = totalcount.direct_mngr_personnel_number
    ...
    See more | Go to post

    Leave a comment:


  • arachno
    replied to VBA Oracle DB Connection String
    I'm not too familiar with VB, but maybe a C# code example may be of any help to you?

    This is how i open a connection (using OleDB though):

    Code:
     
    string oraConString = "Provider=OraOLEDB.Oracle; Data Source=helpdesk; User Id=username; Password=password;";
    OleDbConnection helpdeskConnection = new OleDbConnection();
    helpdeskConnection.ConnectionString = oraConString;
    helpdeskConnection.Open();
    ...
    See more | Go to post

    Leave a comment:


  • Debasisdas is on to something. I looked up the no cache thing and found the following which should explain the issue:

    When used in a non-cache mode, an access of a sequence which requests
    the 'nextval' will increase the current value by the number specified
    in the 'increment' section of the sequence and return the new value.
    As an example, for a sequence with a current value of zero, an
    increment of one,
    ...
    See more | Go to post

    Leave a comment:


  • I just noticed something rather strange:

    It seems to be skipping to "n1" (not without exceptions though...)
    So, it has skipped to 21, 41, 61 and 81 so far.
    See more | Go to post

    Leave a comment:


  • My sequence was defined like this:

    Code:
    create sequence SEQREQUESTID
    increment by 1
    start with 1;

    I don't have any trigger on the table for the sequence (as far as I'm aware of...?)
    I'm not sure I quite followed you on that one?
    Did you mean if there is any reference between the sequence and the table, or the ID field? The answer to that would be no. Should there be? Is...
    See more | Go to post

    Leave a comment:


  • I probably shouldn't have used the word "auto-increment". As far as I know a field can't be set to auto-increment in Oracle (as it can with e.g. MySQL). That's why I need the sequence to increment for me.

    I'll try to rephrase myself:
    What I ment was that the sequence seems to be incrementing by itself. Even if my application isn't used. So the next time the application is used, and a row is inserted, the sequence does...
    See more | Go to post

    Leave a comment:


  • arachno
    started a topic Sequence.nextval incrementing itself over time

    Sequence.nextval incrementing itself over time

    My Oracle sequences seem to be auto-incrementing themselves "over time".
    My row ID's are sequenced like this:

    Code:
    1, 4, 5, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 41, etc
    I'm using "sequencename.n extval" when inserting new rows into my tables, so one would think they'd come in a straight sequence?

    Example:

    Code:
    INSERT INTO hprequests (requestid, username, flagtype,
    ...
    See more | Go to post

  • arachno
    replied to Joining of 2 SQL queries
    Hey thanks!

    UNION did the trick indeed!

    I'll paste my final query in case someone else should be having a similar problem:

    Code:
    SELECT hprequests.requestid, hprequests.workstatus, hprequests.username, hprequests.requesttitle, hprequests.reqstatus, entries.regdate 
    FROM hprequests 
    INNER JOIN (SELECT MAX(regdate) AS latest, requestid FROM hpentries GROUP BY requestid) maxresults 
    ON hprequests.requestid
    ...
    See more | Go to post

    Leave a comment:


  • arachno
    started a topic Joining of 2 SQL queries

    Joining of 2 SQL queries

    I have managed to construct 2 separate SQL queries that basically gives me what I want. However; having them as a single query would be a great advantage as I could do an "ORDER BY" which would sort both results. As my SQL skills are getting a little rusty (to be moderate) I have been failing to combine them to 1 query.

    My tables:
    1. hprequests(requestid{PK}, username{FK}, flagtype, reqstatus, workstatus, requesttitle,...
    See more | Go to post
No activity results to display
Show More
Working...