Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: yorge
  • Content: Threads
  • Order by date
  1. yorge

    Insert rows using CTE

    Hi Guys, Given sample tables below: CREATE TABLE [dbo].[TBL1]( [ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [ITEM_CODE] [varchar](20) NOT NULL, [CREATED_DATETIME] [datetime] NOT NULL ); CREATE TABLE [dbo].[TBL2]( [ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [TBL1ID] [int] NOT NULL...
  2. yorge

    Passing DBNAME as stored procedure parameter

    Hi Guys, Is there anyway to pass the database name as parameter to a stored procedure? Kindly refer to the script below. Parameter @chk_db will contain the DB name to use. TIA, Yorge create procedure check_tbl @chk_db nvarchar(50) as begin -- Create if exist. Create if not found. if not...
  3. yorge

    Update a column with random value

    Hi Guys, Anybody can suggest a query to update all rows randomly of a given table say MYTABLE.MYCOL of CHAR(1) data type with value of either 'X' or 'Y' only? Thanks, Yorge
  4. yorge

    Update/Delete duplicate rows

    Hi Guys, Given the rows on PETOWNER table ID PETID OWNER =================================== 1 1 Joe 2 2 Jane 3 3 Joey 4 4 Roy 5 3 Rey 6 6 James 7 5 Jet =================================== Given the rows on PET table ID ANIMALGROUPID TYPE TAGID...
  5. yorge

    Not Sure If this is a grouping question

    Hi Guys, Given the sample table below: ID X Y ----------------------- 1 25 24 2 24 25 3 75 1 4 9 10 5 10 9 ----------------------- I wanted a result like this: ID X Y...
  6. yorge

    List of all SPs and functions on a given DB

    Hi Guys, Can anybody suggest a query that will lists all SPs and functions which is NOT using temp tables with # notation? Thanks, Yorge
  7. yorge

    Contained Databases with AlwaysOn Availability Group running on MSSQL 2012

    Hi Guys, Just want to ask if any of you have a good tutorial (steps) link on the implementation of contained databases with AlwaysOn Availability Group. We have an existing DB and we want it to be converted to a contained database which will be part of a AlwaysOn Availability group. Thanks...
  8. yorge

    Contained Databases with AlwaysOn Availability SQL 2012

    Hi Guys, Just want to ask if any of you have a good tutorial (steps) link on the implementation of contained databases with AlwaysOn Availability Group. We have an existing DB and we want it to be converted to a contained database which will be part of a AlwaysOn Availability group. Thanks in...
  9. yorge

    Automatically start a DB when linux server is restarted/rebooted.

    Hi Guys, I'm using both oracle 11g/12c. Would like to ask if there's a way an oracle DB (and listener) can automatically be started whenever a Linux server is rebooted/restarted. Would gladly appreciate some steps and few sample code to do this if this is possible. Thanks, Yorge
  10. yorge

    Return unique row from a given set of rows

    Hi Guys, Given the sample data on a table: CODE CODESET LANGUAGE NAME ORDER ---------------------------------------------------------------------------------------------- PA_KNOWN FLAG_KNOWN ENG Known 10 PA_KNOWN FLAG_KNOWN NOB Kjent 10 PA_UNKNOWN FLAG_KNOWN...
  11. yorge

    Delete/Update duplicate records

    Hi Guys, Given the table and rows on it below: MYTABLE ----------------- CODE varchar(30) NAME varchar(100 DESCRIPTION(300) ----------------- CODE NAME DESCRIPTION...
  12. yorge

    Import/load XML file (record) to a normal table using Oracle 10g

    Hi Guys, I have this xml file (see attached). The idea is that using a normal oracle table (no xmltype datatype field), I want to load the record(s) on the xml file to this table but ONLY records for <OppfLegemiddelMerkevare>, and ONLY extract 3 elements (or whatever is that called) from this...
  13. yorge

    CTE(common table expressions)...help needed

    Hi Guys, I'm fairly new to CTE and I would like to ask a little help. Given the following tables: ITEM Table ITEMID(INT) ITEMREFERENCEID(INT) -------------------------------------- 1 48 2 50 3 51 4 52 5 53 6 54 7 55 8 56 9 57 10 58 11 59 12 60 13 61 14 62 15 63...
  14. yorge

    Shell script to watch disk space

    Hi Guys, Please help, I need script that will display partition name(s) and current size (for each partition) and then send an email notification in the event all or any of these partition(s) reach the threshold of 90% full. One email for each partition reaching the threshold. Im running on...
  15. yorge

    linux script to check oracle agent's status

    Hi Guys, Can anybody tell me if it's possible via linux script to check oracle agent's status? If it's stopped/down, then do a emctl start agent. Can anybody please show me some code lines. Thanks in advance, yorge
  16. yorge

    sequence increment based on MAX()

    Hi I need some help. Given a table "mytable" whose primary key is "myid" and a sequence assigned to this field for table "mytable_seq", If MAX(myid) is 100 and mytable_seq.currval is 50, I want to reset the value of mytable_seq to be 100...so that the next time a mytable_seq.nextval is called...

Part and Inventory Search

Back
Top