Skip to content

Database

Discussions on database access, SQL, and ADO

This category can be followed from the open social web via the handle database@forum.codeproject.com

17.1k Topics 61.8k Posts
  • EMS SQL for PostgreSQL

    database postgresql question
    2
    0 Votes
    2 Posts
    0 Views
    T
    http://www.sqlmanager.net/products/postgresql/manager
  • Oracle ALL_TAB_COLUMNS

    csharp database oracle tutorial
    6
    0 Votes
    6 Posts
    1 Views
    J
    It seems to me that the link to Tom's article is destroyed by the hamsters, so here it is as inline code: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1619552483055 "When did ignorance become a point of view" - Dilbert
  • 0 Votes
    3 Posts
    0 Views
    P
    Roll your own -- don't depend on automagic tools.
  • Migrating from Oracle to SQL

    database oracle debugging help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    J
    My first choice would be to refactor the database unless that code is touched very seldom. That sort of meta data solution is very inefficient. But after that I would use dynamic sql. You create a varchar with equivalent sql in it, specifically the extracted table name. I would probably extract the rest as well. Then you use 'execute' to execute the varchar.
  • Free "ORM" Application [modified]

    database com
    8
    0 Votes
    8 Posts
    0 Views
    S
    http://www.codeproject.com/Messages/3656304/Re-ORM-Application-and-Open-Source-database-layer.aspx
  • 0 Votes
    5 Posts
    0 Views
    D
    Hi David, the parameter will be a datetime. I need to find which date range this falls in. For example, I pass in the date 11/11/2010 and the columns are: ID StartEffDate EndEffDate Rate 1 01/01/2000 31/12/2003 1.05 2 01/01/2004 31/03/2011 1.15 3 01/04/2011 01/01/2012 1.25 I need to return the appropriate Rate, e.g. in this case 1.15
  • 0 Votes
    3 Posts
    1 Views
    T
    cancerion wrote: compare same field in two tables Your question confusing little bit. Based on my guess you may use Alias.(I think you mentioned Same field like same field name in two tables) SELECT A.*, B.* FROM TableA AS A, TableB AS B WHERE A.Field1 > B.Field1 If not then let us know & mention clear details in your question. thatraja |Chennai|India| Brainbench certifications Down-votes are like kid's kisses don't reject it :-) Do what you want quickly because the Doomsday on 2012 :-)
  • can't restore differential backup and tracsaction log.

    database help question
    2
    0 Votes
    2 Posts
    0 Views
    C
    First do not shrink the file.
  • PostgreSQL code problem

    database postgresql help tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    C
    In your where clause, resume_id = resume_id, that is the same as saying where 1 = 1. It will be true for all rows. I'd recommend changing the name of your parameter to be different from the column name. CREATE OR REPLACE FUNCTION fn_get_resume_details2(in_resume_id integer) RETURNS SETOF record AS $$select resume_id ,resume_title ,objective_title ,objective_text ,summary_title ,summary_text from resume_details where resume_id = in_resume_id; $$LANGUAGE sql; :) Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to connect VC++6 to sql server

    question c++ database sql-server sysadmin
    2
    0 Votes
    2 Posts
    0 Views
    L
    Please do not post the same message in multiple forums; choose one and stick to it. You have been a CP member long enough to know the protocol. Just say 'NO' to evaluated arguments for diadic functions! Ash
  • 0 Votes
    3 Posts
    0 Views
    H
    Thank you for your quick reply Chris. I would be having around 5 million records per month in my table. That is why I thought of partitioning the table on the basis of months to generate month-wise reports. May be I got it wrong, but my understanding was that the data would be inserted only in the child tables and not the master table. Due to the amount of data, the query being fired takes 4-5 mins to return any results (basically it is using the WITH RECURSIVE clause). I used indexes and also tried optimizing the query but it hardly made any difference. I might have to write the query in a different manner, but the problem is still with the amount of data in the table. Kindly suggest on how to resolve this issue. Thank you in advance.
  • syntax error in CONSTRAINT clause

    database csharp help tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    L
    Megidolaon wrote: My SQL string amounts to something like this "Something like that" should work. Megidolaon wrote: Can you tell me where the error is? Not without seeing your code, but I could do an educated guess. You're referring to this[^] example? The example on that page lists this code; ' Add a foreign key to the Orders table. dbs.Execute "ALTER TABLE Orders " _ & "ADD CONSTRAINT OrdersRelationship " _ & "FOREIGN KEY (EmployeeID) " _ & "REFERENCES Employees (EmployeeID);" Are you concatenating strings the same way? If so, check the resulting string - it may be missing the space at the end of each line; between "Orders" and "ADD", between "OrdersRelationShip" and "FOREIGN" and between ")" and "REFERENCES". I are Troll :suss:
  • BULK INSERT using oracle ODBC driver

    oracle question
    6
    0 Votes
    6 Posts
    0 Views
    R
    my Vote (5) Well Said.., But there is Reason behind that to Use the VB6.., Some of sectors(Govt based(most in india)) still using the Windows 98 OS with Low end Configurations :( :( :( . which is not well supported by our .Net Frameworks.., Rajesh B --> A Poor Workman Blames His Tools <--
  • insert and update

    help sharepoint tools tutorial question
    9
    0 Votes
    9 Posts
    0 Views
    M
    future3839 wrote: execute SprocInsertUpdatePerson 11,'XXX','YYY','male','1988/10/10',1200 This is an update, you passed in an ID that is > 0 This will insert a record execute SprocInsertUpdatePerson 0,'XXX','YYY','male','1988/10/10',1200 I would also return the the @ID value as the return value, it is very useful in the client. Never underestimate the power of human stupidity RAH
  • 0 Votes
    4 Posts
    0 Views
    S
    For MYSQL I use the LOAD DATA SQL. LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' [REPLACE | IGNORE] INTO TABLE tbl_name [CHARACTER SET charset_name] [{FIELDS | COLUMNS} [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY 'char'] ] [LINES [STARTING BY 'string'] [TERMINATED BY 'string'] ] [IGNORE number LINES] [(col_name_or_user_var,...)] [SET col_name = expr,...] http://dev.mysql.com/doc/refman/5.1/en/load-data.html
  • Pivot?

    database question
    14
    0 Votes
    14 Posts
    0 Views
    J
    You should consider normalizing the table. It would make it a lot easier in the future to add functionality. Consider this: CREATE TABLE Incidents ( Site varchar IncidentType varchar, IncidentDate Date, Incidentinfo varchar, ... ) Then just make your pivot on Select site,incidenttype,count(*) as incidentcount from incidents You may also exchange site and incidenttype for IDs referencing tables holding info on sites and incidenttypes. If you add a site to your organisation you simply add a row in a table. "When did ignorance become a point of view" - Dilbert
  • get the record identity from PostgreSQ/

    csharp help career
    3
    0 Votes
    3 Posts
    0 Views
    D
    Do either of these help? http://efreedom.com/Question/1-2944297/Postgresql-Function-Last-Inserted[^] http://bytes.com/topic/postgresql/answers/173510-get-last-id-insert[^]
  • parameter with the In function

    database tutorial question
    12
    0 Votes
    12 Posts
    2 Views
    J
    David Mujica wrote: Back in Oracle 9, I believe the max was 1000. And at least in 10 as well. http://forums.oracle.com/forums/thread.jspa?threadID=428758[^]
  • Check the database for existency.

    database sqlite tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    J
    T.RATHA KRISHNAN wrote: If I use LIKE key word,it doesn't fully serve my purpose. It does however answer your first question. With the additional detail that you have added then something like the following would be want you want. (Unless there are other yet unstated requirements.) select lower(name) from profile WHERE name LIKE 'sri%" T.RATHA KRISHNAN wrote: I've to restrict the number of records in a table. i.e I don't want to update the table if it already has 10 records in it. How to do this? Odd requirement. But do you know what 'count' does? You might want to get a book or use the online documentation and read through all of the functions that are available as part of the database. And if this system is part of a commercial/publicly available system you should look up sql injection attacks and ways to prevent that. Sql injection attacks are still a significant security problem.