- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to extract a value from database - using comma...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2008 05:53 AM
тАО05-19-2008 05:53 AM
How to extract a value from database - using command line ?
i guess it would be possible to extract a value from database - using command line or shell scripting.
Please throw some light on this as i am new to this concept.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2008 06:00 AM
тАО05-19-2008 06:00 AM
Re: How to extract a value from database - using command line ?
It would be helpful to know what database we're talking about here.
Bottom line is most database servers come with a binary for extracting data from the database files. Now due to security concerns the raw database files may have encrypted data in them, making it impossible to extract anything from the command line but gibberish.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2008 06:05 AM
тАО05-19-2008 06:05 AM
Re: How to extract a value from database - using command line ?
if it does, then you can use "here-docs" to extract data using a shell script. see the "man" page for whatever shell you are using. the concept is something along the lines of:
my_query_command <<-EOF
select blah from blahblah
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2008 06:07 AM
тАО05-19-2008 06:07 AM
Re: How to extract a value from database - using command line ?
we are using a method "cldb_getAllElements"
This method is suppose to return the list of elements in the set.
But when we remove all elements, and then try using the above method - we are encountering an error - as it tries to access an empty-list.!!
### This was the main problem ####
so i thought of extracting elements from database to check if the list is empty - through command line (Unix Shell) itself.
I guessed this might be a possible solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2008 08:36 PM
тАО05-19-2008 08:36 PM
Re: How to extract a value from database - using command line ?
void Cldb::getAllElements(string * result, int *status) {
string sql = string("SELECT short_name ");
sql.append(" FROM node, element ");
sql.append(" WHERE element.management_node_id != node.node_id;\n");
char *answer;
mysqlResult(sql, "getAllElements", status, &answer);
if( *status == 0) {
*result = trimHeaderFromSqlOutput(answer);
} else {
*result = string("");
}
}
=================================
Any idea as how to deal with an empty-list when this method is called ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 03:36 AM
тАО06-17-2009 03:36 AM