Challenge 35 – Can you find a specific XML element?
Challenge 35 involved creating the smallest function possible (based upon character count) to return the value of a specific element, at a specific position within the document.
A sample prototype for the function is shown below.
Please feel free to embellish the parameter list and the function body, using any method, language or add-on that you would like.
Sample XML Document
- Write a function to return the value of a specific element in an XML formatted document.
- The respondent with a correctly operating function using the least amount of code will be declared the winner.
The following is the correct response.
Winners (out of approximately 10 respondents)
Unfortunately, nobody had the correct or near correct answer.
Monthly Programming Tidbits
The SQL INSERT INTO SELECT Statement
The INSERT INTO SELECT statement copies data from one table and inserts it into another table.
- INSERT INTO SELECT requires that data types in source and target tables match
- The existing records in the target table are unaffected
INSERT INTO SELECT Syntax
Copy all columns from one table to another table:
INSERT INTO table2
SELECT * FROM table1
Copy only some columns from one table into another table:
INSERT INTO table2 (column1, column2, column3, …)
SELECT column1, column2, column3, …
Coding Challenge #36
Please stay tuned, SCS Coding Challenge #36 will be published this week. Details will follow. The winner will be awarded based upon the best approach.