Sponsored Content
Top Forums Programming Hierarchical Query for Sybase database Post 302975912 by Perlbaby on Tuesday 21st of June 2016 10:52:31 AM
Old 06-21-2016
Hierarchical Query for Sybase database

Team

I am using DBartisan tool for sybase database.
I have a table that has below fields Employee_ID,EMP_Name,First_Nm,Last_Nm,Emp_Designation,Employee's_Manager
is it possible to retrieve hierarchical data based on below fields
Emp_Designation will have Soft Engg,SSE,Team Lead, Architect,Vice President,President,CEO etc
Employee's_Manager names are again referred under EMP_Name where again he would be reporting to another manager under
"Employee's_Manager" column

Will it be possible to retrieve hierarchical data based on above fields/values by comparing to Employee's_Manager designation
Any help appreciated.

Last edited by Perlbaby; 06-21-2016 at 12:03 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connect to sybase database using Korn shell script

Hi, Can anyone please give me a script or let me know how to connect to a sybase database and execute a query using Korn shell scripts.Am new to Unix but i need to do this ASAP. Please help. Thanks, Gops (7 Replies)
Discussion started by: bhgopi
7 Replies

2. Shell Programming and Scripting

Dynamic update loop query on Sybase database

Hello Guys, I'm new to Shell scripting, and i need someone to help me with this issue: I'm trying to do a dynamic update query on Sysbase database table using shell script. Lets say, the Update query is "update Table set id=X" , where X is dynamic value for the loop index. If the loop is... (10 Replies)
Discussion started by: Alaeddin
10 Replies

3. Shell Programming and Scripting

Print out loop index on the console after executing each sybase DB query

Hello Guys, Well, using shell script, I'm doing loop on DB query as below: isql -Usa -Ptest -I /opt/sybase/interfaces << EOF use testdb go declare @i int select @i = 1 while(@i <= 5) begin Insert into TEST values (@i,"Test","TestDesc") select @i = @i + 1 end go EOF The Issue... (2 Replies)
Discussion started by: Alaeddin
2 Replies

4. Shell Programming and Scripting

Database Query

Hi, Am using informix database. When i give "isqlrf <database name> - " from the command prompt , i get connected to the database and i can run sql queries.. I am moving to freeBSD and when i give the same command at the prompt i get an error : Index already exists on column Why is this... (0 Replies)
Discussion started by: jisha
0 Replies

5. Programming

Need help with complex SQL query (Sybase)

Hello, I have three tables. I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist: (1) B.intID = A.intID (2) B.intID != C.intID or (B.intID = C.intID and (C.v1 = 0 or C.v2... (2 Replies)
Discussion started by: chatieremerrill
2 Replies

6. Windows & DOS: Issues & Discussions

how to connect to sybase database?

hi, I'd like to connect to a Sybase ASE 12 through a a graphic user interface (GUI) that run on windows and solaris10, because i need to do some querys. The database is running on solaris 10. I'm not an expert using databases, but i know how to use some SQL commands through command line... (3 Replies)
Discussion started by: danin
3 Replies

7. Shell Programming and Scripting

Execute stored procedure through script in sybase database and store the output in a .csv file

Hi, I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output. I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies

8. Programming

Sybase ASE: Query to find correct format issue.

Hi Team , I am new to Sybase Adaptive Server Enterprise/15.7 (ASE) and need some guidance to find the different values in serial format column. SELECT DISTINCT SERIAL_FORMAT FROM PRODUCTS It has values with below format which contains 12 digits hexadecimal characters with... (2 Replies)
Discussion started by: Perlbaby
2 Replies

9. Programming

Sybase ASE - Query Tuning - Need Suggestion

Dear Team Please provide suggestion on below query which is used in Sybase Adaptive Server Enterprise/15.7 (ASE). Query takes more time > 30 Mins to 1 Hr All required indexes are built Can we have any efficient approach to get the data retrieval faster for below query.Any help... (0 Replies)
Discussion started by: Perlbaby
0 Replies
QSqlField(3qt)															    QSqlField(3qt)

NAME
QSqlField - Manipulates the fields in SQL database tables and views SYNOPSIS
#include <qsqlfield.h> Public Members QSqlField ( const QString & fieldName = QString::null, QVariant::Type type = QVariant::Invalid ) QSqlField ( const QSqlField & other ) QSqlField & operator= ( const QSqlField & other ) bool operator== ( const QSqlField & other ) const virtual ~QSqlField () virtual void setValue ( const QVariant & value ) virtual QVariant value () const virtual void setName ( const QString & name ) QString name () const virtual void setNull () bool isNull () const virtual void setReadOnly ( bool readOnly ) bool isReadOnly () const void clear ( bool nullify = TRUE ) QVariant::Type type () const DESCRIPTION
The QSqlField class manipulates the fields in SQL database tables and views. QSqlField represents the characteristics of a single column in a database table or view, such as the data type and column name. A field also contains the value of the database column, which can be viewed or changed. Field data values are stored as QVariants. Using an incompatible type is not permitted. For example: QSqlField f( "myfield", QVariant::Int ); f.setValue( QPixmap() ); // will not work However, the field will attempt to cast certain data types to the field data type where possible: QSqlField f( "myfield", QVariant::Int ); f.setValue( QString("123") ); // casts QString to int QSqlField objects are rarely created explicitly in application code. They are usually accessed indirectly through QSqlRecord or QSqlCursor which already contain a list of fields. For example: QSqlCursor cur( "Employee" ); // create cursor using the 'Employee' table QSqlField* f = cur.field( "name" ); // use the 'name' field f->setValue( "Dave" ); // set field value ... In practice we rarely need to extract a pointer to a field at all. The previous example would normally be written: QSqlCursor cur( "Employee" ); cur.setValue( "name", "Dave" ); ... See also Database Classes. MEMBER FUNCTION DOCUMENTATION
QSqlField::QSqlField ( const QString & fieldName = QString::null, QVariant::Type type = QVariant::Invalid ) Constructs an empty field called fieldName of type type. QSqlField::QSqlField ( const QSqlField & other ) Constructs a copy of other. QSqlField::~QSqlField () [virtual] Destroys the object and frees any allocated resources. void QSqlField::clear ( bool nullify = TRUE ) Clears the value of the field. If the field is read-only, nothing happens. If nullify is TRUE (the default), the field is set to NULL. bool QSqlField::isNull () const Returns TRUE if the field is currently NULL; otherwise returns FALSE. bool QSqlField::isReadOnly () const Returns TRUE if the field's value is read only; otherwise returns FALSE. QString QSqlField::name () const Returns the name of the field. Example: sql/overview/table4/main.cpp. QSqlField &; QSqlField::operator= ( const QSqlField & other ) Sets the field equal to other. bool QSqlField::operator== ( const QSqlField & other ) const Returns TRUE if the field is equal to other; otherwise returns FALSE. Fields are considered equal when the following field properties are the same: name() isNull() value() isReadOnly() void QSqlField::setName ( const QString & name ) [virtual] Sets the name of the field to name. void QSqlField::setNull () [virtual] Sets the field to NULL and clears the value using clear(). If the field is read-only, nothing happens. See also isReadOnly() and clear(). void QSqlField::setReadOnly ( bool readOnly ) [virtual] Sets the read only flag of the field's value to readOnly. See also setValue(). void QSqlField::setValue ( const QVariant & value ) [virtual] Sets the value of the field to value. If the field is read-only (isReadOnly() returns TRUE), nothing happens. If the data type of value differs from the field's current data type, an attempt is made to cast it to the proper type. This preserves the data type of the field in the case of assignment, e.g. a QString to an integer data type. For example: QSqlCursor cur( "Employee" ); // 'Employee' table QSqlField* f = cur.field( "student_count" ); // an integer field ... f->setValue( myLineEdit->text() ); // cast the line edit text to an integer See also isReadOnly(). QVariant::Type QSqlField::type () const Returns the field's type. QVariant QSqlField::value () const [virtual] Returns the value of the field as a QVariant. Example: sql/overview/table4/main.cpp. SEE ALSO
http://doc.trolltech.com/qsqlfield.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qsqlfield.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QSqlField(3qt)
All times are GMT -4. The time now is 11:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy