User Profile

Collapse

Profile Sidebar

Collapse
littlemaster
littlemaster
Last Activity: Jan 5 '11, 10:42 AM
Joined: Apr 9 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • How to insert values into array data type field (psql)

    I am having table in psql it has one field as integer array data type.
    From rails application I was not able to insert value in that filed.

    Example:
    Need to add multiple userid in the name field.

    create table users(name integer[],id serial);

    a=10
    obj-User.new
    obj.name='{a}' # this inserting value as a.
    obj.name='{#{a} }' # this giving error.

    If anyone faced...
    See more | Go to post

  • littlemaster
    replied to How to use 2 schema at a same time?
    in Ruby
    It was not working as per expected. I have used database.yml file with specifying 2 schemas.
    See more | Go to post

    Leave a comment:


  • How to insert special characters in psql?

    I am having a file, that have to be inserted into db in text data type field. I am facing issue when the file having special characters like ( ,),. Kindly check the attached file for example.

    Insert query only I have used.

    Example:

    Code:
    obj=PGconn.connect(host,port'','',dbname,username,password")
    input="Last Cron Entry is = #50 23  * * *  /ProActive/bin/Logparser_NORTEL.pl -f /Zivah/Station/CTIServer/Nortel/logs/api_`date
    ...
    See more | Go to post
    Last edited by Niheel; Dec 14 '10, 09:20 PM.

  • littlemaster
    started a topic How to get gpg command output in rails?
    in Ruby

    How to get gpg command output in rails?

    scenario:
    ---------

    Need to upload the gpg encrypted file.
    Get that file and do decryption and store the output in a file
    Then extract that file and get the actual output

    Problem:
    -----------

    If I execute that command via command line, it was executed successfully. But via system command it was not running. The decrypted output will have control character. I think due to that...
    See more | Go to post

  • littlemaster
    started a topic How to use 2 schema at a same time?
    in Ruby

    How to use 2 schema at a same time?

    I want to use two schema in single rails application, for that how to specify the schema name in model. Tried with following, it was not working.
    set_table_name "schemaname.tab lename"

    schema names:

    1. addressbook
    2. schedule

    Need to fetch the details from addressboook schema and have to get some data from user and need to store it in a 'schedule' schema with all details.
    See more | Go to post

  • littlemaster
    replied to sum() is not working
    sum() not working

    Yes, absolutely .. I forgot .. now it is working fine.. Any way thanks...
    See more | Go to post

    Leave a comment:


  • ssh problem in ruby

    yes. I can login with ssh by entering password.
    See more | Go to post

    Leave a comment:


  • littlemaster
    started a topic sum() is not working

    sum() is not working

    Hi,
    I am having database in debian os. In that sum() giving expected output.
    I have changed my database from debian to lenny. In that sum() is not available. It shows the following error. Can any one help me to solve this ?

    user => SELECT cmp_id ,sum(*) as count from schedules group by cmp_id;
    ERROR: function sum() does not exist
    LINE 1: SELECT cmp_id ,sum(*) as count from schedules group by cmp_i......
    See more | Go to post

  • Could you able to understand my question?

    In sendmail function, there is no option to attach file. U can configure the file attachment details properly. How will you embed this ?
    See more | Go to post

    Leave a comment:


  • It is sending mail properly with text message. It is not attach the file. In that program no syntax specified to attach mail.I have already tried this example. Any other simplest example ???
    See more | Go to post

    Leave a comment:


  • littlemaster
    started a topic Sending an email with attachment file
    in Ruby

    Sending an email with attachment file

    The following program will send the mail with specified attachment file.Need to give the absolute path of the file.

    require "rubygems"
    require "ruport"
    require "ruport/util"

    r = Ruport::Report. new

    r.add_mailer :default,
    :host => "192.168.1. 1",
    :address => "xxxx@bksys.co. in"

    r.send_to("xxxx @bksys.co.in")...
    See more | Go to post

  • littlemaster
    started a topic How to attach file in an e-mail using ruby?
    in Ruby

    How to attach file in an e-mail using ruby?

    I have the following code, it is sending text message. I want to attach a file. How to do that?

    require 'net/smtp' # plain mail
    smtpclient = Net::SMTP::new( '192.168.1.1' ) # create new object to send mail
    the_email="From : ruby_using_smtp @webdevel.co.in \nTo:xxxx@bksys .co.in\nSubject :Birthday \n\n"+"This is for demo" #Frame a mail
    smtpclient.star t # start the mail process
    smtpclient.send mail(the_email,...
    See more | Go to post

  • I have tried this example, but it didn't works for me.
    See more | Go to post

    Leave a comment:


  • littlemaster
    started a topic What is the Difference between DSA and RSA?

    What is the Difference between DSA and RSA?

    I have two servers. I want to do ssh between two servers with out asking password. One is having RSA and another one is having DSA. I am having all control of one server only ( which is having RSA key). How to solve this issue?
    See more | Go to post

  • littlemaster
    started a topic ajax scaffold
    in Ruby

    ajax scaffold

    I have created rails application using ajax scaffold. It is easy for CRUD operation. If I use independent table its working perfectly. I have used two tables, which is referring another table. I need to show the parent table value in child table view.

    For example:
    User table: id,no,name,mark s
    Dept table: id,userid,dept name, dept no

    In 'Dept' table view ,I need to show the username . It is showing the id of...
    See more | Go to post
    Last edited by Niheel; May 25 '10, 07:35 AM. Reason: minor edits

  • littlemaster
    started a topic How to run command in another/remote host?
    in Ruby

    How to run command in another/remote host?

    I need to run a command in remote host, I tried the following but I got error. Kindly solve this,

    #!/usr/bin/env ruby
    require 'rubygems'
    require 'net/ssh'

    HOST = '192.168.1.113'
    USER = 'username'
    PASS = 'password'

    Net::SSH.start( HOST, USER, :password => PASS ) do|ssh|
    ssh.exec('ls')
    end

    Error:
    /usr/lib/ruby/1.8/net/ssh/session.rb:132: in...
    See more | Go to post

  • littlemaster
    started a topic Replication of tables
    in Ruby

    Replication of tables

    I am having two DB in postgres. Need proper exapmple for 'rubyrep' tool , to replicate all the tables in A database to B data base.

    My sync.conf file is,
    -----------------------


    RR::Initializer ::run do |config|
    config.left = {
    :adapter => 'postgresql',
    :database => 'savithri',
    :username => 'savithri',
    :password => 'savithri',
    ...
    See more | Go to post

  • littlemaster
    replied to Include files in shell script.
    Using 'source' we can acheive teh including of files in shell script.

    Example:

    filename: config
    var=260

    filename: a.sh
    Code:
    source config
    echo $var
    when we run the a.sh file, we can get the 'var' value as, 250..
    See more | Go to post
    Last edited by numberwhun; May 10 '10, 12:16 PM. Reason: Please use code tags!

    Leave a comment:


  • littlemaster
    started a topic ssh & scp using ruby code

    ssh & scp using ruby code

    require 'rubygems'
    require 'net/ssh'
    require 'net/sftp'
    Net::SSH.start( '192.168.1.32', 'test', 'test') do |ssh|
    ssh.sftp.connec t do |sftp|

    dir=sftp.opendi r("/home/delivery_team/Plan\ of\ work")
    for item in sftp.readdir(di r)
    if not (item.filename == "." or item.filename == "..")
    source = sftp.open("/home/user1/work/Plan\...
    See more | Go to post

  • littlemaster
    started a topic Include files in shell script.

    Include files in shell script.

    I have one configuration file. It will be used by perl and shell script. From perl using 'require' I have included the configuration file. Using require, include statement I tried in shell script , but it was not working.
    How to include a file and read value from that file using shell script?
    See more | Go to post
No activity results to display
Show More
Working...