Transform rows to files in an SQL statement.

75 pts.
Tags:
AS/400
SQL
SQL statements
Hello
We hava been able to produce the SQL that returns us a Vertical table with the LABELTEXT
 from table CLIENTES
(sql against qsys2/syscolumns).
  SELECT LABELTEXT FROM QSYS2.SYSCOLUMNS WHERE TABLE_NAME = 'CLIENTES' AND TABLE_SCHEMA = 'MANEL'
Observe vertical orientation.
Column 1 Column 2 xhrname Name xhrsurname   Last Name Now I would like to join this column label names (name, last name), which will be different for another table (so they should be variables), and add them to another sql select from the same table and library, whicch would only obtain data. Brian SMith, Laura Willcox...... Otherwise , can an sql be done to a table that already brings along the column headings, instedad of column 1, column 2....? Thanks   Ricardo  
 
 


Software/Hardware used:
as400, axes from lansa

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Assume that you have a table TBL1:
    EmpID       INTEGER
    EmpName     CHAR (25)
    EmpDate     DATE
    EmpSalary   DECIMAL (5,2)
    Those columns have related text as "Employee ID Nbr", Employee Name", "Employee Hire Date" and "Employee Salary". Are you asking for a way to have a result set that has four columns with the values "Employee ID Nbr", Employee Name", "Employee Hire Date" and "Employee Salary" in the first row, and that will be followed by values from the table in all later rows. If so, how are you intending to convert the string "Employee Hire Date" to match the DATE data type or the string "Employee ID Nbr" to match the INTEGER data type? Now, you could convert INTEGER, DATE and DECIMAL data types to VARCHARs or some other character string type. Is that what you expect to do? It might be easiest if you give an example of a table with values along with the actual rows you want in the result set. It's possible to do, though it seems like it's a very convoluted way to get it done. It just isn't clear what you need to accomplish. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following