0 - 20 of 20 tags for cursor

I am working on FETCH STATEMENT inside CURSOR. I need to convert a SQL server script into Teradata.
-----------------------------------------------------------------------------------------------------------------
Following scnerio is working in Teradata( SELECT columns )

SQL SERVER input:---------------------------------------

Hi All,

Looking for recommendations on Full Text search Tagging via LIKE / LIKE ANY etc.

 

This has to be dynamic, from a table of terms and tags.

 

I have a billion row table of free text (myPK bigint + myTEXT varchar 4000).

Hi,
How do I create a cursor within a cursor inside a stored procedure? Is it possible? There should be a cursor A and cursor B wherein cursor B uses data fetched from cursor A. I have tried a WITH RECURSIVE inside a cursor but it fails.
Thanks in advance!

Hi Folks,
I want to create a Stored Proc wherein I will first find a list of tables to be dropped as :

Hello all,
This is my first post on the TeraData developer forum. So I apologize in advance if my question has already been asked earlier or I did not follow any convention.
 

Dear Experts,
 I need to write a script to count the not null rows in each field in the each of data mart tables.
it should be possible to generate this script from the  Oracle dictionary I believe,
statement can be something like this :
 spool count_fields.sql

Many experienced SQL and procedure developers use SQL functions to perform common tasks and simplify their code narratives.

Hi.

 

I have a problem.

I have a cursor with a select statement.

The select statement returns 5 rows.

Row 1-- Select col 1

Row 2 --,col2

Row3---,col3

Row4---,col4

Row5--- From table A;

 

Ordered analytical functions enable parallel processing by freeing processes from flat logic. They also produce simpler Set SQL statements, which as a general rule can be expected to perform better than more complex Set SQL statements.

Hi All,

In Teradata document, SQL Reference : Stored Procedures and Embedded SQL :Release V2R6.1

I have read something about calling MACRO inside a procedure and declaring the results in Cursor

(The content is given below) When I tried the same thing in procedure, I have got a error saying it is Invalid.

Set SQL is a way of operating on data that is radically different from historical concepts of computer programming that can be diagrammed with flow charts.  Grab a cup of coffee and review some history that will explain why the industry is mired in cursor logic and loops that cannot exploit the power of today's software and hardware.

I'm attempting to develop a stored procedure that takes a table name as a parameter, and performs column-by-column updates to whatever table is passed in.

I have the dynamic SELECT query working correctly:

SET CURSOR_SQL = 'SELECT * FROM ' || P_TABLE_NAME || ' ORDER BY rsid;';
PREPARE CURSOR_STATEMENT FROM CURSOR_SQL;
OPEN CDC_CURSOR;
/* logic */
CLOSE CDC_CURSOR;

Now I'm at the point where I need to fetch the cursor data into local variables...but I can't create table-specific local variables because I don't know what tables will be passed into this procedure.

When Flat SQL looping logic involves complex processing of data elements from multiple tables, the loops can almost always be transformed into Set SQL with derived tables. By eliminating looping logic, the performance benefits of parallel processing can be exploited.

Hi ,

I have a dynamic cursor like this

below one is not that exact query:

Declare merge_cursor_statement VARCHAR(3000);
Declare RefCursor2 CURSOR WITH RETURN ONLY FOR merge_cursor_statement;

SET merge_cursor_statement='LOCKING ROW FOR ACCESS SELECT columname deom dbc.columns';
now i want to use the columname from this query and assin to another variable
but when i m using the

OPEN RefCursor2;
L5:
LOOP
FETCH RefCursor2 INTO var1;

The most difficult task when converting Flat SQL (cursor-based procedural code) to Set SQL involves translating complex logic and accounting for multiple data sources.  The Derived Table feature of Set SQL simplifies this process.

Perhaps the easiest way to transition from a flat logic mindset to a set logic mindset is to convert some Flat SQL to Set SQL, then stare at both of them until the logical equivalence of the two approaches becomes clear.

Maximizing the full potential of Teradata's Massive Parallel Processing requires Set Processing.

I want to get a recordset in asp which is returned from teradata stored procedure.

Create PROCEDURE test() DYNAMIC RESULT SETS 1
BEGIN DECLARE cur1 CURSOR WITH RETURN only FOR
SELECT
col1,col2
from myTable;
OPEN cur1;
END;
-----------------it running well and get a result list correctly by execute "call test()" in SQL Assistant.----------------------------

Then I tried several different ways in ASP to get the result list:

***DB connection using ODBC as:

Set DBConn = Server.CreateObject("ADODB.Connection")