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 strongm 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: *

  1. scriptdan

    Getting ORA-12154: TNS:could not resolve service name

    I had been working on this a while. I just discovered my ORACLE_HOME variable was not being set. I went to control panel settings to set the ORACLE_HOME environment variable for my machine.
  2. scriptdan

    Getting ORA-12154: TNS:could not resolve service name

    Please help. I have installed active state perl along with the DBD:DBI drivers for ORACLE via PPM. I am able to SQLPLUS into the instance from the command prompt, but get a connection error when trying to connect to db. (see bottom of this post) Version Info perl, v5.6.1 built for...
  3. scriptdan

    Search for byte position of a string within a file

    Try nawk nawk 'BEGIN {bytepos=0}{sumlinebytes+=length($0);strpos=match($0,"yourstring");if (strpos) {bytepos=sumlinebytes+strpos-length($0);exit} } END {print bytepos}' yourfile
  4. scriptdan

    number of locks

    exec sp_lock
  5. scriptdan

    Deleting all duplicates but the last found...

    ##The first part (awk) inside the for loop gets the unique keys for id in $(awk -F"|" '{print $1}' yourfile |sort -u) do grep "$id" yourfile | tail -1 done result Z100035|USF Reddway Test Inc Z100036|Meijer Test Corp Z100038|USP Employee Corp Z100039|Frontier Inc Z100040|Foster Inc...
  6. scriptdan

    Convert Datetime

    Assuming the field is a datetime select convert(char(17),YourDatetimeHere,109)+substring(convert(char(26),YourDatetimeHere109),25,2)
  7. scriptdan

    How do I select giving total counts

    Not identical to format you requested, but I believe this gives results you are looking for. I limited results with a where clause so you could see example of output. SELECT substring(stateProvincenm,1,1), stateProvincenm FROM StateProvince WHERE countryCd='US' AND...
  8. scriptdan

    sp_configure max memory guideline

    You need to have enough for OS level functions to run. If you isolate your dataserver to its own box with no other users you can probably get away with using more ram for the dataserver. We have some boxes that only have the dataservers on them. For our purposes we use 1.5GB of ram for the...
  9. scriptdan

    search dir for string and print file and line number

    ## Replace $dir with the directory you want to search ## i.e . or / or ${HOME} ## ## replace both grep "string"s with the string you ## are searching for ## for file in $(find dir -exec grep -li string {} \;) do echo "FILE:$file\n________________\n" grep -n string $file done
  10. scriptdan

    sybase client version

    @@version is the version of the server software. isql -v should show the version of the client.
  11. scriptdan

    Looking for Sybase code to do what Oracle was able to do

    Sybase stores data a little differently than Oracle. Also, even though users have a default db (schema) that they are associated with, they can work in different db's if they are given permission. Here are some snippets. Not really sure what you are hoping to gain from items e and f. You can...
  12. scriptdan

    Alter table command

    You don't mention what version of ase Here is one solution you must have the 'select into' option for the db set. alter table TestTable add a integer null add b char(10) default 'test' -- You must provide default -- if you don't want nulls add c datetime null...
  13. scriptdan

    UDTs in temp table def

    Actually in my previous post I should note it is better to use #tableB as opposed to tempdb..tableB. The former is truly a temp table, while the latter will remain in tempdb until you drop it.
  14. scriptdan

    UDTs in temp table def

    try building the temp table by using select into. i.e if you have tableA with columns that are UDT, you can run select * into tempdb..tableB from yourdb..tableA where 0=1 -- false value here simply will cause -- empty table structure to be created -- and underlying type...

Part and Inventory Search

Back
Top